mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-02-09 01:59:16 +08:00
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:
2
debian/config.json
vendored
2
debian/config.json
vendored
@@ -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"
|
||||
}
|
||||
|
||||
11
debian/shadowsocks-rust.postinst
vendored
11
debian/shadowsocks-rust.postinst
vendored
@@ -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
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user