Acknowledge and hand over alerts, incident timelines, and built-in database backups

- Alerts can be acknowledged (note, assignee, duration); acknowledged alerts are left out of what
  needs attention (sidebar, dashboard strip, cards) but stay raised and counted by /metrics
- Incidents: each time an alert is raised and goes away is recorded (alert_acks, alert_incidents,
  incident_notes, migration 0032), with a timeline of acks, maintenance, changes, update runs,
  related alerts and notes; Incidents page and a digest section
- Backups of Homelab Manager's own database: daily checked VACUUM INTO copies, retention, download,
  check, upload, delete, and restore staged and applied at start-up before the database opens
  (pre-restore copy kept); alerts and /metrics for stale or failing backups
- Docs: README, BACKUP, DATABASE, NOTIFICATIONS, ROLES, API; tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-18 02:21:08 +02:00
1 parent 7a5b623444
commit 2744a84719
41 files changed
+6573 -26

No files matched your search

+3 -3
View File
@@ -282,9 +282,9 @@ describe("following a run to the end", () => {
const titles = events.filter((e) => /Update run/.test(e.title)).map((e) => e.title);
// (the tests before this one wrote their own lines too, so this looks for the kinds rather than the number)
for (const wanted of ["Update run started", "Update run didn't finish", "Update run finished", "Update run stopped being followed"]) assert.ok(titles.includes(wanted), `${wanted} in ${JSON.stringify([...new Set(titles)])}`);
const failedLine = events.find((e) => e.title === "Update run didn't finish")!;
assert.equal(failedLine.tone, "bad");
assert.match(failedLine.detail!, /The playbook failed in Semaphore/);
const failedLines = events.filter((e) => e.title === "Update run didn't finish");
assert.ok(failedLines.every((e) => e.tone === "bad"), "a run that didn't finish reads as bad");
assert.ok(failedLines.some((e) => /The playbook failed in Semaphore/.test(e.detail ?? "")), "and says why");
assert.ok((await db.select().from(auditLog)).some((a) => a.category === "update_run" && a.action === "failed"));
// nothing is held in memory: a fresh pass over the table is all it takes