diff --git a/debian/README.Debian b/debian/README.Debian index bdf18be9..ba320aef 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -12,4 +12,4 @@ if the user starts a service called "shadowsocks-libev-local@foobar.service", This service instance will start the "ss-local" client and read /etc/shadowsocks-libev/foobar.json as its configuration file. - -- Boyuan Yang <073plan@gmail.com> Thu, 08 Sep 2016 19:01:20 +0800 + -- Boyuan Yang Thu, 08 Sep 2016 19:01:20 +0800 diff --git a/debian/config.json b/debian/config.json index 12d49226..c9e39ed2 100644 --- a/debian/config.json +++ b/debian/config.json @@ -1,5 +1,6 @@ { - "server":"127.0.0.1", + "server":["::1", "127.0.0.1"], + "mode":"tcp_and_udp", "server_port":8388, "local_port":1080, "password":"barfoo!", diff --git a/debian/control b/debian/control index 8a8be0ff..5267a3fb 100644 --- a/debian/control +++ b/debian/control @@ -1,8 +1,11 @@ Source: shadowsocks-libev Section: net Priority: optional -Maintainer: Roger Shimizu -Uploaders: Max Lv , Boyuan Yang <073plan@gmail.com> +Maintainer: Debian Bridges Team +Uploaders: + Max Lv , + Boyuan Yang , + Roger Shimizu Build-Depends: asciidoc-base | asciidoc, debhelper (>= 10), @@ -14,6 +17,7 @@ Build-Depends: pkg-config, xmlto Standards-Version: 4.1.1 +Rules-Requires-Root: no Homepage: https://www.shadowsocks.org Vcs-Git: https://github.com/shadowsocks/shadowsocks-libev.git Vcs-Browser: https://github.com/shadowsocks/shadowsocks-libev @@ -22,8 +26,8 @@ Package: shadowsocks-libev Replaces: shadowsocks (<< 1.5.3-2) Breaks: shadowsocks (<< 1.5.3-2) Architecture: any +Pre-Depends: ${misc:Pre-Depends} Depends: - apg | pwgen, libcap2-bin [linux-any], lsb-base (>= 3.0-6), ${misc:Depends}, @@ -36,7 +40,7 @@ Description: lightweight and secure socks5 proxy Shadowsocks-libev is a lightweight and secure socks5 proxy for embedded devices and low end boxes. . - Shadowsocks-libev was inspired by Shadowsock (in Python). It's rewritten + Shadowsocks-libev was inspired by Shadowsocks (in Python). It's rewritten in pure C and only depends on libev, mbedTLS and a few other tiny libraries. @@ -52,7 +56,7 @@ Description: lightweight and secure socks5 proxy (development files) Shadowsocks-libev is a lightweight and secure socks5 proxy for embedded devices and low end boxes. . - Shadowsocks-libev was inspired by Shadowsock (in Python). It's rewritten + Shadowsocks-libev was inspired by Shadowsocks (in Python). It's rewritten in pure C and only depends on libev, mbedTLS and a few other tiny libraries. . @@ -74,7 +78,7 @@ Description: lightweight and secure socks5 proxy (shared library) Shadowsocks-libev is a lightweight and secure socks5 proxy for embedded devices and low end boxes. . - Shadowsocks-libev was inspired by Shadowsock (in Python). It's rewritten + Shadowsocks-libev was inspired by Shadowsocks (in Python). It's rewritten in pure C and only depends on libev, mbedTLS and a few other tiny libraries. . diff --git a/debian/copyright b/debian/copyright index d8f01ee1..aa8e2484 100644 --- a/debian/copyright +++ b/debian/copyright @@ -5,18 +5,18 @@ Source: https://github.com/shadowsocks/shadowsocks-libev Files: * Copyright: 2013-2015, Clow Windy - 2013-2017, Max Lv + 2013-2018, Max Lv 2014, Linus Yang License: GPL-3+ Files: debian/* Copyright: 2013-2015, Max Lv - 2015-2017, Boyuan Yang <073plan@gmail.com> - 2016-2017, Roger Shimizu + 2015-2018, Boyuan Yang <073plan@gmail.com> + 2016-2019, Roger Shimizu License: GPL-3+ Files: doc/* -Copyright: 2012-2017, Max Lv +Copyright: 2012-2018, Max Lv License: GFDL-1.1+ Files: m4/ax_pthread.m4 @@ -38,7 +38,7 @@ Copyright: 2007 Google Inc. License: Apache-2.0 Files: scripts/build_deb.sh -Copyright: 2017 Roger Shimizu +Copyright: 2018 Roger Shimizu License: GPL-3+ Files: src/base64.c src/base64.h diff --git a/debian/rules b/debian/rules index 5d26d753..728292fb 100755 --- a/debian/rules +++ b/debian/rules @@ -20,5 +20,8 @@ override_dh_auto_configure: override_dh_installchangelogs: dh_installchangelogs -XChanges +override_dh_missing: + dh_missing --fail-missing + %: dh $@ diff --git a/debian/shadowsocks-libev-local@.service b/debian/shadowsocks-libev-local@.service index 146452fb..e6470907 100644 --- a/debian/shadowsocks-libev-local@.service +++ b/debian/shadowsocks-libev-local@.service @@ -18,8 +18,8 @@ After=network-online.target Type=simple CapabilityBoundingSet=CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_BIND_SERVICE +DynamicUser=true ExecStart=/usr/bin/ss-local -c /etc/shadowsocks-libev/%i.json [Install] WantedBy=multi-user.target - diff --git a/debian/shadowsocks-libev-redir@.service b/debian/shadowsocks-libev-redir@.service index 5a96461e..242c6404 100644 --- a/debian/shadowsocks-libev-redir@.service +++ b/debian/shadowsocks-libev-redir@.service @@ -18,8 +18,8 @@ After=network-online.target Type=simple CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +DynamicUser=true ExecStart=/usr/bin/ss-redir -c /etc/shadowsocks-libev/%i.json [Install] WantedBy=multi-user.target - diff --git a/debian/shadowsocks-libev-server@.service b/debian/shadowsocks-libev-server@.service index 0d3a8fdd..6e333f9e 100644 --- a/debian/shadowsocks-libev-server@.service +++ b/debian/shadowsocks-libev-server@.service @@ -18,8 +18,8 @@ After=network-online.target Type=simple CapabilityBoundingSet=CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_BIND_SERVICE +DynamicUser=true ExecStart=/usr/bin/ss-server -c /etc/shadowsocks-libev/%i.json [Install] WantedBy=multi-user.target - diff --git a/debian/shadowsocks-libev-tunnel@.service b/debian/shadowsocks-libev-tunnel@.service index a5c56728..68d85171 100644 --- a/debian/shadowsocks-libev-tunnel@.service +++ b/debian/shadowsocks-libev-tunnel@.service @@ -18,8 +18,8 @@ After=network-online.target Type=simple CapabilityBoundingSet=CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_BIND_SERVICE +DynamicUser=true ExecStart=/usr/bin/ss-tunnel -c /etc/shadowsocks-libev/%i.json [Install] WantedBy=multi-user.target - diff --git a/debian/shadowsocks-libev.NEWS b/debian/shadowsocks-libev.NEWS new file mode 100644 index 00000000..6077ea9c --- /dev/null +++ b/debian/shadowsocks-libev.NEWS @@ -0,0 +1,20 @@ +shadowsocks-libev (3.2.0+ds-5) unstable; urgency=medium + + There is a mode setting to choose whether to enable both TCP and + UDP, or only one of them. This setting was set to "tcp_and_udp" in + /etc/default/shadowsocks-libev, /etc/init.d/shadowsocks-libev + (for init system only), and maybe also in config.json added by user, + which is quite confusing. + + So we moved this setting to config.json. Since we won't update + config.json on package upgrade, please add the following to your + /etc/shadowsocks-libev/config.json. + + "mode":"tcp_and_udp", + + Otherwise you setting will be TCP only. + For more about TCP/UDP mode, please refer the ticket upstream: + + - https://github.com/shadowsocks/shadowsocks-libev/issues/1870 + + -- Roger Shimizu Sun, 07 Oct 2018 00:48:07 +0900 diff --git a/debian/shadowsocks-libev.default b/debian/shadowsocks-libev.default index 4d74ecea..9677384a 100644 --- a/debian/shadowsocks-libev.default +++ b/debian/shadowsocks-libev.default @@ -15,7 +15,7 @@ START=yes CONFFILE="/etc/shadowsocks-libev/config.json" # Extra command line arguments -DAEMON_ARGS="-u" +DAEMON_ARGS= # User and group to run the server as USER=nobody diff --git a/debian/doc-base b/debian/shadowsocks-libev.doc-base similarity index 100% rename from debian/doc-base rename to debian/shadowsocks-libev.doc-base diff --git a/debian/shadowsocks-libev.docs b/debian/shadowsocks-libev.docs index fd8ed94a..5e25092e 100644 --- a/debian/shadowsocks-libev.docs +++ b/debian/shadowsocks-libev.docs @@ -2,3 +2,4 @@ AUTHORS README.md debian/copyright.original scripts +doc/*.html diff --git a/debian/shadowsocks-libev.init b/debian/shadowsocks-libev.init index dcd03577..0771a5dc 100644 --- a/debian/shadowsocks-libev.init +++ b/debian/shadowsocks-libev.init @@ -58,7 +58,7 @@ do_start() start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON -- \ - -c "$CONFFILE" -u -f $PIDFILE $DAEMON_ARGS \ + -c "$CONFFILE" -f $PIDFILE $DAEMON_ARGS \ || return 2 } diff --git a/debian/shadowsocks-libev.install b/debian/shadowsocks-libev.install index bee58a6e..24fa1f6d 100644 --- a/debian/shadowsocks-libev.install +++ b/debian/shadowsocks-libev.install @@ -1,5 +1,7 @@ +completions/bash/* usr/share/bash-completion/completions/ +completions/zsh/* usr/share/zsh/vendor-completions/ debian/config.json usr/share/shadowsocks-libev debian/shadowsocks-libev-*.service lib/systemd/system usr/bin/ usr/share/man/ -completions/bash/* usr/share/bash-completion/completions/ +usr/share/doc/shadowsocks-libev/ diff --git a/debian/shadowsocks-libev.lintian-overrides b/debian/shadowsocks-libev.lintian-overrides new file mode 100644 index 00000000..147b2fe2 --- /dev/null +++ b/debian/shadowsocks-libev.lintian-overrides @@ -0,0 +1,5 @@ +# False positive: systemd service templates cannot fallback to sysvinit script +package-supports-alternative-init-but-no-init.d-script lib/systemd/system/shadowsocks-libev-local@.service +package-supports-alternative-init-but-no-init.d-script lib/systemd/system/shadowsocks-libev-redir@.service +package-supports-alternative-init-but-no-init.d-script lib/systemd/system/shadowsocks-libev-server@.service +package-supports-alternative-init-but-no-init.d-script lib/systemd/system/shadowsocks-libev-tunnel@.service diff --git a/debian/shadowsocks-libev.postinst b/debian/shadowsocks-libev.postinst index d6051d3d..b8dfec32 100755 --- a/debian/shadowsocks-libev.postinst +++ b/debian/shadowsocks-libev.postinst @@ -20,19 +20,20 @@ pathfind() { case "$1" in configure|reconfigure) - pathfind setcap && setcap \ - cap_net_bind_service+ep /usr/bin/ss-local \ - cap_net_bind_service,cap_net_admin+ep /usr/bin/ss-redir \ - cap_net_bind_service+ep /usr/bin/ss-server \ - cap_net_bind_service+ep /usr/bin/ss-tunnel + if pathfind setcap; then + if ! setcap \ + cap_net_bind_service+ep /usr/bin/ss-local \ + cap_net_bind_service,cap_net_admin+ep /usr/bin/ss-redir \ + cap_net_bind_service+ep /usr/bin/ss-server \ + cap_net_bind_service+ep /usr/bin/ss-tunnel; then + echo "Failed to set capabilities; ss-* will only be runnable by root." + fi + else + echo "setcap not installed; ss-* will only be runnable by root." + fi if [ ! -f /etc/shadowsocks-libev/config.json ]; then set +e - pathfind apg - if [ $? -eq 0 ]; then - passwd=$(apg -n 1 -M ncl) - else - passwd=$(pwgen 12 1) - fi + passwd=$(perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..12)') set -e mkdir -p /etc/shadowsocks-libev sed "s/barfoo!/$passwd/" /usr/share/shadowsocks-libev/config.json \ diff --git a/debian/shadowsocks-libev.postrm b/debian/shadowsocks-libev.postrm index bccb360a..de10387b 100644 --- a/debian/shadowsocks-libev.postrm +++ b/debian/shadowsocks-libev.postrm @@ -5,8 +5,15 @@ set -e case "$1" in purge) rm -f /etc/shadowsocks-libev/config.json - test -f /etc/shadowsocks-libev/* \ - || rm -r /etc/shadowsocks-libev/ + if test ! -e /etc/shadowsocks-libev ; then + # If the config directory does not exist, do nothing + : + else + if test -d /etc/shadowsocks-libev ; then + # If it is an empty directory, remove it + rmdir /etc/shadowsocks-libev || true + fi + fi ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) exit 0 diff --git a/debian/shadowsocks-libev.service b/debian/shadowsocks-libev.service index ee222fbf..9de87658 100644 --- a/debian/shadowsocks-libev.service +++ b/debian/shadowsocks-libev.service @@ -17,12 +17,10 @@ After=network-online.target Type=simple CapabilityBoundingSet=CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_BIND_SERVICE +DynamicUser=true EnvironmentFile=/etc/default/shadowsocks-libev -User=nobody -Group=nogroup LimitNOFILE=32768 ExecStart=/usr/bin/ss-server -c $CONFFILE $DAEMON_ARGS [Install] WantedBy=multi-user.target - diff --git a/debian/source.lintian-overrides b/debian/source.lintian-overrides deleted file mode 100644 index 6619021e..00000000 --- a/debian/source.lintian-overrides +++ /dev/null @@ -1,2 +0,0 @@ -# false positive: #765166 -shadowsocks-libev source: license-problem-gfdl-invariants diff --git a/debian/tests/control b/debian/tests/control index 8a904082..90d1d407 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,3 +1,3 @@ Test-Command: bash tests/test.sh -Depends: @, python, curl, dnsutils +Depends: @, python3, curl, dnsutils Restrictions: allow-stderr diff --git a/debian/upstream/metadata b/debian/upstream/metadata new file mode 100644 index 00000000..fc1a3b54 --- /dev/null +++ b/debian/upstream/metadata @@ -0,0 +1,6 @@ +Name: shadowsocks-libev +Homepage: https://shadowsocks.org +Repository: https://github.com/shadowsocks/shadowsocks-libev.git +Repository-Browse: https://github.com/shadowsocks/shadowsocks-libev +Bug-Database: https://github.com/shadowsocks/shadowsocks-libev/issues +Contact: Max Lv