Remove unused NetworkType::Trojan tombstone

The Trojan network type only ever existed as a non-runnable tombstone:
the SOCKS-era Trojan runtime it guarded against (BEP-0009) was never
merged to main, and no stored network uses it. Drop the enum value and
its dead match arms across the daemon, GTK summary, and Apple bindings.

The Trojan *protocol* outbound used by proxy-subscription nodes
(TrojanOutbound / ProxyOutbound::Trojan / isTrojanTCP) is unaffected.

- proto: remove `Trojan = 2`, add `reserved 2; reserved "Trojan";`
- daemon: drop ResolvedTunnel/ActiveTunnel::Trojan variants + match arms
  (runtime.rs) and the validate_network_payload arm (database.rs)
- gtk: drop the "Legacy Trojan Proxy" summary arm
- apple: drop the makeCard .trojan arm and regenerate the Swift
  NetworkType enum (case/rawValue/init/allCases/nameMap)

An unknown stored type now surfaces via the existing UNRECOGNIZED path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
JettChenT 2026-06-05 17:06:01 -07:00
parent 4d1f589280
commit 6c6bfe5434
6 changed files with 2 additions and 40 deletions

View file

@ -25,7 +25,6 @@ public enum Burrow_NetworkType: SwiftProtobuf.Enum, Swift.CaseIterable {
public typealias RawValue = Int public typealias RawValue = Int
case wireGuard // = 0 case wireGuard // = 0
case tailnet // = 1 case tailnet // = 1
case trojan // = 2
case proxySubscription // = 3 case proxySubscription // = 3
case UNRECOGNIZED(Int) case UNRECOGNIZED(Int)
@ -37,7 +36,6 @@ public enum Burrow_NetworkType: SwiftProtobuf.Enum, Swift.CaseIterable {
switch rawValue { switch rawValue {
case 0: self = .wireGuard case 0: self = .wireGuard
case 1: self = .tailnet case 1: self = .tailnet
case 2: self = .trojan
case 3: self = .proxySubscription case 3: self = .proxySubscription
default: self = .UNRECOGNIZED(rawValue) default: self = .UNRECOGNIZED(rawValue)
} }
@ -47,7 +45,6 @@ public enum Burrow_NetworkType: SwiftProtobuf.Enum, Swift.CaseIterable {
switch self { switch self {
case .wireGuard: return 0 case .wireGuard: return 0
case .tailnet: return 1 case .tailnet: return 1
case .trojan: return 2
case .proxySubscription: return 3 case .proxySubscription: return 3
case .UNRECOGNIZED(let i): return i case .UNRECOGNIZED(let i): return i
} }
@ -57,7 +54,6 @@ public enum Burrow_NetworkType: SwiftProtobuf.Enum, Swift.CaseIterable {
public static let allCases: [Burrow_NetworkType] = [ public static let allCases: [Burrow_NetworkType] = [
.wireGuard, .wireGuard,
.tailnet, .tailnet,
.trojan,
.proxySubscription, .proxySubscription,
] ]
@ -246,7 +242,6 @@ extension Burrow_NetworkType: SwiftProtobuf._ProtoNameProviding {
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
0: .same(proto: "WireGuard"), 0: .same(proto: "WireGuard"),
1: .same(proto: "Tailnet"), 1: .same(proto: "Tailnet"),
2: .same(proto: "Trojan"),
3: .same(proto: "ProxySubscription"), 3: .same(proto: "ProxySubscription"),
] ]
} }

View file

@ -867,12 +867,6 @@ final class NetworkViewModel: Sendable {
WireGuardCard(network: network).card WireGuardCard(network: network).card
case .tailnet: case .tailnet:
TailnetCard(network: network).card TailnetCard(network: network).card
case .trojan:
unsupportedCard(
id: network.id,
title: "Legacy Trojan Proxy",
detail: "Unsupported SOCKS-era profile. Import a proxy subscription instead."
)
case .proxySubscription: case .proxySubscription:
proxySubscriptionCard(network: network) proxySubscriptionCard(network: network)
case .UNRECOGNIZED(let rawValue): case .UNRECOGNIZED(let rawValue):

View file

@ -408,11 +408,6 @@ fn summarize_network(network: &Network) -> NetworkSummary {
match network.r#type() { match network.r#type() {
NetworkType::WireGuard => summarize_wireguard(network), NetworkType::WireGuard => summarize_wireguard(network),
NetworkType::Tailnet => summarize_tailnet(network), NetworkType::Tailnet => summarize_tailnet(network),
NetworkType::Trojan => NetworkSummary {
id: network.id,
title: "Legacy Trojan Proxy".to_owned(),
detail: "Unsupported SOCKS-era profile. Import a proxy subscription instead.".to_owned(),
},
NetworkType::ProxySubscription => summarize_proxy_subscription(network), NetworkType::ProxySubscription => summarize_proxy_subscription(network),
} }
} }

View file

@ -48,9 +48,6 @@ pub enum ResolvedTunnel {
identity: RuntimeIdentity, identity: RuntimeIdentity,
config: Config, config: Config,
}, },
Trojan {
identity: RuntimeIdentity,
},
ProxySubscription { ProxySubscription {
identity: RuntimeIdentity, identity: RuntimeIdentity,
payload: ProxySubscriptionPayload, payload: ProxySubscriptionPayload,
@ -82,7 +79,6 @@ impl ResolvedTunnel {
let config = Config::from_content_fmt(&payload, "ini")?; let config = Config::from_content_fmt(&payload, "ini")?;
Ok(Self::WireGuard { identity, config }) Ok(Self::WireGuard { identity, config })
} }
NetworkType::Trojan => Ok(Self::Trojan { identity }),
NetworkType::ProxySubscription => { NetworkType::ProxySubscription => {
let payload: ProxySubscriptionPayload = serde_json::from_slice(&network.payload) let payload: ProxySubscriptionPayload = serde_json::from_slice(&network.payload)
.context("proxy subscription payload must be valid JSON")?; .context("proxy subscription payload must be valid JSON")?;
@ -97,7 +93,6 @@ impl ResolvedTunnel {
Self::Passthrough { identity } Self::Passthrough { identity }
| Self::Tailnet { identity, .. } | Self::Tailnet { identity, .. }
| Self::WireGuard { identity, .. } | Self::WireGuard { identity, .. }
| Self::Trojan { identity, .. }
| Self::ProxySubscription { identity, .. } => identity, | Self::ProxySubscription { identity, .. } => identity,
} }
} }
@ -125,9 +120,6 @@ impl ResolvedTunnel {
mtu: Some(1280), mtu: Some(1280),
}), }),
Self::WireGuard { config, .. } => ServerConfig::try_from(config), Self::WireGuard { config, .. } => ServerConfig::try_from(config),
Self::Trojan { .. } => Err(anyhow::anyhow!(
"legacy Trojan SOCKS proxy networks are no longer supported; import a proxy subscription instead"
)),
Self::ProxySubscription { payload, .. } => proxy_subscription_server_config(payload), Self::ProxySubscription { payload, .. } => proxy_subscription_server_config(payload),
} }
} }
@ -206,9 +198,6 @@ impl ResolvedTunnel {
} }
} }
} }
Self::Trojan { .. } => Err(anyhow::anyhow!(
"legacy Trojan SOCKS proxy networks are no longer supported; import a proxy subscription instead"
)),
Self::ProxySubscription { identity, payload } => { Self::ProxySubscription { identity, payload } => {
let runtime_config = proxy_runtime::proxy_runtime_config(&payload)?; let runtime_config = proxy_runtime::proxy_runtime_config(&payload)?;
let server_config = proxy_subscription_server_config_for_selected( let server_config = proxy_subscription_server_config_for_selected(
@ -283,10 +272,6 @@ pub enum ActiveTunnel {
interface: Arc<RwLock<WireGuardInterface>>, interface: Arc<RwLock<WireGuardInterface>>,
task: JoinHandle<Result<()>>, task: JoinHandle<Result<()>>,
}, },
Trojan {
identity: RuntimeIdentity,
server_config: ServerConfig,
},
ProxySubscription { ProxySubscription {
identity: RuntimeIdentity, identity: RuntimeIdentity,
server_config: ServerConfig, server_config: ServerConfig,
@ -301,7 +286,6 @@ impl ActiveTunnel {
Self::Passthrough { identity, .. } Self::Passthrough { identity, .. }
| Self::Tailnet { identity, .. } | Self::Tailnet { identity, .. }
| Self::WireGuard { identity, .. } | Self::WireGuard { identity, .. }
| Self::Trojan { identity, .. }
| Self::ProxySubscription { identity, .. } => identity, | Self::ProxySubscription { identity, .. } => identity,
} }
} }
@ -311,7 +295,6 @@ impl ActiveTunnel {
Self::Passthrough { server_config, .. } Self::Passthrough { server_config, .. }
| Self::Tailnet { server_config, .. } | Self::Tailnet { server_config, .. }
| Self::WireGuard { server_config, .. } | Self::WireGuard { server_config, .. }
| Self::Trojan { server_config, .. }
| Self::ProxySubscription { server_config, .. } => server_config, | Self::ProxySubscription { server_config, .. } => server_config,
} }
} }
@ -398,7 +381,6 @@ impl ActiveTunnel {
task_result??; task_result??;
Ok(()) Ok(())
} }
Self::Trojan { .. } => Ok(()),
Self::ProxySubscription { packet_bridge, tun_task, .. } => { Self::ProxySubscription { packet_bridge, tun_task, .. } => {
if let Some(tun_task) = tun_task { if let Some(tun_task) = tun_task {
tun_task.abort(); tun_task.abort();

View file

@ -283,11 +283,6 @@ fn validate_network_payload(network: &RPCNetwork) -> Result<()> {
NetworkType::Tailnet => { NetworkType::Tailnet => {
TailnetConfig::from_slice(&network.payload)?; TailnetConfig::from_slice(&network.payload)?;
} }
NetworkType::Trojan => {
return Err(anyhow::anyhow!(
"legacy Trojan SOCKS proxy networks are no longer supported; import a proxy subscription instead"
));
}
NetworkType::ProxySubscription => { NetworkType::ProxySubscription => {
let payload: ProxySubscriptionPayload = serde_json::from_slice(&network.payload)?; let payload: ProxySubscriptionPayload = serde_json::from_slice(&network.payload)?;
crate::proxy_subscription::validate_payload(&payload)?; crate::proxy_subscription::validate_payload(&payload)?;

View file

@ -61,7 +61,8 @@ message Network {
enum NetworkType { enum NetworkType {
WireGuard = 0; WireGuard = 0;
Tailnet = 1; Tailnet = 1;
Trojan = 2; reserved 2;
reserved "Trojan";
ProxySubscription = 3; ProxySubscription = 3;
} }