Remove dependency on pwgen (#1702)

Fixes https://github.com/shadowsocks/shadowsocks-rust/issues/1700

Signed-off-by: Marek Küthe <m.k@mk16.de>
This commit is contained in:
Marek Küthe
2024-10-04 17:48:41 +02:00
committed by GitHub
parent f950ba5632
commit f64d745aae
2 changed files with 6 additions and 9 deletions

2
debian/config.json vendored
View File

@@ -3,7 +3,7 @@
"server_port": 8388,
"local_address": "127.0.0.1",
"local_port": 1080,
"password": "barfoo!",
"password": "barfoo",
"timeout": 300,
"method": "chacha20-ietf-poly1305"
}

View File

@@ -26,15 +26,12 @@ case "$1" in
cap_net_bind_service+ep /usr/bin/ssserver
if [ ! -f /etc/shadowsocks-rust/config.json ]; then
set +e
pathfind apg
if [ $? -eq 0 ]; then
passwd=$(apg -n 1 -M ncl)
else
passwd=$(pwgen 12 1)
fi
passwd=$(/usr/bin/ssservice genkey -m "chacha20-ietf-poly1305")
passwd="${passwd//+/\\+}"
passwd="${passwd//\//\\/}"
set -e
mkdir -p /etc/shadowsocks-rust
sed "s/barfoo!/$passwd/" /usr/share/shadowsocks-rust/config.json \
sed "s/barfoo/$passwd/" /usr/share/shadowsocks-rust/config.json \
> /etc/shadowsocks-rust/config.json
fi
;;