windows: the service, its API and proxy-ctl

ps-ipc: line-delimited JSON over a named pipe whose ACL admits SYSTEM,
Administrators and (with userControl) the interactive user; the caller
is identified by impersonation, never by what it claims. A Unix socket
stands in off Windows.

ps-service (proxy-suite-service.exe): a Windows service, or --console.
Keeps the configuration with revisions, runtime state and generated
secrets; renders, checks with sing-box check before replacing what
runs, and supervises the backends (restart with backoff, start limit,
logs in a ring and a file, a Job Object on Windows). Enforces scopes,
admin-only edits and secret redaction that round-trips. Fetches
subscriptions and rule sets through the proxy or directly with
upstream's redirect rules, on timers.

ps-ctl (proxy-ctl.exe): status, restart, logs [-f], config get/set/
validate, and proxy on/off, outbounds, pin, mode, subs, rules,
rulesets, tun and config.

An end-to-end test runs it all offline: a sing-box Shadowsocks server,
the service, proxy-ctl adding the outbound, a page fetched through the
local proxy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Opus 5.5 committed 2026-10-26 23:13:19 +03:00
1 parent 918cdc9a75
commit 41c8ed4406
25 files changed
+5411 -7

No files matched your search

+14 -1
View File
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["crates/ps-core"]
members = ["crates/ps-core", "crates/ps-ipc", "crates/ps-service", "crates/ps-ctl"]
[workspace.package]
version = "0.1.0"
@@ -18,3 +18,16 @@ thiserror = "2"
percent-encoding = "2"
ipnet = "2"
indexmap = { version = "2", features = ["serde"] }
tokio = { version = "1.54", features = ["rt-multi-thread", "macros", "net", "io-util", "process", "time", "sync", "fs", "signal"] }
clap = { version = "4.6", features = ["derive"] }
reqwest = { version = "0.13", default-features = false, features = ["rustls-no-provider", "socks", "json", "stream", "http2", "query"] }
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] }
windows-service = "0.8"
windows-sys = "0.61"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
rand = "0.9"
sha2 = "0.10"
zip = { version = "2", default-features = false, features = ["deflate"] }
ps-core = { path = "crates/ps-core" }
ps-ipc = { path = "crates/ps-ipc" }