feat(ui,server): surface active instance service URLs in About settings (#2669)

Show the running instance's local server URL and tunnel URL (when a
tunnel is active) as labeled, click-to-open buttons on the About page.
/api/system/info now reports the instance port and tunnel URL, resolved
lazily from the tunnel runtime so each Git-worktree instance identifies
itself in the UI without parsing terminal output.

Refs OPE-194
This commit is contained in:
Serhii Dziupin
2026-08-07 00:25:57 +03:00
committed by GitHub
parent 668a6f54fe
commit 834d2edb87
17 changed files with 214 additions and 0 deletions
+14
View File
@@ -1487,6 +1487,10 @@ async function main(options = {}) {
// relay candidate lazily at request time, so a late-bound holder is enough.
let relayServiceInstance = null;
// Same pattern for the tunnel runtime: created after the base routes so
// /api/system/info resolves port + tunnel URL lazily at request time.
let tunnelRuntimeContextHolder = null;
const bootstrapResult = bootstrapRuntime.setupBaseRoutes(app, {
process,
openchamberVersion: OPENCHAMBER_VERSION,
@@ -1523,6 +1527,15 @@ async function main(options = {}) {
apiOnly,
};
},
// Port this instance serves on and the active tunnel's public URL (if
// any), for /api/system/info. Resolved lazily because the tunnel runtime
// is created after these base routes are registered.
getServerPort: () => {
const activePort = tunnelRuntimeContextHolder?.getActivePort?.();
if (Number.isFinite(activePort) && activePort > 0) return activePort;
return Number.isFinite(port) && port > 0 ? port : null;
},
getTunnelUrl: () => tunnelRuntimeContextHolder?.tunnelService?.getPublicUrl?.() ?? null,
verboseRequestLogs: OPENCHAMBER_VERBOSE_REQUEST_LOGS,
uiPassword,
tunnelAuthController,
@@ -1598,6 +1611,7 @@ async function main(options = {}) {
const tunnelRuntimeContext = tunnelWiringRuntime.initialize(app, port);
const { tunnelService, startTunnelWithNormalizedRequest } = tunnelRuntimeContext;
tunnelRuntimeContextHolder = tunnelRuntimeContext;
// Private relay host service: config + management routes + host client
// lifecycle. Loopback port comes from the same source the tunnel uses so