Skip to content

Commit

Permalink
Remove dependency on pwgen
Browse files Browse the repository at this point in the history
Fixes #1700

Signed-off-by: Marek Küthe <[email protected]>
  • Loading branch information
marek22k committed Oct 4, 2024
1 parent f950ba5 commit 05b12ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion debian/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
13 changes: 5 additions & 8 deletions debian/shadowsocks-rust.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand Down

0 comments on commit 05b12ad

Please sign in to comment.