230 Commits
Author SHA1 Message Date
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 <zonyitoo@gmail.com>
2026-09-29 11:47:28 +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
Andy Ye aa4946260b Document redir iptables setup 2026-05-11 19:31:55 +08:00
Fan Yang 743d0b3931 [Feature]: Allow to chain ssserver to another socks5/http/https proxy #1397 (#2106)
* Add outbound SOCKS5 proxy chains with auth

* Add HTTP and HTTPS CONNECT support to outbound proxy chains

* Initialize outbound proxy chains in manager server configs

* Fix outbound proxy chain handling and share HTTPS transport

* docs: update README for outbound proxy chains
2026-04-11 22:10:08 +08:00
Aaron Chen 46c96ac1fb chore: fix typos 2026-02-09 15:53:16 +08:00
zonyitoo 1008eeec1d feat(local-http): support HTTP Basic auth (#1994) 2025-12-19 03:26:17 +08:00
zonyitoo 3f04e25071 chore: fixed README nixpkg link 2025-12-19 02:27:34 +08:00
zonyitoo 1db36a1c73 feat(shadowsocks-rust): logging support syslog (#2044) 2025-11-17 01:30:11 +08:00
zonyitoo 2e7de28a4d chore: stdout renamed to console 2025-08-31 01:37:27 +08:00
shadowsocks69420 4a105e9b0a feat: support file logging with tracing (#1993) 2025-08-29 01:10:00 +08:00
ty e1bd1e8e08 chore: README fixes mode, adds outbound_allow_* 2025-06-12 10:17:25 +08:00
zonyitoo c9f47c6db3 chore: release v1.23.3 2025-05-11 21:17:55 +08:00
zonyitoo e3615092b5 feat: server instance support outbound_user_cookie 2025-05-06 22:42:29 +08:00
zonyitoo 8407c5138a feat: CentOS based image config (#1941) 2025-05-06 12:46:29 +08:00
zonyitoo 794b4f0af1 feat(shadowsocks-service): README doc for allowed_plugins (#1943) 2025-04-29 23:47:08 +08:00
ty 182e4c38d6 fix: README missing comma 2025-04-25 18:22:06 +08:00
ty 31a92a0524 chore: static-linked build information ref 2025-04-25 18:05:37 +08:00
zonyitoo 12a9ac6ba3 chore: README snap configuration path 2025-03-26 23:23:17 +08:00
Tom Ryan 25485e52e5 Allow IP fragmentation for outbound UDP sockets (#1790) 2024-12-01 10:23:35 +08:00
Kursat Aktas 36934910b4 Introducing shadowsocks Guru on Gurubase.io (#1755)
Signed-off-by: Kursat Aktas <kursat.ce@gmail.com>
2024-11-06 10:11:30 +08:00
zonyitoo edac97d1fe chore: add macports badge (#1607) 2024-08-10 11:09:13 +08:00
ty 8271ff8894 chore: README includes fake-dns, online-config 2024-06-21 09:40:14 +08:00
zonyitoo ac67a08f87 chore: removed archlinuxcn status badge 2024-06-15 11:15:23 +08:00
zonyitoo 410dc0ac36 chore: fake-dns configuration helper in README 2024-05-26 10:35:40 +08:00
zonyitoo bb337834e3 feat(local): Support SIP008 online configuration
- https://shadowsocks.org/doc/sip008.html
- fix #302
- ref #1287
2024-05-12 18:02:30 +08:00
nailyk 58ce93ccf3 README.md: Configuration: Add path for snapd 2024-03-11 11:09:16 +08:00
nailyk c1b054f40d README.md: Configuration: Add notice about obsolete link 2024-03-11 11:09:16 +08:00
ty 1aad70e748 chore: Build Releases badge only shows push events 2024-02-19 16:51:19 +08:00
zonyitoo 507c93a629 chore: add homebrew version badge 2024-02-06 05:45:04 +08:00
zonyitoo 8cce21a15e chore: updated snapcraft badge 2024-02-06 05:25:01 +08:00
zonyitoo b496c0fd11 chore: add archlinux package badge 2024-02-06 04:43:38 +08:00
zonyitoo ac459c753b chore: aur package *-git, *-bin 2024-02-03 23:25:31 +08:00
zonyitoo 19270e897c chore: README add badge for MSRV test 2024-02-03 20:42:42 +08:00
zonyitoo 8c23cdc307 chore(README): fixed wrong windows interface 2023-10-23 01:04:26 +08:00
ty 10cfca302c feat(local): basic support of macOS launchd activate socket (#1330)
supersede #1331
2023-10-23 00:38:43 +08:00
zonyitoo 63f33aeb86 feat(local): local-tun Windows README 2023-10-18 23:00:38 +08:00
zonyitoo ea527fd141 trust-dns renamed to hickory-dns 2023-10-18 00:51:55 +08:00
Hanwei Jin b25e9e36af bugfix: fix missed client_cache_size config item in SSLocalExtConfig (#1319) 2023-10-08 23:52:13 +08:00
zonyitoo a57e7fb209 fix(sswinservice): fixed build command in README (#1316) 2023-10-03 08:41:41 +08:00
zonyitoo 1c0e2c7a72 chore(homebrew): v1.16.2 new release 2023-09-23 15:35:00 +08:00
zonyitoo 09c6b23f34 feat(local): local-dns client_cache_size set default when creating server instance 2023-09-23 15:25:47 +08:00
zonyitoo 6d9678a06c README for introducing sswinservice 2023-09-23 14:25:10 +08:00
spyophobiaandzonyitoo c872714d1a [Regression fix] local DNS uses mode tcp_and_udp by default (#1285)
Co-authored-by: zonyitoo <zonyitoo@gmail.com>
2023-08-31 22:40:57 +08:00
Dmitry Afanasiev 817a98b81a add HowTo install via snap 2023-07-31 23:36:15 +08:00
Shriraj Hegde 1ff64566c0 Add IPv6 warning for docker
Mention IPv6 problem with docker and link to IPv6 documentation for docker.
2023-07-09 23:13:07 +08:00
Tim Xylon fb2192bb8d Introduce dns-cache-size option in README 2023-06-27 13:22:55 +08:00
NimaQu 0c4f9da320 Update README.md
fix wrong args
2023-05-24 22:52:18 +08:00
zonyitoo bf5d9a909a AEAD-2022 Ciphers keygen recommend
fix #1179
2023-05-05 23:41:45 +08:00
zonyitoo 612d128022 README extended server config use "server" key 2023-05-05 00:45:17 +08:00
zonyitoo 2a8d70063d document about ssservice genkey
ref #1179
2023-05-02 22:49:51 +08:00