diff --git a/debian/compat b/debian/compat index ec635144f600..f599e28b8ab0 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -9 +10 diff --git a/debian/control b/debian/control index 94d0284728c4..ea233796f04e 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: shadowsocks-rust Section: net Priority: optional Maintainer: Y. T. Chung -Build-Depends: debhelper (>=9), rustc, cargo, apg | pwgen, libcap2-bin [linux-any] +Build-Depends: debhelper (>=9), rustc, cargo, libcap2-bin [linux-any] Standards-Version: 3.9.6 Homepage: https://github.com/shadowsocks/shadowsocks-rust diff --git a/debian/shadowsocks-rust-local@.service b/debian/shadowsocks-rust-local@.service index 05a99643b517..ec609b92aeb3 100644 --- a/debian/shadowsocks-rust-local@.service +++ b/debian/shadowsocks-rust-local@.service @@ -13,6 +13,7 @@ After=network.target Type=simple CapabilityBoundingSet=CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_BIND_SERVICE +DynamicUser=yes ExecStart=/usr/bin/ssservice local --log-without-time -c /etc/shadowsocks-rust/%i.json [Install] diff --git a/debian/shadowsocks-rust-server@.service b/debian/shadowsocks-rust-server@.service index 0f129e782ebd..73f59d561de2 100644 --- a/debian/shadowsocks-rust-server@.service +++ b/debian/shadowsocks-rust-server@.service @@ -13,6 +13,7 @@ After=network.target Type=simple CapabilityBoundingSet=CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_BIND_SERVICE +DynamicUser=yes ExecStart=/usr/bin/ssservice server --log-without-time -c /etc/shadowsocks-rust/%i.json [Install] diff --git a/debian/shadowsocks-rust.postinst b/debian/shadowsocks-rust.postinst index 12fc0bbb6013..e8a2be7e24b5 100644 --- a/debian/shadowsocks-rust.postinst +++ b/debian/shadowsocks-rust.postinst @@ -27,8 +27,7 @@ case "$1" in if [ ! -f /etc/shadowsocks-rust/config.json ]; then set +e passwd=$(/usr/bin/ssservice genkey -m "chacha20-ietf-poly1305") - passwd="${passwd//+/\\+}" - passwd="${passwd//\//\\/}" + passwd=$(echo $passwd | sed "s/+/\\\\+/g" | sed "s/\\//\\\\\\//g") set -e mkdir -p /etc/shadowsocks-rust sed "s/barfoo/$passwd/" /usr/share/shadowsocks-rust/config.json \ diff --git a/debian/shadowsocks-rust.service b/debian/shadowsocks-rust.service index af56887d7e9c..f4b807d43eb5 100644 --- a/debian/shadowsocks-rust.service +++ b/debian/shadowsocks-rust.service @@ -11,8 +11,7 @@ After=network.target [Service] Type=simple EnvironmentFile=/etc/default/shadowsocks-rust -User=nobody -Group=nogroup +DynamicUser=yes LimitNOFILE=32768 ExecStart=/usr/bin/ssservice server -c ${CONFFILE} ${DAEMON_ARGS}