From 17695aed57df390f08ce0039cd3e57a54c5fbd12 Mon Sep 17 00:00:00 2001 From: kev Date: Sat, 14 Sep 2024 16:00:41 +0800 Subject: [PATCH] update outline-ss-server --- outline-ss-server/data/config.yml | 22 +++++++++++++--------- outline-ss-server/data/keygen.sh | 12 ++++++++---- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/outline-ss-server/data/config.yml b/outline-ss-server/data/config.yml index 32db971..c23aa71 100644 --- a/outline-ss-server/data/config.yml +++ b/outline-ss-server/data/config.yml @@ -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 diff --git a/outline-ss-server/data/keygen.sh b/outline-ss-server/data/keygen.sh index 4b35188..4939af9 100755 --- a/outline-ss-server/data/keygen.sh +++ b/outline-ss-server/data/keygen.sh @@ -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"