3465 Commits
Author SHA1 Message Date
renovate[bot] a1bb24282b chore(deps): update rust crate serde_json to v1.0.154 2026-10-11 20:40:41 +00:00
renovate[bot] d4fdff6d68 chore(deps): update rust crate serde_json to v1.0.152 2026-10-11 01:01:38 +00:00
renovate[bot] f8a5ec2865 chore(deps): update rust crate zstd to v0.14.2 2026-10-10 16:31:47 +00:00
renovate[bot] f97e826a18 chore(deps): update rust crate zstd to v0.14.1 2026-10-09 16:04:25 +00:00
renovate[bot] 85008ca15a chore(deps): update rust crate hyper to v1.12.0 2026-10-07 02:57:33 +00:00
renovate[bot] 27f04129f2 chore(deps): update rust crate tokio to v1.53.2 2026-10-03 12:57:50 +00:00
renovate[bot] 721bb19ca3 chore(deps): update rust crate libc to v0.2.190 2026-10-02 21:22:02 +00:00
renovate[bot] 5cc98e382a chore(deps): update rust crate snmalloc-rs to v0.7.6 2026-10-02 12:50:56 +00:00
renovate[bot] bda0a3037b chore(deps): update rust docker tag to v1.99.0 2026-10-02 02:31:39 +00:00
Qiu Yuzhouandty f23366dc0e feat(local): hot-reload the ACL file at runtime via SIGUSR2 (#2183)
* feat(acl): add AclHandle to swap ACL rules atomically at runtime

AccessControl is immutable after loading, and ServiceContext used to store
it directly, so rules were frozen for the lifetime of the process.

Wrap the active rules in an ArcSwap-based AclHandle. Readers take a cheap
Arc snapshot which stays valid across a swap, enabling hot-reloading
without interrupting the service. reload() re-parses the retained file
path and only swaps the new rules in when parsing succeeds.

* feat(local): hot-reload the global ACL file through ServiceContext

Store the ACL as an AclHandle in ServiceContext. set_acl keeps its
signature and wraps the rules in a handle; cloned contexts share it, so
every listener sees the same swappable rules. acl() now returns an
Arc<AccessControl> snapshot instead of a reference, which cannot be
preserved across an atomic swap.

ServiceContext::reload_acl() re-reads the ACL file, swaps the new rules
in atomically and clears the DNS relay's reverse-lookup cache, which
caches decisions derived from the old rules. On failure the previous
rules stay active.

Server keeps the global context and exposes acl_reload_context() so
embedders can trigger reloads. Contexts with a private ACL keep their
own handle and are not covered by the global reload.

* feat(local): reload the ACL file on SIGUSR2 in sslocal

sslocal already reloads its server list from the config file on SIGUSR1.
Add a second reload trigger on SIGUSR2 for the ACL file, so routing
rules can be updated without restarting the process or interrupting
established connections.

Like the SIGUSR1 reloader, the task is Unix-only and compiles away on
Windows. ssservice's local mode shares this module and inherits it.

Document both signals in the README and cover the reload with an
integration test that verifies new connections are routed by the new
rules after each reload.

* refactor(acl): address review feedback for ACL hot-reload

- Rename `AclHandle` to `AccessControlHandle`, aligning the name with `AccessControl`
- Rename `Server::acl_reload_context` to `Server::context`, so the shared global context can be reused for other runtime operations
- Fold reload logging into `AccessControlHandle::reload`, keeping `ServiceContext::reload_acl` thin
- Record the config file and the ACL file as absolute paths at load time, so both SIGUSR1 and SIGUSR2 reloads keep working after daemonizing (which `chdir`s to `/`); symlinks are deliberately preserved by resolving with cwd instead of canonicalizing

* refactor(local): drop needless pending() in the non-Unix ACL reload task stub

The task may complete immediately: the main loop already tolerates early task exit, mirroring the existing Windows behavior of the SIGUSR1 reload task. This also releases the ServiceContext clone right away instead of holding it forever.

---------

Co-authored-by: ty <[email protected]>
2026-09-29 11:47:28 +08:00
ty a981de7bbf fix(relay): pick non-zero AEAD-2022 padding size for empty first payload
SIP022 requires that in a request header, either initial payload or
padding MUST be present. When the first payload is empty (e.g. handshake
triggered by an empty write for server-first protocols), the client
could pick padding 0 with probability 1/901, generating a header that
servers MUST reject per the spec, causing ~1/901 handshakes to fail
against ssserver built from the same crate.

Pick the padding size from 1..=AEAD2022_MAX_PADDING_SIZE instead.

fix #2184
2026-09-29 10:27:31 +08:00
Klaaktu e33daa7114 systemd unit improvements (#2187)
* systemd: Use network-online.target for server

Fixes #2186
ss-server needs to wait for the network to be up to be able to bind to non-wildcard IPs. Interface is configured at `network-online.target` but not at `network.target`.

ss-local unit is kept the same, with `After=network.target` for proper ordering at shutdown - unit is stopped before network is shutdown.

* systemd unit: improvements

`exec` is [recommended](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Type=).
Add `NoNewPriviledges` which has been used in [Arch packaging](https://gitlab.archlinux.org/archlinux/packaging/packages/shadowsocks-rust/-/blob/main/shadowsocks-rust-server%40.service?ref_type=heads).
Add `CAP_NET_ADMIN` in ss-local which is needed for TUN mode.
Removed `CAP_NET_BIND_SERVICE` from ss-local. Do you really need to bind to priviledged port in *client*?
Debian unit left un-hardened. I'm not sure why it's different from the other ss-server unit.
2026-09-29 10:03:02 +08:00
renovate[bot] 2872330701 chore(deps): update rust crate tokio-rustls to v0.26.6 2026-09-28 12:00:24 +00:00
renovate[bot] 0ff649e9a6 chore(deps): update rust crate sendfd to v0.4.5 2026-09-27 02:22:01 +00:00
renovate[bot] a58349df7e chore(deps): update rust crate rand to v0.10.3 2026-09-26 01:17:11 +08:00
renovate[bot] 89aef72e06 chore(deps): update rust crate clap to v4.6.7 2026-09-26 01:17:03 +08:00
renovate[bot] 795ed227c8 chore(deps): update rust crate bloomfilter to v3.0.2 2026-09-26 01:16:31 +08:00
renovate[bot] 14976b3d72 chore(deps): update rust crate thiserror to v2.0.21 2026-09-26 01:16:20 +08:00
renovate[bot] b770135bc1 chore(deps): update rust crate cfg-if to v1.0.5 2026-09-26 01:16:00 +08:00
ty 59d5be04e6 fix: RUSTSEC-2026-0285 2026-09-25 22:55:10 +08:00
ty e01605cdff fix(tcprelay): report actual plaintext length when retrying after Pending
EncryptedWriter.poll_write_encrypted keeps the encrypted buffer and its
on-wire offset across Poll::Pending, but returned the length of the
buffer passed on the *retried* call instead of the plaintext length that
was actually assembled into the pending frame.

Tokio's copy/copy_bidirectional may append freshly read data to the
input slice while the writer is Pending, so the reported count could
exceed what was actually encrypted and sent, silently dropping the
appended bytes.

Fixes #2175
2026-09-25 11:36:14 +08:00
ty 5199ae33e3 fix: updated chacha20 to v0.10.2, v0.10.1 yanked 2026-09-25 11:24:06 +08:00
ty 7dee109d70 fix(local-tun): enable smoltcp "auto-icmp-echo-reply" feature to reply ICMP Echo Request
smoltcp 0.13 (PR smoltcp-rs/smoltcp#1106) made automatic ICMP echo
replies opt-in via the "auto-icmp-echo-reply" feature flag. It is only
part of smoltcp's default features, which this crate disables with
default-features = false. Since the smoltcp 0.13 upgrade, the Tun local
silently drops ICMP Echo Requests and no longer responds to ping.

Fixes #2178
2026-09-25 11:22:04 +08:00
renovate[bot] 157cefa96d chore(deps): update rust crate hickory-resolver to v0.26.3 (#2173)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-09-11 01:13:55 +00:00
renovate[bot] 11378ea598 chore(deps): update rust docker tag to v1.98.1 2026-09-09 21:55:56 +00:00
renovate[bot] 8eb0f0a65b chore(deps): update rust crate reqwest to v0.13.5 2026-09-09 02:26:26 +00:00
renovate[bot] b027152651 chore(deps): update rust crate ipnet to v2.12.2 2026-09-06 09:14:15 +00:00
renovate[bot] 1e4ed226e1 fix(deps): update rust crate zstd to 0.14 2026-09-04 22:06:22 +00:00
renovate[bot] 561f23cde8 chore(deps): update rust crate tokio-rustls to v0.26.5 2026-09-04 10:49:06 +00:00
renovate[bot] e66fcff6ec fix(deps): update rust crate brotli to v9 2026-09-03 13:42:02 +08:00
renovate[bot] 692160c1f4 chore(deps): update rust crate aes to v0.9.3 2026-08-28 19:29:39 +00:00
renovate[bot] 616fac6d3a chore(deps): update rust crate hyper to v1.11.1 2026-08-28 14:12:38 +00:00
renovate[bot] 5f2cbad931 chore(deps): update rust crate flate2 to v1.1.10 2026-08-28 07:05:23 +00:00
ty 2de264a374 fix: eliminate warnings under default features
- Replace catch-all arm in OutboundProxyStream::try_into_tcp with
  explicit cfg-gated variant arms, fixing unreachable_patterns warning
  when local-http features are disabled
- Gate utils module behind local/server features, fixing dead_code
  warning for ServerHandle when neither module is compiled
2026-08-27 02:40:36 +08:00
ty ab388c7466 chore: release v1.25.0 v1.25.0 2026-08-27 02:30:21 +08:00
ty 8166f32d1a chore: update indirect dependencies 2026-08-27 02:28:00 +08:00
renovate[bot] f5e2749da1 chore(deps): update rust docker tag to v1.98.0 2026-08-27 02:27:32 +08:00
renovate[bot] 7fa251fecd chore(deps): update rust crate spin to v0.12.3 2026-08-27 02:27:23 +08:00
renovate[bot] 5cfcbc89ea chore(deps): update rust crate log to v0.4.34 2026-08-27 02:27:15 +08:00
renovate[bot] a412166e84 chore(deps): update rust crate blake3 to v1.8.7 2026-08-27 02:27:09 +08:00
ty b8cce0d519 Bump shadowsocks-crypto to 0.8.0 2026-08-27 02:20:13 +08:00
ty 65f6a8e166 refactor: split inbound_udp_allow_fragmentation from outbound option
Add a dedicated  config option for
inbound (listener) UDP sockets, instead of reusing the outbound option.

- SSConfig / SSServerExtConfig: new
  JSON field (global + per-server)
- Config / ServerInstanceConfig: new field, defaults to false
- server/manager/local: accept_opts.udp.allow_fragmentation now sourced
  from the inbound option; per-server override split into inbound/outbound
- README: document the new option in both JSON examples
- tests/udp.rs: fix unused import of AcceptOpts on non-Linux platforms
2026-08-27 02:07:27 +08:00
peng weikang 668ff171f4 fix: allow fragmentation for inbound UDP replies 2026-08-27 02:07:27 +08:00
ty a99c9dddad fix: RUSTSEC-2026-0258 2026-08-27 01:03:08 +08:00
renovate[bot] 76a4317a73 fix(deps): update rust crate smoltcp to 0.14 2026-08-17 02:53:17 +00:00
renovate[bot] 89bbabda85 fix(deps): update rust crate rocksdb to 0.25 2026-08-16 12:46:54 +00:00
renovate[bot] 9214fdaf1f chore(deps): update rust crate snmalloc-rs to v0.7.5 2026-08-13 00:59:53 +00:00
renovate[bot] 2b823ab254 chore(deps): update rust crate http-body-util to v0.1.5 2026-08-12 19:40:32 +00:00
renovate[bot] b35f610845 chore(deps): update rust crate futures to v0.3.34 2026-08-11 22:47:08 +00:00
renovate[bot] e543d9bc8c chore(deps): update rust crate clap to v4.6.6 (#2163)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-08 16:36:20 +00:00