From b7ff0b1d381c189be059b09a577ba723fe654d10 Mon Sep 17 00:00:00 2001 From: Dorian Date: Fri, 10 Apr 2026 04:48:08 -0400 Subject: [PATCH] fix: VPN IP dedup, status polling, pair-a-device text - VPN status: don't show WG IP as NostrVPN IP when tunnel not up - VPN section polls every 15s so IP updates after pairing - NostrVPN shows "Pair a device" when service active but no tunnel Co-Authored-By: Claude Opus 4.6 (1M context) --- core/archipelago/src/api/rpc/vpn.rs | 8 +++++++- neode-ui/src/views/Server.vue | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/core/archipelago/src/api/rpc/vpn.rs b/core/archipelago/src/api/rpc/vpn.rs index 1e728e59..cc09c28a 100644 --- a/core/archipelago/src/api/rpc/vpn.rs +++ b/core/archipelago/src/api/rpc/vpn.rs @@ -46,11 +46,17 @@ impl RpcHandler { let wg_pubkey = tokio::fs::read_to_string("/var/lib/archipelago/wireguard/public.key") .await.ok().map(|s| s.trim().to_string()); + // Don't report NostrVPN ip_address if it's the same as WireGuard (means tunnel not up) + let nvpn_ip = status.ip_address.as_ref().and_then(|ip| { + let clean = ip.split('/').next().unwrap_or(ip); + if wg_ip.as_deref() == Some(clean) { None } else { Some(ip.clone()) } + }); + Ok(serde_json::json!({ "connected": status.connected || wg_ip.is_some(), "provider": status.provider, "interface": status.interface, - "ip_address": status.ip_address, + "ip_address": nvpn_ip, "hostname": status.hostname, "peers_connected": status.peers_connected, "bytes_in": status.bytes_in, diff --git a/neode-ui/src/views/Server.vue b/neode-ui/src/views/Server.vue index 1ccbe4ff..f3b78b8e 100644 --- a/neode-ui/src/views/Server.vue +++ b/neode-ui/src/views/Server.vue @@ -214,7 +214,7 @@
NostrVPN - {{ networkData.vpnIp || 'Not active' }} + {{ networkData.vpnIp || (networkData.vpnConnected ? 'Pair a device' : 'Not active') }} @@ -444,7 +444,7 @@