Repository navigation
feat(sensitive): serve the office wall page, with fixed Prometheus questions (ADR-0119) - #1558
Merged
Merged
Conversation
…estions stacks/sensitive/wall/ is the trimmed Elysian Wall (ADR-0119): static HTML, CSS and JS, Tokyo Night, six panels sized for the office television at seven feet. Caddy serves it at wall.matrix.elysium. Every number comes from /api/q/NAME, one of eight handles in the Caddyfile that rewrite to a PromQL query written there. Caddy adds the reader token on the way to the ingest proxy and trusts the committed estate CA for that one transport. The client's query string is replaced, only GET and HEAD reach a handle (Prometheus reads a POST body's query= first), and anything else under /api/ is 404. The page and heimdall hold no credential. The page says when it does not know: no answer, or no Watchdog, is shown in red, never as "All quiet". check_caddyfile.sh offers its throwaway CA at the new ingest-ca.pem path too. The blackbox probe is committed commented out until morpheus has the wall host override. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
There was a problem hiding this comment.
🟡 Changes recommended
A hung query can block alert updates, and Loki security alerts are omitted, so the wall can falsely report that all is quiet during a critical incident.
11 open issues
Include Loki and Alertmanager alerts in the estate-wide verdict · New Bound fetches so hung requests cannot block dashboard updates · New Avoid persisting the expanded Prometheus reader token · New Filter probe latency to successful probes · New Use the verified converge path to deploy the current checkout · New Exclude informational alerts from the warning verdict · New Keep alert overflow indicators visible in the card · New Show resource labels to distinguish affected services and guests · New Use UPS charge only while its answer is fresh · New Use sample timestamps and show gaps in the sparkline · New Show unknown power source when battery-seconds data is missing · New
What changed in this PR
Adds the office wall dashboard for heimdall under ADR-0119, served by the sensitive stack’s existing Caddy without a separate application container.
Changes:
- Adds a television-sized page for alerts, hosts, internet traffic, UPS readings, and source freshness.
- Adds eight fixed Prometheus endpoints, with the reader token supplied server-side.
- Updates validation support and deployment documentation, leaving the blackbox probe disabled until DNS is ready.
| File | Description |
|---|---|
stacks/sensitive/wall/wall.js |
Polls fixed endpoints and renders dashboard data. |
stacks/sensitive/wall/wall.css |
Defines the television-sized Tokyo Night layout. |
stacks/sensitive/wall/index.html |
Adds dashboard panels and static asset loading. |
stacks/sensitive/README.md |
Documents the page, data flow, and rollout steps. |
stacks/sensitive/compose.yaml |
Adds the hostname alias, token environment, and read-only mounts. |
stacks/sensitive/Caddyfile |
Serves static assets and fixed Prometheus questions. |
stacks/observability/prometheus/targets/blackbox.yaml |
Stages a disabled probe pending DNS setup. |
scripts/check_caddyfile.sh |
Mounts a validation CA at the new trust-pool path. |
docs/security.md |
Documents unauthenticated access and fixed-query boundaries. |
docs/runbooks/build-heimdall.md |
Explains switching the kiosk to the wall URL. |
docs/changelog.md |
Records the implementation and pending activation. |
docs/architecture.md |
Adds the wall page to the sensitive-tier description. |
Review effort: Balanced
| # Every firing alert, Watchdog included: its absence means rule evaluation has stopped. | ||
| # ALERTS{alertstate="firing"} | ||
| handle /api/q/alerts { | ||
| rewrite * /api/v1/query?query=ALERTS%7Balertstate%3D%22firing%22%7D |
Comment on lines
+71
to
+83
| async function ask(name) { | ||
| try { | ||
| const res = await fetch(`/api/q/${name}`, { cache: "no-store" }); | ||
| if (!res.ok) return; | ||
| const body = await res.json(); | ||
| if (body.status !== "success") return; | ||
| answers[name] = body.data.result; | ||
| lastOk[name] = Date.now(); | ||
| } catch (_) { | ||
| // Network or parse failure: keep the last answer, and let the status | ||
| // bar say how old it is. | ||
| } | ||
| } |
| # fail in the browser rather than quietly leak a request. | ||
| (wall_prometheus) { | ||
| reverse_proxy https://10.0.99.20:9090 { | ||
| header_up Authorization "Bearer {$GLANCE_PROMETHEUS_TOKEN}" |
Comment on lines
+357
to
+359
| # probe_duration_seconds{job="blackbox-latency",name="cloudflare"} | ||
| handle /api/q/rtt { | ||
| rewrite * /api/v1/query?query=probe_duration_seconds%7Bjob%3D%22blackbox-latency%22%2Cname%3D%22cloudflare%22%7D |
| 1. Add `wall` to `trinity`'s *Additional Names for this Host* on `morpheus` | ||
| ([`add-a-host-override.md`](../../docs/runbooks/add-a-host-override.md)), | ||
| then check that `wall.matrix.elysium` answers `10.0.99.40`. | ||
| 2. `make up STACK=sensitive` (or wait for the converge timer). Caddy is |
Comment on lines
+134
to
+135
| const SHOWN = 7; | ||
| for (const a of faults.slice(0, SHOWN)) { |
| const row = el("div", `al ${m.severity || ""}`); | ||
| row.append(el("i", "sev")); | ||
| const msg = el("div", "m", m.alertname); | ||
| const where = m.instance || m.host || m.device || m.name || m.job || ""; |
| } else { | ||
| if (!fresh("snmp")) state = "unknown"; | ||
| else if (snmp.get(h.name) !== 1) state = "down"; | ||
| if (state === "ok" && h.name === "mjolnir" && charge) { |
Comment on lines
+208
to
+211
| const ys = series.values.map((v) => Number(v[1])); | ||
| const max = Math.max(...ys, 1); | ||
| const step = 600 / (ys.length - 1); | ||
| const pts = ys.map((y, i) => `${(i * step).toFixed(1)} ${(76 - (y / max) * 70).toFixed(1)}`); |
Comment on lines
+232
to
+234
| const onBattery = (ups.get("upsSecondsOnBattery") || 0) > 0; | ||
| card.dataset.state = onBattery ? "battery" : "mains"; | ||
| $("ups-state").textContent = onBattery ? "On battery" : "On mains"; |
5 of 6 tasks
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.


What changed
stacks/sensitive/wall/is the trimmed Elysian Wall: static HTML, CSS and JS in the Tokyo Night look of the operator's mockup. It is cut from about 18 cards to six panels and sized for the office television at seven feet: text at least 28px, labels at least 20px, figures at least 64px.trinity's Caddy serves it atwall.matrix.elysiumforheimdall's kiosk.The panels:
heimdall's temperatureThe household half is a placeholder for now.
How the numbers reach the page. Every number comes from
/api/q/NAME, one of eighthandles in the Caddyfile:alloy/ingest-ca.pem) for that one transport.Other files:
check_caddyfile.shoffers its throwaway CA at the newingest-ca.pempath, socaddy validatecan load it.morpheushas the host override.stacks/sensitive/README.md(a new The wall page section with the deploy steps),security.md,architecture.md,build-heimdall.md§7, and the changelog.Why
ADR-0119 decided the wall shows pages served by
trinity, with tokens added server-side and nothing on the Pi. This is that page. It follows the trimmed layout agreed with the operator: anything that needs action is an alert, and when everything is healthy the screen stays neutral and still.Refs ADR-0119.
Blast radius
trinity's Caddy: a new site block, a new network alias, the reader token in its environment, and two read-only mounts. A mistake here could stop Caddy, and every household site behind it.caddy validatepasses on the whole file (below).Exposure:
wall.matrix.elysiumhas no login, like Glance. Anything that reachestrinity:443can read the eight answers: firing alerts, per-host CPU, SNMP reachability, WAN traffic and latency, the UPS, andheimdall's temperature. That is less than the Homelab page already shows. The query is never the client's, and only GET and HEAD pass, because Prometheus would take a POST body'squery=over the URL's.Firewall: no new rule. Hicks already reaches
trinity:443, andtrinityalready reaches the reader proxy.No change to network segmentation or firewall rules
No new port published to a VLAN that could not already reach the service
No credential added outside
secrets/*.sops.yaml— it reusesGLANCE_PROMETHEUS_TOKEN, the existing reader, so rotation stays the three editssensitive.example.yamllistsVerification
Run here:
compose.yaml's tag), ran the realwallblock against a stand-in Prometheus that logged every request:/api/q/alertsreturned 200, and upstream receivedGET /api/v1/query?query=ALERTS{alertstate="firing"}withAuthorization: Bearer <token>and no cookie./api/q/cpu?query=upreturned 200, and upstream received the CPU question, notup./api/q/cpureturned 405, and nothing reached upstream./api/v1/query?query=upand/api/q/nopereturned 404./served the CSP,nosniffandno-referrerheaders, and no upstreamSet-Cookiepassed through.caddy validateon the wholestacks/sensitive/CaddyfileprintedValid configuration, with the seeded validation environment and throwaway CAs at the pathscheck_caddyfile.shmounts.caddy fmt --diffreported no changes.never.python3 scripts/check_docs.pypassed, andnode --check wall.jspassed../scripts/lint.sh: passed, with 12 checks skipped and not run because this container has no Docker daemon or pipx: yamllint, markdownlint-cli2, shellcheck, actionlint, zizmor, packer ×2, tofu ×3, ansible-lint and editorconfig-checker. CI runs them with--require-all.make validate, the hardened boots andcheck_caddyfile.shitself: not run here, for the same reason.Not done (operator, after merge; the steps are in the README's The wall page):
wallhost override onmorpheusmake up STACK=sensitivecurlof/api/q/alertsheimdall's kiosk URLmake validatepasses — not run here (no Docker); left to CIdocs/, service README, ordocs/roadmap.md)Generated by Claude Code