Skip to content

feat(shadowsocks): Shadowsocks-2022 support via the rust server edition#63

Merged
alexzhangs merged 1 commit into
developfrom
feat/ss-2022-rust
Jun 14, 2026
Merged

feat(shadowsocks): Shadowsocks-2022 support via the rust server edition#63
alexzhangs merged 1 commit into
developfrom
feat/ss-2022-rust

Conversation

@alexzhangs

Copy link
Copy Markdown
Owner

Summary

Adds Shadowsocks-2022 (SIP022 AEAD-2022) support (e.g. 2022-blake3-aes-256-gcm), which shadowsocks-libev does not implement.

shadowsocks-rust's ssmanager speaks the same UDP multi-user Manager API as libev's ss-manager, so SS-2022 is a drop-in server-edition swap at the node plus small portal changes — no rewrite of the Django↔node control plane.

Changes

  • ServerEditionList.RUST server edition.
  • New shadowsocks/ciphers.py: SS-2022 cipher key sizes, PSK generation (Base64 key == ssservice genkey) and validation.
  • SSManager: list SS-2022 ciphers in help text; enable the list Manager-API command for rust; clean() requires the rust edition for SS-2022 ciphers.
  • is_port_created: compare server_port as strings — libev returns a string, rust returns an integer (found via e2e).
  • Account.clean(): require a valid Base64 PSK for accounts on SS-2022 nodes (clear error vs. silent server reject).
  • AccountAdmin: "Generate Shadowsocks-2022 password (PSK)" action.
  • Tests: CiphersTestCase (unit) + SSManagerRust2022TestCase (e2e against the new alexzhangs/shadowsocks-rust image); tox.ini launches the rust container.
  • README: rust edition / SS-2022 setup + SSEdition deploy param.

Testing

  • CiphersTestCase + SSManagerRust2022TestCase + SSManagerTestCase (libev regression) all green against real libev + rust ssmanager containers + memcached.
  • Image-level data path verified: sslocal → ss-2022 server → origin.

Pairs with alexzhangs/shadowsocks-rust and aws-cfn-vpn SSEdition=rust.

🤖 Generated with Claude Code

…dition

shadowsocks-libev does not implement the SS-2022 (SIP022 AEAD-2022) ciphers.
shadowsocks-rust's ssmanager speaks the same UDP multi-user Manager API and does,
so SS-2022 is a drop-in server-edition swap at the node plus small portal changes.

- ServerEditionList: add RUST edition.
- ciphers.py: single source of truth for SS-2022 cipher key sizes, PSK generation
  (Base64 key of the cipher's key size, == `ssservice genkey`), and PSK validation.
- SSManager: list SS-2022 ciphers in encrypt help_text; enable the `list` Manager-API
  command for the rust edition; clean() requires the rust edition for SS-2022 ciphers.
- is_port_created: compare server_port as strings -- libev returns it as a string,
  rust returns it as an integer (found via e2e against the rust ssmanager).
- Account.clean(): for accounts assigned to a SS-2022 node, require a valid Base64 PSK
  of the right key size (clear error instead of a silent server reject).
- AccountAdmin: "Generate Shadowsocks-2022 password (PSK)" action.
- tests: CiphersTestCase (unit) + SSManagerRust2022TestCase (e2e against the
  alexzhangs/shadowsocks-rust image, gated on SSM_TEST_SS_MGR_RUST=1).
- tox.ini: launch the rust ssmanager container for the test matrix.
- README: document the rust edition / SS-2022 setup and the SSEdition deploy param.

Pairs with the new alexzhangs/shadowsocks-rust image and the aws-cfn-vpn SSEdition
deployment path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.61017% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.73%. Comparing base (aa18fc5) to head (ffa83eb).

Files with missing lines Patch % Lines
shadowsocks_manager/shadowsocks/models.py 72.72% 0 Missing and 3 partials ⚠️
shadowsocks_manager/shadowsocks/tests.py 98.79% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #63      +/-   ##
===========================================
+ Coverage    93.51%   93.73%   +0.21%     
===========================================
  Files           53       54       +1     
  Lines         2854     2969     +115     
  Branches       239      247       +8     
===========================================
+ Hits          2669     2783     +114     
  Misses         115      115              
- Partials        70       71       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexzhangs
alexzhangs merged commit 0d15d50 into develop Jun 14, 2026
9 checks passed
@alexzhangs
alexzhangs deleted the feat/ss-2022-rust branch June 14, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant