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:
parent
4d1f589280
commit
6c6bfe5434
6 changed files with 2 additions and 40 deletions
|
|
@ -25,7 +25,6 @@ public enum Burrow_NetworkType: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|||
public typealias RawValue = Int
|
||||
case wireGuard // = 0
|
||||
case tailnet // = 1
|
||||
case trojan // = 2
|
||||
case proxySubscription // = 3
|
||||
case UNRECOGNIZED(Int)
|
||||
|
||||
|
|
@ -37,7 +36,6 @@ public enum Burrow_NetworkType: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|||
switch rawValue {
|
||||
case 0: self = .wireGuard
|
||||
case 1: self = .tailnet
|
||||
case 2: self = .trojan
|
||||
case 3: self = .proxySubscription
|
||||
default: self = .UNRECOGNIZED(rawValue)
|
||||
}
|
||||
|
|
@ -47,7 +45,6 @@ public enum Burrow_NetworkType: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|||
switch self {
|
||||
case .wireGuard: return 0
|
||||
case .tailnet: return 1
|
||||
case .trojan: return 2
|
||||
case .proxySubscription: return 3
|
||||
case .UNRECOGNIZED(let i): return i
|
||||
}
|
||||
|
|
@ -57,7 +54,6 @@ public enum Burrow_NetworkType: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|||
public static let allCases: [Burrow_NetworkType] = [
|
||||
.wireGuard,
|
||||
.tailnet,
|
||||
.trojan,
|
||||
.proxySubscription,
|
||||
]
|
||||
|
||||
|
|
@ -246,7 +242,6 @@ extension Burrow_NetworkType: SwiftProtobuf._ProtoNameProviding {
|
|||
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
0: .same(proto: "WireGuard"),
|
||||
1: .same(proto: "Tailnet"),
|
||||
2: .same(proto: "Trojan"),
|
||||
3: .same(proto: "ProxySubscription"),
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -867,12 +867,6 @@ final class NetworkViewModel: Sendable {
|
|||
WireGuardCard(network: network).card
|
||||
case .tailnet:
|
||||
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:
|
||||
proxySubscriptionCard(network: network)
|
||||
case .UNRECOGNIZED(let rawValue):
|
||||
|
|
|
|||
|
|
@ -408,11 +408,6 @@ fn summarize_network(network: &Network) -> NetworkSummary {
|
|||
match network.r#type() {
|
||||
NetworkType::WireGuard => summarize_wireguard(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),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,9 +48,6 @@ pub enum ResolvedTunnel {
|
|||
identity: RuntimeIdentity,
|
||||
config: Config,
|
||||
},
|
||||
Trojan {
|
||||
identity: RuntimeIdentity,
|
||||
},
|
||||
ProxySubscription {
|
||||
identity: RuntimeIdentity,
|
||||
payload: ProxySubscriptionPayload,
|
||||
|
|
@ -82,7 +79,6 @@ impl ResolvedTunnel {
|
|||
let config = Config::from_content_fmt(&payload, "ini")?;
|
||||
Ok(Self::WireGuard { identity, config })
|
||||
}
|
||||
NetworkType::Trojan => Ok(Self::Trojan { identity }),
|
||||
NetworkType::ProxySubscription => {
|
||||
let payload: ProxySubscriptionPayload = serde_json::from_slice(&network.payload)
|
||||
.context("proxy subscription payload must be valid JSON")?;
|
||||
|
|
@ -97,7 +93,6 @@ impl ResolvedTunnel {
|
|||
Self::Passthrough { identity }
|
||||
| Self::Tailnet { identity, .. }
|
||||
| Self::WireGuard { identity, .. }
|
||||
| Self::Trojan { identity, .. }
|
||||
| Self::ProxySubscription { identity, .. } => identity,
|
||||
}
|
||||
}
|
||||
|
|
@ -125,9 +120,6 @@ impl ResolvedTunnel {
|
|||
mtu: Some(1280),
|
||||
}),
|
||||
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),
|
||||
}
|
||||
}
|
||||
|
|
@ -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 } => {
|
||||
let runtime_config = proxy_runtime::proxy_runtime_config(&payload)?;
|
||||
let server_config = proxy_subscription_server_config_for_selected(
|
||||
|
|
@ -283,10 +272,6 @@ pub enum ActiveTunnel {
|
|||
interface: Arc<RwLock<WireGuardInterface>>,
|
||||
task: JoinHandle<Result<()>>,
|
||||
},
|
||||
Trojan {
|
||||
identity: RuntimeIdentity,
|
||||
server_config: ServerConfig,
|
||||
},
|
||||
ProxySubscription {
|
||||
identity: RuntimeIdentity,
|
||||
server_config: ServerConfig,
|
||||
|
|
@ -301,7 +286,6 @@ impl ActiveTunnel {
|
|||
Self::Passthrough { identity, .. }
|
||||
| Self::Tailnet { identity, .. }
|
||||
| Self::WireGuard { identity, .. }
|
||||
| Self::Trojan { identity, .. }
|
||||
| Self::ProxySubscription { identity, .. } => identity,
|
||||
}
|
||||
}
|
||||
|
|
@ -311,7 +295,6 @@ impl ActiveTunnel {
|
|||
Self::Passthrough { server_config, .. }
|
||||
| Self::Tailnet { server_config, .. }
|
||||
| Self::WireGuard { server_config, .. }
|
||||
| Self::Trojan { server_config, .. }
|
||||
| Self::ProxySubscription { server_config, .. } => server_config,
|
||||
}
|
||||
}
|
||||
|
|
@ -398,7 +381,6 @@ impl ActiveTunnel {
|
|||
task_result??;
|
||||
Ok(())
|
||||
}
|
||||
Self::Trojan { .. } => Ok(()),
|
||||
Self::ProxySubscription { packet_bridge, tun_task, .. } => {
|
||||
if let Some(tun_task) = tun_task {
|
||||
tun_task.abort();
|
||||
|
|
|
|||
|
|
@ -283,11 +283,6 @@ fn validate_network_payload(network: &RPCNetwork) -> Result<()> {
|
|||
NetworkType::Tailnet => {
|
||||
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 => {
|
||||
let payload: ProxySubscriptionPayload = serde_json::from_slice(&network.payload)?;
|
||||
crate::proxy_subscription::validate_payload(&payload)?;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,8 @@ message Network {
|
|||
enum NetworkType {
|
||||
WireGuard = 0;
|
||||
Tailnet = 1;
|
||||
Trojan = 2;
|
||||
reserved 2;
|
||||
reserved "Trojan";
|
||||
ProxySubscription = 3;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue