Skip to content

Commit 866335b

Browse files
committed
Remove unreliable WARP outbound IP check from diagnostics
The curl-based IP check fails when WARP-routed users can't resolve DNS. The remaining checks (interface, handshake, routes, ip rules, service users) are sufficient to verify WARP routing.
1 parent 79ee241 commit 866335b

1 file changed

Lines changed: 0 additions & 35 deletions

File tree

internal/handlers/system_diag.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -294,21 +294,6 @@ func handleSystemDiag(ctx *actions.Context) error {
294294
}
295295
}
296296

297-
// Outbound IP verification: compare default vs WARP-routed IP
298-
if wgUp && hasRoute {
299-
defaultIP := fetchOutboundIP("")
300-
warpIP := fetchOutboundIP(warp.SocksUser)
301-
if defaultIP != "" && warpIP != "" {
302-
ipDiff := defaultIP != warpIP
303-
check("WARP outbound IP", ipDiff,
304-
boolStr(ipDiff,
305-
fmt.Sprintf("%s (default: %s)", warpIP, defaultIP),
306-
fmt.Sprintf("%s — same as default, WARP not routing traffic", warpIP)))
307-
} else if defaultIP != "" && warpIP == "" {
308-
check("WARP outbound IP", false,
309-
"could not reach ipify.org as "+warp.SocksUser+" — traffic may be blackholed")
310-
}
311-
}
312297
}
313298

314299
// ── Orphaned Services ───────────────────────────────────
@@ -516,23 +501,3 @@ func lookupSystemUID(username string) int {
516501
return uid
517502
}
518503

519-
// fetchOutboundIP queries api.ipify.org to determine the outbound IP.
520-
// If runAs is non-empty, the request is executed as that system user
521-
// via sudo so it inherits the user's policy-routing rules.
522-
func fetchOutboundIP(runAs string) string {
523-
var cmd *exec.Cmd
524-
if runAs != "" {
525-
cmd = exec.Command("sudo", "-u", runAs, "curl", "-s", "-m", "5", "https://api.ipify.org")
526-
} else {
527-
cmd = exec.Command("curl", "-s", "-m", "5", "https://api.ipify.org")
528-
}
529-
out, err := cmd.Output()
530-
if err != nil {
531-
return ""
532-
}
533-
ip := strings.TrimSpace(string(out))
534-
if net.ParseIP(ip) == nil {
535-
return ""
536-
}
537-
return ip
538-
}

0 commit comments

Comments
 (0)