Embed the status SPA in the binary (fixes #73) - #74
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #73. Spec §9's embedded UI finally exists: the built
epmon-dev/statusapp is vendored underinternal/api/webuiand served from/with SPA fallback, no-store HTML, and immutable hashed assets — all gated behindserver.status_page.enabled.Commits, in order:
source.txtstamps origin0fa682b-dirty),/api/*unknowns stay JSON 404, stale no-effect warning removed./nopeserves the shell when enabled; JSON-404 envelope pinned on/api/*in both modes.Default()shared onetacross three pointers, so disabling the status page silently flippedauto_incidents/auto_resolve. Separate allocations + regression test. Found via the disabled-flag E2E.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 withmake webafter that lands.