Skip to content

Commit

Permalink
debian: fixup debian packaging build scripts (#1722)
Browse files Browse the repository at this point in the history
* 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 [email protected]

Add `DynamicUser=yes` in [email protected]

* debian: update [email protected]

Add `DynamicUser=yes` in [email protected]

---------

Co-authored-by: mesher2024 <[email protected]>
  • Loading branch information
mesher2024 and mesher2024 authored Oct 21, 2024
1 parent 7356e36 commit ac3dc69
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9
10
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: shadowsocks-rust
Section: net
Priority: optional
Maintainer: Y. T. Chung <[email protected]>
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

Expand Down
1 change: 1 addition & 0 deletions debian/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions debian/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 1 addition & 2 deletions debian/shadowsocks-rust.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 1 addition & 2 deletions debian/shadowsocks-rust.service
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down

0 comments on commit ac3dc69

Please sign in to comment.