Repository navigation
fix(servapps): HostChip status dot reads the real HTTP status - #582
madejackson wants to merge 1 commit into
Conversation
…r#582, drop extra CORS middleware Rebase unstable's HostChip / servapps / proxy code onto the same content as the two upstream PRs (hostchip-fixes azukaar#582 and health-aware status badges azukaar#581), while keeping every unrelated fork commit in place. - hostChip.jsx: identical to PR azukaar#582 (cors HEAD probe, no-store, redirect manual, binary status classification; container grey-dot gating). - container-status.jsx / overview.jsx / servapps.jsx: merged PR azukaar#581+azukaar#582 content (isContainerRunning shared helper, health-aware badges, container={app.app} / container={containerInfo}). - routeTo.go / middleware.go: PR azukaar#582 versions (HEAD ACAO echo, CORP relax, Vary: Origin). - Remove the fork's extra CORS layer (HeadProbeCORS top-level middleware + originUnderDomain CORS echo) to test unstable without it. These remain recoverable on backup/unstable-cors-full.
|
Added cross-origin / OIDC support (commit The original PR covered the same-origin/path-prefix case. HostChip probes and the Cosmos UI can also run on a different subdomain than the proxied apps, and OIDC-protected apps redirect to the OpenID login inside New changes (all scoped to the Cosmos domain, so third-party origins are never allowed):
Mergeability with the health-aware status badges PR (#581) remains clean in both merge orders (re-verified after this commit). |
|
Added TCP/UDP socket-proxy handling (commit Raw TCP/UDP socket proxies (e.g. |
|
Added a follow-up fix as the PR's latest commit ( The commit adds Verified: a copy of the wrapper no longer hides |
|
Fixed a regression on the routes/URLs page (commit
Fix: only gate on the container run state (grey dot, no probe) when a container is passed and is not running. When no container is passed there is no run state to gate on, so the URL is probed as usual. Socket proxies still show green when their container (if any) is running. |
|
URLs page now behaves the same as ServApps (commit Previously the URLs/routes pages rendered
Result: a SERVAPP whose container is not running shows a grey dot on the URLs pages too; non-container routes (STATIC/SPA/PROXY/tunnels) still probe as usual. |
|
Added today's fixes from the fork (commit
Tests updated: a running lazy probe returns |
020d9ac to
bbc2630
Compare
eccc6ee to
c69035e
Compare
c69035e to
e2e82ff
Compare
Summary
Fixes the HostChip reachability indicator (the colored dot next to a service's URL). It used a
no-corsHEAD fetch, whose response is opaque — the browser hides the status entirely, so the dot always resolved as "online". A proxied 502 (e.g. a wrong downstream port) or a dead backend therefore still showed green.This PR makes the probe read the real HTTP status and classify it correctly, adds the server-side CORS/CORP handling the cross-origin probe needs (including for multi-subdomain + OIDC setups), and shows a grey dot when the container isn't running.
Changes
Client —
HostChip(client/src/components/hostChip.jsx)mode: 'cors'(notno-cors) so the browser exposes the actual status;cache: 'no-store'bypasses stale cached responses;redirect: 'manual'keeps 3xx login redirects from being followed into a CORS failure (e.g. adata:URL).opaqueredirectlogin redirects) and 401, 403, 405, 407, 429, 511 — the reverse proxy answered while refusing this caller; the host is up.containerprop plumbed from the servapps list and container overview.isContainerRunninghelper fromclient/src/utils/container-status.jsx.New util —
client/src/utils/container-status.jsxgetContainerDisplayStatus,rankDisplayStatus,isContainerRunning) so HostChip and the health-aware status badges PR share one implementation. This file is byte-identical with PR feat(servapps): health-aware status badges #581's copy, so the two PRs merge cleanly regardless of order.Server — proxy (
src/proxy/routeTo.go)OrigininAccess-Control-Allow-Origin(withVary: Origin) so the browser can read the probe status; relax a backend-sentCross-Origin-Resource-Policyon HEAD only.cross-originon HEAD only (app headers preserved for real traffic).Server — middleware + router (
src/utils/middleware.go,src/httpServer.go)Vary: OrigintoCORSHeader/PublicCORSso origin-dependent responses are never cached and served to another origin.originUnderDomain+HeadProbeCORS+CORSHeaderorigin-echo, scoped to the Cosmos domain only (hostname or subdomains). This makes the UI readable on a different subdomain than the apps, and makes the OpenID auth-gate 302 (produced insidetokenMiddleware, before the per-routeCORSHeader) readable by the browser.Test Plan
go build ./srcpasses.Notes