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:
parent
fd28335392
commit
17695aed57
@ -1,9 +1,13 @@
|
||||
services:
|
||||
- listeners:
|
||||
- type: tcp
|
||||
address: "[::]:8388"
|
||||
- type: udp
|
||||
address: "[::]:8388"
|
||||
keys:
|
||||
- id: foo
|
||||
port: 8388
|
||||
cipher: chacha20-ietf-poly1305
|
||||
secret: Thi8aoqu8Tha
|
||||
- id: bar
|
||||
port: 8388
|
||||
cipher: chacha20-ietf-poly1305
|
||||
secret: mAequ6Hied8M
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user