fix: revert to direct port access for app iframes

Proxy paths (/app/name/) break iframes due to root-relative asset
paths. Direct IP:port access works correctly over Tailscale and LAN.
This has been confirmed working on .228 via Tailscale DNS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian 2026-04-01 21:08:11 +01:00
parent a0b029ae26
commit 5e6bdf11ee

View File

@ -145,15 +145,16 @@ export function resolveAppUrl(id: string, routeQueryPath?: string): string {
}
}
// Always use nginx proxy paths — direct port access fails over Tailscale/VPN
// and when ports aren't exposed externally
const proxyPathEntry = HTTPS_PROXY_PATHS[id]
if (proxyPathEntry) return `${window.location.origin}${proxyPathEntry}`
// HTTPS: use nginx proxy to avoid mixed content
if (window.location.protocol === 'https:') {
const httpsProxy = HTTPS_PROXY_PATHS[id]
if (httpsProxy) return `${window.location.origin}${httpsProxy}`
}
// Fallback: direct port (only for apps without a proxy path)
// HTTP: direct port access (iframes break with proxy paths due to root-relative assets)
const port = APP_PORTS[id]
if (!port) return ''
let base = `${window.location.protocol}//${window.location.hostname}:${port}`
let base = `http://${window.location.hostname}:${port}`
if (routeQueryPath) base += routeQueryPath
return base
}