1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-01-24 05:17:06 +02:00
2024-08-30 12:21:02 +08:00

15 lines
354 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
# pwgen 12 1
NAME=${1:?name is empty}
REMARK=${2:-EasyPi}
SERVER="127.0.0.1:9443"
CIPHER="chacha20-ietf-poly1305"
SECRET=$(yq -o json config.yml | jq -e -r --arg name "$NAME" '.keys[]|select(.id==$name).secret')
DIGEST=$(echo -n "$CIPHER:$SECRET" | base64 | sed 's/=*$//')
echo "ss://$DIGEST@$SERVER/?outline=1#$REMARK"