1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:31 +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: services:
- id: foo - listeners:
port: 8388 - type: tcp
cipher: chacha20-ietf-poly1305 address: "[::]:8388"
secret: Thi8aoqu8Tha - type: udp
- id: bar address: "[::]:8388"
port: 8388 keys:
cipher: chacha20-ietf-poly1305 - id: foo
secret: mAequ6Hied8M cipher: chacha20-ietf-poly1305
secret: Thi8aoqu8Tha
- id: bar
cipher: chacha20-ietf-poly1305
secret: mAequ6Hied8M

View File

@ -2,13 +2,17 @@
set -euo pipefail set -euo pipefail
# pwgen 12 1 # pwgen -1 12 1
NAME=${1:?name is empty} NAME=${1:?name is empty}
REMARK=${2:-EasyPi} REMARK=${2:-EasyPi}
SERVER="127.0.0.1:9443" SERVER=127.0.0.1
PORT=8388
CIPHER="chacha20-ietf-poly1305" 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/=*$//') DIGEST=$(echo -n "$CIPHER:$SECRET" | base64 | sed 's/=*$//')
echo "ss://$DIGEST@$SERVER/?outline=1#$REMARK" echo "ss://$DIGEST@$SERVER:$PORT/?outline=1#$REMARK"