Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix([codex5-network-exposure-ui]): address codex review

[._.]/ Adam Eivy96b1b09377ca
diff --git a/client/src/components/NetworkExposureWidget.jsx b/client/src/components/NetworkExposureWidget.jsx
index 6cfe1741f2..cac4468063 100644
--- a/client/src/components/NetworkExposureWidget.jsx
+++ b/client/src/components/NetworkExposureWidget.jsx
@@ -19,17 +19,24 @@ import * as api from '../services/api';
// 127.0.0.1/::1 — anything else (Tailscale IP, LAN IP, plain hostname over
// HTTP) silently fails. Server-side we know the scheme + bind, but only the
// browser knows which of those origins it actually loaded from.
-const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '::1']);
+// Browsers report IPv6 `window.location.hostname` with brackets (`[::1]`)
+// while the bare-form `::1` shows up in env-style configs; accept both so
+// the heuristic doesn't false-negative on `http://[::1]:5555`.
+const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '::1', '[::1]']);
+
+function isLoopbackOrigin() {
+ if (typeof window === 'undefined' || !window.location) return false;
+ return LOOPBACK_HOSTS.has(window.location.hostname);
+}
function describeMicAvailability() {
if (typeof window === 'undefined' || !window.location) {
return { available: true, reason: 'unknown' };
}
- const { protocol, hostname } = window.location;
- if (protocol === 'https:') {
+ if (window.location.protocol === 'https:') {
return { available: true, reason: 'https' };
}
- if (LOOPBACK_HOSTS.has(hostname)) {
+ if (isLoopbackOrigin()) {
return { available: true, reason: 'loopback' };
}
return { available: false, reason: 'insecure-context' };
@@ -167,14 +174,25 @@ const NetworkExposureWidget = memo(function NetworkExposureWidget() {
Loopback HTTP mirror
</dt>
<dd className="text-right text-gray-300">
- <a
- href={`http://localhost:${loopbackMirror.port}`}
- target="_blank"
- rel="noreferrer"
- className="font-mono text-xs text-port-accent hover:underline"
- >
- :{loopbackMirror.port}
- </a>
+ {/* Mirror is bound to 127.0.0.1 server-side, so it's only
+ reachable when the browser is on the same host. Anywhere
+ else (Tailscale IP, LAN), an `http://localhost:5553` link
+ would resolve to the viewer's own machine and 404 — show
+ informational text instead of a broken link. */}
+ {isLoopbackOrigin() ? (
+ <a
+ href={`http://localhost:${loopbackMirror.port}`}
+ target="_blank"
+ rel="noreferrer"
+ className="font-mono text-xs text-port-accent hover:underline"
+ >
+ :{loopbackMirror.port}
+ </a>
+ ) : (
+ <span className="font-mono text-xs text-gray-500" title="Reachable only from the PortOS host machine">
+ :{loopbackMirror.port} (host-only)
+ </span>
+ )}
</dd>
</div>
)}
diff --git a/server/services/dashboardLayouts.js b/server/services/dashboardLayouts.js
index 45fe802c01..92dc9a0107 100644
--- a/server/services/dashboardLayouts.js
+++ b/server/services/dashboardLayouts.js
@@ -60,7 +60,7 @@ const DEFAULT_LAYOUTS = [
{ id: 'backup', x: 0, y: 10, w: 3, h: 4 },
{ id: 'quick-stats', x: 3, y: 10, w: 3, h: 3 },
{ id: 'goal-progress', x: 6, y: 10, w: 3, h: 4 },
- { id: 'network-exposure', x: 9, y: 10, w: 3, h: 4 },
+ { id: 'network-exposure', x: 9, y: 10, w: 3, h: 5 },
// Row 14–17: lower-priority + cos
{ id: 'decision-log', x: 0, y: 14, w: 4, h: 2 },
{ id: 'cos', x: 4, y: 14, w: 5, h: 4 },
@@ -111,12 +111,12 @@ const DEFAULT_LAYOUTS = [
// status, backup + quick-stats stacked on the right, apps grid fills
// the empty cell below cos so all 5 widgets fit above the fold.
grid: [
- { id: 'system-health', x: 0, y: 0, w: 6, h: 5 },
- { id: 'quick-stats', x: 6, y: 0, w: 6, h: 3 },
- { id: 'cos', x: 6, y: 3, w: 6, h: 4 },
- { id: 'backup', x: 0, y: 5, w: 3, h: 3 },
- { id: 'network-exposure', x: 3, y: 5, w: 3, h: 3 },
- { id: 'apps', x: 0, y: 8, w: 12, h: 11 },
+ { id: 'system-health', x: 0, y: 0, w: 6, h: 5 },
+ { id: 'quick-stats', x: 6, y: 0, w: 6, h: 3 },
+ { id: 'cos', x: 6, y: 3, w: 6, h: 4 },
+ { id: 'backup', x: 0, y: 5, w: 3, h: 3 },
+ { id: 'network-exposure', x: 3, y: 5, w: 3, h: 5 },
+ { id: 'apps', x: 0, y: 10, w: 12, h: 11 },
],
},
];