1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-21 18:06:36 +02:00

update outline-ss-server

This commit is contained in:
kev 2024-09-14 16:00:41 +08:00
parent fd28335392
commit 17695aed57
2 changed files with 21 additions and 13 deletions

View File

@ -1,9 +1,13 @@
keys:
- id: foo
port: 8388
cipher: chacha20-ietf-poly1305
secret: Thi8aoqu8Tha
- id: bar
port: 8388
cipher: chacha20-ietf-poly1305
secret: mAequ6Hied8M
services:
- listeners:
- type: tcp
address: "[::]:8388"
- type: udp
address: "[::]:8388"
keys:
- id: foo
cipher: chacha20-ietf-poly1305
secret: Thi8aoqu8Tha
- id: bar
cipher: chacha20-ietf-poly1305
secret: mAequ6Hied8M

View File

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