debian: fixup debian packaging build scripts (#1722)

* debian: fix up postinst bad substitution

Fix up postinst bad substitution caused by Bash string manipulation in the Dash script.

* debian: update compat file

Fix up the warning caused by compatibility levels before 10 are deprecated.

* debian: replace user nobody in systemd file with dynamicuser

* debian: remove dependency on apg and pwgen in control file

* debian: update shadowsocks-rust-server@.service

Add `DynamicUser=yes` in shadowsocks-rust-server@.service

* debian: update shadowsocks-rust-local@.service

Add `DynamicUser=yes` in shadowsocks-rust-local@.service

---------

Co-authored-by: mesher2024 <mesher2024@users.noreply.github.com>
This commit is contained in:
mesher2024
2024-10-21 10:02:33 +08:00
committed by GitHub
parent 7356e367e4
commit ac3dc699c3
6 changed files with 6 additions and 6 deletions

2
debian/compat vendored
View File

@@ -1 +1 @@
9
10

2
debian/control vendored
View File

@@ -2,7 +2,7 @@ Source: shadowsocks-rust
Section: net
Priority: optional
Maintainer: Y. T. Chung <zonyitoo@gmail.com>
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

View File

@@ -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]

View File

@@ -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]

View File

@@ -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 \

View File

@@ -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}