[stealth radiance] Add noVPN SOCKS backend#486
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a stealth_novpn build path that runs sing-box as a SOCKS/mixed proxy instead of a libbox-based VPN tunnel, while preserving the existing VPN code path for default builds. The split is implemented via build tags across vpn/, servers/, config/, backend/, account/, and a new internal/boxctx helper. The PR also renames the Server.IsLantern field to Server.Managed and adds legacy-JSON compatibility in the default build.
Changes:
- Introduce
//go:build stealth_novpnand//go:build !stealth_novpnsiblings to gate libbox/VPN/TUN/WireGuard/OAuth/URL-provider code out of stealth builds, including a newNewVPNClient/proxySessionthat drives sing-box directly. - Rename
Server.IsLantern→Server.Managed(JSONmanaged), extract per-build helpersapplyLegacyManagedFlag/isManagedServerGroup, and moveAddServersByURLand WireGuard key handling behind tagged files. - Centralize sing-box context creation in
internal/boxctx, with a stripped registry for stealth_novpn that registers only the protocols the build supports and stubs WireGuard/Tailscale/Amnezia endpoints.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vpn/vpn.go | Adds !stealth_novpn build tag to the existing VPN client. |
| vpn/vpn_stealth_novpn.go | New SOCKS/mixed proxy client and proxySession for stealth_novpn. |
| vpn/tunnel.go | Build-tags the libbox tunnel; renames lanternTags → managedTags and delegates platform setup. |
| vpn/libbox_setup_default.go | Extracts Android FixAndroidStack setup behind a helper. |
| vpn/inbounds_default.go / vpn/inbounds_stealth_novpn.go | Split inbound construction (tun+mixed vs mixed-only) and platform tunnel tweaks. |
| vpn/build_options_default.go / vpn/build_options_stealth_novpn.go | No-op vs filter that drops WireGuard/Amnezia outbounds in stealth_novpn. |
| vpn/boxoptions.go | Delegates inbound/platform-tunnel setup to helpers and uses boxctx.BaseContext. |
| servers/manager.go | Renames IsLantern → Managed, removes URL provider import, switches to boxctx. |
| servers/manager_test.go | Updates expectations to Managed and skips URL test in stealth_novpn. |
| servers/providers_.go, servers/stealth_flag__test.go | Build-tagged provider registration and test flag. |
| servers/managed_legacy_*.go | Legacy isLantern JSON migration (default-only) and lantern/managed group mapping. |
| servers/add_servers_by_url_*.go | Splits AddServersByURL into a real implementation (default) and a stubbed error (stealth_novpn). |
| ipc/outbound_test.go | Updates fixture to Managed. |
| internal/boxctx/base_default.go / base_stealth_novpn.go | New BaseContext helper; stealth_novpn registers a reduced set of inbounds/outbounds/endpoints. |
| config/wg_default.go / wg_stealth_novpn.go | Splits WireGuard key load/generate behind build tags. |
| config/protocols_default.go / protocols_stealth_novpn.go | Supplies build-specific supported protocol list. |
| config/fetcher.go | Calls supportedProtocols() instead of using lantern-box/protocol directly. |
| config/config.go | Replaces inline WG key logic with loadProxyConfigKey/setEndpointKeys, switches to boxctx. |
| backend/radiance.go | Renames isLantern parameters/fields, error wording change, removes OAuth methods (moved). |
| backend/oauth.go | Re-adds OAuth methods only in non-stealth builds. |
| account/user.go / account/oauth.go | Moves OAuth login URL/callback into a build-tagged file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9fb8b10 to
7a41164
Compare
|
@copilot review |
Reviewed the full PR. All three previously flagged issues are addressed in 7a41164. Here's what I found beyond that: Bug:
Two minor comment additions
Both builds ( |
7a41164 to
90b0028
Compare
|
@copilot review |
|
@copilot review |
90b0028 to
ea610ec
Compare
Completed another review pass and fixed the remaining trace-marker inconsistency in |
|
@copilot review |
3ae9711 to
c4e5d2c
Compare
|
@copilot review |
Reviewed on Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Reviewed the current PR head ( Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
3ae9711 to
c4e5d2c
Compare
|
@copilot review Please review only. Do not add stealth_novpn OAuth stub methods: keeping those method names out of the noVPN binary is intentional, and the build-tag split in the IPC auth provider route/client removes that API surface for stealth_novpn builds. |
Reviewed only on Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot review Please review only. The split-tunnel noVPN comment was addressed by removing split-tunnel setup and rule references from the stealth_novpn SOCKS path. Do not add OAuth stubs; keeping those names out of stealth_novpn remains intentional. |
|
@copilot review Please review only. Current head removes the noVPN split-tunnel side effect and keeps OAuth names out of stealth_novpn. |
Reviewed on Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Reviewed on Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
Verification