Skip to content

feat(sensitive): serve the office wall page, with fixed Prometheus questions (ADR-0119) - #1558

Merged
Gerrrt merged 1 commit into
mainfrom
claude/homelab-tv-dashboard-sd6zal
Nov 17, 2026
Merged

Gerrrt merged 1 commit into
mainfrom
claude/homelab-tv-dashboard-sd6zal

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 17, 2026

Copy link
Copy Markdown
Owner

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 at wall.matrix.elysium for heimdall's kiosk.

The panels:

  • the time
  • the firing alerts, with a verdict pill
  • eight hosts: morpheus, Saruman, trinity, prometheus, oracle, smaug, neo and mjolnir
  • the internet: down, up, ms to 1.1.1.1, and an hour's sparkline
  • the UPS
  • a status bar with each source's age and heimdall's temperature

The household half is a placeholder for now.

How the numbers reach the page. Every number comes from /api/q/NAME, one of eight handles in the Caddyfile:

  • Each handle rewrites to one PromQL query written there.
  • Caddy adds the reader token on the way to the ingest proxy, trusting the committed estate CA (alloy/ingest-ca.pem) for that one transport.
  • The page picks a name, never a query.

Other files:

  • check_caddyfile.sh offers its throwaway CA at the new ingest-ca.pem path, so caddy validate can load it.
  • The blackbox probe for the site is committed commented out until morpheus has the host override.
  • Docs: 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 validate passes on the whole file (below).

  • Exposure: wall.matrix.elysium has no login, like Glance. Anything that reaches trinity:443 can read the eight answers: firing alerts, per-host CPU, SNMP reachability, WAN traffic and latency, the UPS, and heimdall'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's query= over the URL's.

  • Firewall: no new rule. Hicks already reaches trinity:443, and trinity already 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 reuses GLANCE_PROMETHEUS_TOKEN, the existing reader, so rotation stays the three edits sensitive.example.yaml lists

Verification

Run here:

  • Routing: the pinned Caddy, v2.11.9 (the release that matches compose.yaml's tag), ran the real wall block against a stand-in Prometheus that logged every request:
    • /api/q/alerts returned 200, and upstream received GET /api/v1/query?query=ALERTS{alertstate="firing"} with Authorization: Bearer <token> and no cookie.
    • /api/q/cpu?query=up returned 200, and upstream received the CPU question, not up.
    • POST and DELETE on /api/q/cpu returned 405, and nothing reached upstream.
    • /api/v1/query?query=up and /api/q/nope returned 404.
    • / served the CSP, nosniff and no-referrer headers, and no upstream Set-Cookie passed through.
  • Validation: caddy validate on the whole stacks/sensitive/Caddyfile printed Valid configuration, with the seeded validation environment and throwaway CAs at the paths check_caddyfile.sh mounts. caddy fmt --diff reported no changes.
  • The page: Playwright at 1920×1080 against the stand-in showed no console errors. With the stand-in stopped, the page shows No answer from Prometheus in red, grey host dots, and every source as never.
  • Other checks: python3 scripts/check_docs.py passed, and node --check wall.js passed.
  • ./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 and check_caddyfile.sh itself: not run here, for the same reason.

Not done (operator, after merge; the steps are in the README's The wall page):

  1. the wall host override on morpheus
  2. make up STACK=sensitive
  3. a live curl of /api/q/alerts
  4. switching heimdall's kiosk URL
  5. uncommenting the blackbox probe
  • make validate passes — not run here (no Docker); left to CI
  • Deployed to the lab and confirmed working — needs the host override first
  • Docs updated (docs/, service README, or docs/roadmap.md)

Generated by Claude Code

…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
Copilot AI balanced review requested due to automatic review settings November 17, 2026 23:10
@Gerrrt
Gerrrt merged commit 702e74e into main Nov 17, 2026
9 checks passed
@Gerrrt
Gerrrt deleted the claude/homelab-tv-dashboard-sd6zal branch November 17, 2026 23:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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
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";
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.

3 participants