diff --git a/debian/config.json b/debian/config.json index 6ab67d57f1b5..fecbd4b8a266 100644 --- a/debian/config.json +++ b/debian/config.json @@ -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" } diff --git a/debian/shadowsocks-rust.postinst b/debian/shadowsocks-rust.postinst index c39b2af27a03..12fc0bbb6013 100644 --- a/debian/shadowsocks-rust.postinst +++ b/debian/shadowsocks-rust.postinst @@ -21,20 +21,17 @@ pathfind() { case "$1" in configure|reconfigure) pathfind setcap && setcap \ - cap_net_bind_service+ep /usr/bin/ssservice \ + cap_net_bind_service+ep /usr/bin/ssservice \ cap_net_bind_service+ep /usr/bin/sslocal \ 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 ;;