diag host: real path prefixes for every UI, and an index page served as a file

Each service now runs behind the prefix it is published under (-http.pathPrefix, or route-prefix plus
external-url for Alertmanager). Without that, three of the four UIs would have loaded at their sub-path and
then fetched their assets from the domain root, so the pages would have come up broken. The prefixes cascade,
so the scrape paths, vmalert's notifier and remote-write URLs, and the deadman's health probes all follow.

The index is diag/index.html mounted into Caddy, not an inline respond: Caddy reads {...} as placeholders and
the page's CSS is full of braces, so inline would have been mangled. It also matches how the gateway, dock and
clips pages are already served.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-03 16:17:47 -06:00
parent d3ff452546
commit da9a1f4fa6
5 changed files with 66 additions and 19 deletions

37
diag/index.html Normal file
View File

@@ -0,0 +1,37 @@
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Vanguard diagnostics</title>
<style>
:root{--bg:#121417;--panel:#1c2026;--line:#2b313a;--fg:#f3f1ea;--mut:#a3acb8;--acc:#e5484d}
*{box-sizing:border-box}
body{background:var(--bg);color:var(--fg);font:16px/1.55 system-ui,-apple-system,"Segoe UI",sans-serif;margin:0;padding:48px 20px}
main{max-width:680px;margin:0 auto}
h1{font-size:30px;margin:0 0 6px;letter-spacing:.3px}
.lead{color:var(--mut);margin:0 0 30px}
a.card{display:block;padding:15px 18px;margin:0 0 10px;background:var(--panel);border:1px solid var(--line);
border-radius:12px;color:var(--fg);text-decoration:none}
a.card:hover{border-color:var(--acc)}
a.card b{display:block;font-size:17px}
a.card span{color:var(--mut);font-size:14px}
.note{margin-top:30px;padding:16px 18px;background:var(--panel);border:1px solid var(--line);border-radius:12px;
color:var(--mut);font-size:14px}
.note b{color:var(--fg)}
footer{margin-top:26px;color:#6b7280;font-size:13px}
footer a{color:#6b7280}
</style></head>
<body><main>
<h1>Vanguard diagnostics</h1>
<p class="lead">Logs, metrics and alerts for this server. Visible to <code>media-admins</code>.</p>
<a class="card" href="/logs"><b>Logs</b><span>every container and our own timers, last 30 days · VictoriaLogs</span></a>
<a class="card" href="/metrics-db"><b>Metrics</b><span>host, containers, MediaMTX, Caddy, last 90 days · VictoriaMetrics</span></a>
<a class="card" href="/alerts"><b>Alerts</b><span>what is firing now, and silences · Alertmanager</span></a>
<a class="card" href="/rules-metrics"><b>Metric rules</b><span>disk, load, memory, RAID, container restart loops</span></a>
<a class="card" href="/rules-logs"><b>Log rules</b><span>sweep failures, publish denials, failed bot releases</span></a>
<div class="note"><b>A deadman runs on the host, outside all of this.</b> Every five minutes it checks that each
service here still answers, that the alerting path is still delivering, and that the disks are not filling, and
it reports to Discord itself. Nothing on this page can tell you it has died, which is the point.</div>
<footer>Vanguard Media · <a href="/logout">sign out</a></footer>
</main></body></html>