go-tools/sign.sh

23 lines
453 B
Bash
Raw Permalink Normal View History

2024-03-24 15:19:26 -06:00
#!/bin/bash
AUTH=xuu:zero-punish-whenever-swell
SSH_KEY=~/.ssh/id_ed25519
MERCURY_URL=localhost:4088/v1/mercury/config
SIGFILE=$(mktemp)
http --auth "$AUTH" \
GET "$MERCURY_URL" \
space=="$1" |\
sed '/^----/,$d' |\
tee "$SIGFILE" | tee test | \
ssh-keygen -Y sign \
-f "$SSH_KEY" \
-n file >> "$SIGFILE"
http -f \
--auth "$AUTH" \
POST "$MERCURY_URL" \
"content@$SIGFILE"
rm "$SIGFILE"