fix: don't show a bogus container IP for the network address under Docker

/api/network reported the container's bridge IP (172.x) when running in
Docker, which surfaced as a broken/"Error" value in Settings → About &
updates. Skip container-internal interfaces (detected via /.dockerenv) so the
endpoint returns no address inside a container, and guard the panel against an
unexpected response shape — both paths fall back to the helpful
"open via the server's IP" hint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Khalid Abdi
2026-06-27 21:33:08 +03:00
parent b2ac27dda7
commit 8309e1e82e
2 changed files with 23 additions and 9 deletions
@@ -66,7 +66,9 @@ export function VersionPanel() {
useEffect(() => {
if (localShareUrl) return;
getNetworkInfo()
.then((n) => setNetworkUrls(n.urls))
// Guard against an unexpected shape so a missing/garbled response shows the
// helpful "open via the server's IP" hint rather than a broken value.
.then((n) => setNetworkUrls(Array.isArray(n?.urls) ? n.urls : []))
.catch(() => setNetworkUrls([]));
}, [localShareUrl]);