Skip to content

Embed the status SPA in the binary (fixes #73) - #74

Merged
Yanujz merged 8 commits into
mainfrom
feat/embed-status-ui
Sep 20, 2026
Merged

Yanujz merged 8 commits into
mainfrom
feat/embed-status-ui

Conversation

@Yanujz

@Yanujz Yanujz commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Closes #73. Spec §9's embedded UI finally exists: the built epmon-dev/status app is vendored under internal/api/webui and served from / with SPA fallback, no-store HTML, and immutable hashed assets — all gated behind server.status_page.enabled.

Commits, in order:

  1. Embed feature — vendored bundle (source.txt stamps origin 0fa682b-dirty), /api/* unknowns stay JSON 404, stale no-effect warning removed.
  2. Contract tests — /nope serves the shell when enabled; JSON-404 envelope pinned on /api/* in both modes.
  3. Flag aliasing fix — Default() shared one t across three pointers, so disabling the status page silently flipped auto_incidents/auto_resolve. Separate allocations + regression test. Found via the disabled-flag E2E.
  4. make web — rebuild + vendor flow (STATUS_DIR, default ../status).

Verified: full suite green, live binary serves /, /p/acme, immutable assets, JSON 404s, and the disabled flag restores old behavior. Heads-up: vendored bundle is built from uncommitted status/ work — refresh with make web after that lands.

Generates a config through the same schema the loader validates
(spec internal §17.2): prompt loop by default, flags with
--non-interactive for scripts. expect_status input parses via the
loader's own §4.3.1 grammar; the rendered document is validated
through config.Parse before an atomic write. Existing files need
--force; secrets are written as ${VAR} references, never literally.
Single entry point for the local workflow CI already runs
(fmt/vet/race/README validation/examples). cross covers the §G1
matrix; docker targets stamp VERSION/COMMIT/DATE so images never
report dev. COMPOSE auto-detects plugin vs standalone binary.
)

Vendor the built output of epmon-dev/status under internal/api/webui
and serve it from / with SPA fallback (/p/:slug, /s/:domain,
/embed), no-store HTML, immutable hashed assets. Unknown /api/*
paths stay JSON 404s so API clients never receive HTML. Removes
the stale status_page no-effect warning — the flag works now.
/nope now serves the SPA shell when enabled (pinned in webui
tests); the JSON-404 envelope is pinned on /api/* unknowns
instead, in both enabled and disabled modes.
Default() handed one *bool to StatusPage.Enabled, AutoIncidents
and AutoResolve, so setting status_page.enabled=false silently
flipped the other two. Each flag gets its own allocation, plus a
regression test.
refresh-webui.sh rebuilds a status/ checkout, vendors the output
into internal/api/webui and stamps the origin commit in
source.txt. Scope the dist/ ignore to the repo root so vendored
assets are tracked.
The embedded app filtered live services through hardcoded demo
tenants, so a self-hosted binary showed fake companies instead
of its own catalogue. New /local route renders every service the
serving backend reports under a synthetic tenant; / redirects
there. Demo tenant routes stay for preview.
@Yanujz
Yanujz merged commit 3ca0a87 into main Sep 20, 2026
2 checks passed
@Yanujz
Yanujz deleted the feat/embed-status-ui branch September 20, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embed the status-page UI in the binary (spec §9)

1 participant