-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
33 lines (30 loc) · 996 Bytes
/
Taskfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
version: 3
tasks:
start:
cmds:
# CGO_CFLAGS_ALLOW="-Xpreprocessor"
# tip: do `brew reinstall vips` if you run across any error while compiling
- SECRET=mylocalsecret go run .
open-file:
cmds:
- open "http://localhost:8080/{{ .HASH }}/{{ .TYPE }}/{{ .PATH }}"
vars:
SECRET: mylocalsecret
TYPE: "{{ .CLI_ARGS | splitArgs | first }}"
PATH: "{{ index (.CLI_ARGS | splitArgs) 1 }}"
HASH_SCRIPT: |
const crypto = require('crypto')
const secret = "{{ .SECRET }}"
const path = "{{ .TYPE }}/{{ .PATH }}"
const hash = crypto.createHmac('sha1', secret)
.update(path)
.digest('base64')
.slice(0, 40)
.replace(/\+/g, '-').replace(/\//g, '_')
console.log(hash)
HASH:
sh: |
echo {{ .HASH_SCRIPT | shellQuote }} | node
podman-buildx:
cmds:
- podman buildx build --platform linux/arm64,linux/amd64 . -t blesswinsamuel/media-proxy