diff --git a/docs/architecture.md b/docs/architecture.md index e67b7d31..0ad6cc0c 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -207,7 +207,7 @@ hole from the monitoring VLAN into the monitored one. | `phoenix` (10.0.30.70) | ๐ŸŸข 30 | *(none โ€” a toolchain host, no Docker)* | The deployment host, built 2026-09-20: a Proxmox API token, an SSH key and a checkout, so that the Packer, OpenTofu and Ansible work after [#436](https://github.com/Gerrrt/HomeLab/issues/436) has somewhere to run from. A guest on `Saruman`, placed by [ADR-0043](adr/0043-keep-the-ca-on-prometheus-and-build-phoenix-as-the-deployment-host.md), which also decides that the estate's CA key stays on `prometheus` and does not follow the toolchain here. It holds no age key and runs no continuous convergence (what it configures, it configures on demand, below); it is the WireGuard endpoint of [ADR-0042](adr/0042-terminate-the-remote-path-on-the-lab-and-route-it.md), built 2026-09-22 ([#442](https://github.com/Gerrrt/HomeLab/issues/442)); the one thing it is meant to reach that no other guest does is `8006` on `Saruman`, by a single host-firewall rule โ€” written 2026-09-20, when [#566](https://github.com/Gerrrt/HomeLab/issues/566) enabled the firewall the build had found disabled and narrowed the `local_network` alias that was admitting the whole segment underneath it. Its Alloy pushes to `alexander`, never to VLAN 99; the build is [`build-the-jumpbox.md`](runbooks/build-the-jumpbox.md). The first toolchain on it is [`packer/`](../packer/README.md), the lab's VM templates at VMIDs 901โ€“912, with 903โ€“909 for the dotfiles OS layers ([ADR-0090](adr/0090-test-the-dotfiles-os-layers-on-on-demand-saruman-guests.md)) ([ADR-0074](adr/0074-build-the-lab-templates-with-packer-from-phoenix.md), [`build-the-lab-templates.md`](runbooks/build-the-lab-templates.md)). The second is [`ansible/`](../ansible/README.md), which configures ADR-0029's six over SSH and touches nothing else ([ADR-0077](adr/0077-configure-the-lab-domain-with-ansible-from-phoenix.md), [#448](https://github.com/Gerrrt/HomeLab/issues/448)). Its own way in is decided by [ADR-0117](adr/0117-give-phoenix-a-key-only-sshd-and-a-default-deny-inbound-policy.md): `sshd` takes keys only, and `ufw` admits `22` from Hicks and the tunnel's peers, the tunnel's port, and `8800` from VLAN 30 for the length of a Debian or Kali template build. Applying it on the host is [#1496](https://github.com/Gerrrt/HomeLab/issues/1496). Alloy agent (native package, `scripts/deploy-agent.sh`) | | `golem` (10.0.30.80) | ๐ŸŸข 30 | *(none โ€” an appliance, no Docker)* | Proxmox Backup Server 4.2, built 2026-10-03 by [`build-the-backup-guest.md`](runbooks/build-the-backup-guest.md) ([#485](https://github.com/Gerrrt/HomeLab/issues/485)): the lab's backups, placed by [ADR-0053](adr/0053-run-pbs-on-saruman-with-its-datastore-on-smaug-over-nfs.md). A guest on `Saruman`, VMID 180, whose only datastore, `erebor`, is `smaug`'s `erebor/pbs` over NFSv4 through one `2049` pass, with `atime` on because garbage collection depends on it, and the mountpoint made immutable so an unmounted share cannot fill the OS disk. Every backup is encrypted on `Saruman` before it leaves, with a key made on `Saruman` and copied, on 2026-10-03, into `secrets/lab.sops.yaml` and onto paper (the runbook's ยง7), so a lost `Saruman` does not take the backups' readability with it; `Saruman` writes through a token that can back up and cannot prune. PBS prunes (7 daily, 4 weekly, 3 monthly), collects garbage on Saturdays and verifies on Sundays; TrueNAS keeps fourteen daily snapshots of the dataset as the copy PBS cannot prune. The nightly job takes `odin`, `garuda` and the domain's six, the guests tagged `backup`; `alexander`, `phoenix`, `fenrir` and `golem` itself are rebuilt from this repository and stay out, and so does `eden`, whose graph is one collection run from rebuilt (the runbook's ยง8). `scripts/collect-pbs-task-state.py` publishes every job's last outcome and the snapshots' verify state hourly, and seven rules in `stacks/lab` read them; the first nightly run, 2026-10-03, was verified the next morning. Its Alloy pushes to `alexander`, never to VLAN 99, since 2026-10-03. Alloy agent (native package, `scripts/deploy-agent.sh`) | | `oracle` (10.0.99.30) | ๐Ÿ”ด 99 | [`stacks/wiki`](../stacks/wiki) | The Lemmiwinks wiki and its Postgres, since 2025-11-12 ([ADR-0011](adr/0011-keep-the-wiki-internal.md)), hand-run containers until [#251](https://github.com/Gerrrt/HomeLab/issues/251) wrote them down as a stack deployed by hand from `main`, like `smaug`'s. **Cut over 2026-10-07** ([#847](https://github.com/Gerrrt/HomeLab/issues/847), [ADR-0082](adr/0082-serve-the-wiki-over-tls-and-deploy-it-from-a-verified-checkout.md)): deployed by hand from a checkout whose signature is verified first, and served over https from a Caddy on a leaf from the estate's CA, with port 80 only redirecting ([`stacks/wiki/README.md`](../stacks/wiki/README.md#tls)); its database is pulled to `prometheus` nightly as a `pg_dump` (`make backup-wiki`, [ADR-0065](adr/0065-pull-the-wikis-database-to-prometheus-as-a-dump.md)); Alloy agent (Docker, `scripts/deploy-agent.sh`); the off-host copies of the firewall export (`make backup-firewall`), of the weekly volume sets (`make backup`, [#535](https://github.com/Gerrrt/HomeLab/issues/535)) of the media tier's state pulled off `smaug` (`make backup-nas`, [ADR-0045](adr/0045-pull-jellyfins-state-from-a-snapshot-over-ssh.md)), and of `trinity`'s nightly sensitive-tier volume sets and Immich's library ([ADR-0064](adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md)). The estate's host for small off-host jobs โ€” [ADR-0015](adr/0015-give-oracle-the-off-host-jobs.md) | -| `trinity` (10.0.99.40) | ๐Ÿ”ด 99 | [`stacks/sensitive`](../stacks/sensitive) | ADR-0008's sensitive tier on the ProDesk 600 G4 of [ADR-0034](adr/0034-run-the-sensitive-tier-on-the-prodesk-and-make-it-the-spare-hardware.md). **Built and deployed 2026-09-28** ([#404](https://github.com/Gerrrt/HomeLab/issues/404), [`build-the-sensitive-tier-host.md`](runbooks/build-the-sensitive-tier-host.md)): Ubuntu 26.04 with both disks LUKS-encrypted and the root unlocked by the TPM ([ADR-0054](adr/0054-encrypt-trinitys-disks-and-seal-the-root-key-to-the-tpm.md)), all twelve containers healthy, and since that day AdGuard is the one forwarder behind `morpheus`'s resolver ([ADR-0055](adr/0055-forward-to-adguard-alone.md)). Holding real data since 2026-09-28, Immich's first 615 photographs, which passed the #404 step 10 gate while most of it was open. The library is copied nightly to `oracle`, off-host and not off-estate, until [#455](https://github.com/Gerrrt/HomeLab/issues/455) ([ADR-0064](adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md)). The stack: Caddy as the published HTTPS port and step-ca issuing beneath the tier's own root rather than the estate's, which is left untouched ([#129](https://github.com/Gerrrt/HomeLab/issues/129), [#130](https://github.com/Gerrrt/HomeLab/issues/130), [ADR-0037](adr/0037-give-the-sensitive-tier-its-own-root-and-issue-beneath-it-over-acme.md)), with AdGuard Home behind Caddy and publishing 53 to the firewall's forwarder alone ([#135](https://github.com/Gerrrt/HomeLab/issues/135), [ADR-0010](adr/0010-keep-the-resolver-on-the-gateway.md)); Home Assistant ([#134](https://github.com/Gerrrt/HomeLab/issues/134)), Immich โ€” four containers behind Caddy with a memory limit on each ([#132](https://github.com/Gerrrt/HomeLab/issues/132)) โ€” Paperless-ngx with a Postgres and a Valkey of its own ([#133](https://github.com/Gerrrt/HomeLab/issues/133)) and Vaultwarden ([#131](https://github.com/Gerrrt/HomeLab/issues/131)) run beside them, with the household's page of links to them at `home.matrix.elysium` and its live numbers on read-only tokens ([#137](https://github.com/Gerrrt/HomeLab/issues/137)) โ€” Homepage until [ADR-0103](adr/0103-retire-homepage-and-serve-the-household-page-from-glance.md) made it a page of Glance's. ntfy ([#136](https://github.com/Gerrrt/HomeLab/issues/136)) is the in-house receiver for Alertmanager's three real channels, **deployed and cut over 2026-09-29** by [`verify-the-alert-path.md`](runbooks/verify-the-alert-path.md#cutting-over-to-the-in-house-ntfy), with `urgent` and `security` also sent to ntfy.sh for a phone away from home. Miniflux, a feed reader with a Postgres of its own, is the tier's first service beyond ADR-0008's nine, **deployed 2026-09-29** ([#147](https://github.com/Gerrrt/HomeLab/issues/147), [ADR-0057](adr/0057-add-miniflux-to-the-sensitive-tier-with-its-fetcher-kept-off-winterfell.md)): the one container here that reaches outward on a timer, with its fetcher refused every private address. Memos, the household's notes, is the second, decided by [ADR-0059](adr/0059-add-memos-to-the-sensitive-tier-for-notes-and-keep-documentation-in-docs.md) ([#145](https://github.com/Gerrrt/HomeLab/issues/145)) and deployed behind Caddy the same day, all sixteen containers healthy after that `make up`. Miniflux holds no real data; Memos holds the household's first real notes since 2026-10-22, ahead of ADR-0023's off-estate copy by the operator's accepted exception, with the nightly volume set on `oracle` its only copy off the host, since the household copy under [#455](https://github.com/Gerrrt/HomeLab/issues/455) does not carry `memos-data` yet. Mealie, the household's recipes at `recipes.matrix.elysium`, is the third, **deployed 2026-09-29** ([#146](https://github.com/Gerrrt/HomeLab/issues/146), [ADR-0060](adr/0060-add-mealie-to-the-sensitive-tier-as-recipes.md)), behind the same Caddy with no new rule, its URL import refused every private address. linkding, a bookmark manager, is the fourth, **deployed 2026-09-29** ([#144](https://github.com/Gerrrt/HomeLab/issues/144), [ADR-0061](adr/0061-add-linkding-to-the-sensitive-tier-behind-one-factor.md)). Actual ([#142](https://github.com/Gerrrt/HomeLab/issues/142)), the household's budget, is the fifth beyond ADR-0008's nine, **deployed 2026-09-29** ([ADR-0062](adr/0062-add-actual-to-the-sensitive-tier.md)), claimed from SOPS before its first start. It holds no real budget before #404 step 10. Stirling-PDF, the household's PDF editor at `pdf.matrix.elysium`, is the sixth, **deployed 2026-09-29** ([#143](https://github.com/Gerrrt/HomeLab/issues/143), [ADR-0063](adr/0063-add-stirling-pdf-to-the-sensitive-tier-and-keep-its-documents-in-memory.md)): its documents live on a tmpfs and never reach a disk. Glance, the operator's browser start page at `start.matrix.elysium`, is **deployed 2026-10-21** ([#1223](https://github.com/Gerrrt/HomeLab/issues/1223), [ADR-0098](adr/0098-add-glance-as-the-operators-start-page-beside-homepage.md)): the estate's alerts, probes and targets read from `prometheus` with the reader token, and feeds read from a Miniflux user of its own. Since [ADR-0100](adr/0100-grow-glance-into-a-homelab-page-and-keep-the-operators-lists-in-sops.md) it has a page per subject โ€” Home, Read, Watch, Sports & Markets, Homelab, Network & Storage and Maintenance โ€” the estate's read from `prometheus`, and the operator's own lists come from SOPS. It also serves the household's page at `home.matrix.elysium` ([ADR-0103](adr/0103-retire-homepage-and-serve-the-household-page-from-glance.md)), which took over from Homepage. The office wall page, static files under `wall/` that Caddy serves at `wall.matrix.elysium` with eight fixed Prometheus questions and ten Home Assistant entities behind it (one of them the calendar, gathered by a package), is **deployed 2026-11-17** for `heimdall`'s kiosk ([ADR-0119](adr/0119-put-the-office-wall-dashboard-on-a-pi-5-on-hicks.md)), with its host override on `morpheus` and a blackbox probe, `wall`. Mosquitto and ring-mqtt bring the Ring Alarm into Home Assistant, the broker on an internal network that only those two join, **deployed 2026-10-22** ([ADR-0104](adr/0104-bring-the-ring-alarm-into-home-assistant-through-ring-mqtt.md)). Alloy agent (Docker, `scripts/deploy-agent.sh`), pushing to `prometheus` like `oracle`'s | +| `trinity` (10.0.99.40) | ๐Ÿ”ด 99 | [`stacks/sensitive`](../stacks/sensitive) | ADR-0008's sensitive tier on the ProDesk 600 G4 of [ADR-0034](adr/0034-run-the-sensitive-tier-on-the-prodesk-and-make-it-the-spare-hardware.md). **Built and deployed 2026-09-28** ([#404](https://github.com/Gerrrt/HomeLab/issues/404), [`build-the-sensitive-tier-host.md`](runbooks/build-the-sensitive-tier-host.md)): Ubuntu 26.04 with both disks LUKS-encrypted and the root unlocked by the TPM ([ADR-0054](adr/0054-encrypt-trinitys-disks-and-seal-the-root-key-to-the-tpm.md)), all twelve containers healthy, and since that day AdGuard is the one forwarder behind `morpheus`'s resolver ([ADR-0055](adr/0055-forward-to-adguard-alone.md)). Holding real data since 2026-09-28, Immich's first 615 photographs, which passed the #404 step 10 gate while most of it was open. The library is copied nightly to `oracle`, off-host and not off-estate, until [#455](https://github.com/Gerrrt/HomeLab/issues/455) ([ADR-0064](adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md)). The stack: Caddy as the published HTTPS port and step-ca issuing beneath the tier's own root rather than the estate's, which is left untouched ([#129](https://github.com/Gerrrt/HomeLab/issues/129), [#130](https://github.com/Gerrrt/HomeLab/issues/130), [ADR-0037](adr/0037-give-the-sensitive-tier-its-own-root-and-issue-beneath-it-over-acme.md)), with AdGuard Home behind Caddy and publishing 53 to the firewall's forwarder alone ([#135](https://github.com/Gerrrt/HomeLab/issues/135), [ADR-0010](adr/0010-keep-the-resolver-on-the-gateway.md)); Home Assistant ([#134](https://github.com/Gerrrt/HomeLab/issues/134)), Immich โ€” four containers behind Caddy with a memory limit on each ([#132](https://github.com/Gerrrt/HomeLab/issues/132)) โ€” Paperless-ngx with a Postgres and a Valkey of its own ([#133](https://github.com/Gerrrt/HomeLab/issues/133)) and Vaultwarden ([#131](https://github.com/Gerrrt/HomeLab/issues/131)) run beside them, with the household's page of links to them at `home.matrix.elysium` and its live numbers on read-only tokens ([#137](https://github.com/Gerrrt/HomeLab/issues/137)) โ€” Homepage until [ADR-0103](adr/0103-retire-homepage-and-serve-the-household-page-from-glance.md) made it a page of Glance's. ntfy ([#136](https://github.com/Gerrrt/HomeLab/issues/136)) is the in-house receiver for Alertmanager's three real channels, **deployed and cut over 2026-09-29** by [`verify-the-alert-path.md`](runbooks/verify-the-alert-path.md#cutting-over-to-the-in-house-ntfy), with `urgent` and `security` also sent to ntfy.sh for a phone away from home. Miniflux, a feed reader with a Postgres of its own, is the tier's first service beyond ADR-0008's nine, **deployed 2026-09-29** ([#147](https://github.com/Gerrrt/HomeLab/issues/147), [ADR-0057](adr/0057-add-miniflux-to-the-sensitive-tier-with-its-fetcher-kept-off-winterfell.md)): the one container here that reaches outward on a timer, with its fetcher refused every private address. Memos, the household's notes, is the second, decided by [ADR-0059](adr/0059-add-memos-to-the-sensitive-tier-for-notes-and-keep-documentation-in-docs.md) ([#145](https://github.com/Gerrrt/HomeLab/issues/145)) and deployed behind Caddy the same day, all sixteen containers healthy after that `make up`. Miniflux holds no real data; Memos holds the household's first real notes since 2026-10-22, ahead of ADR-0023's off-estate copy by the operator's accepted exception, with the nightly volume set on `oracle` its only copy off the host, since the household copy under [#455](https://github.com/Gerrrt/HomeLab/issues/455) does not carry `memos-data` yet. Mealie, the household's recipes at `recipes.matrix.elysium`, is the third, **deployed 2026-09-29** ([#146](https://github.com/Gerrrt/HomeLab/issues/146), [ADR-0060](adr/0060-add-mealie-to-the-sensitive-tier-as-recipes.md)), behind the same Caddy with no new rule, its URL import refused every private address. linkding, a bookmark manager, is the fourth, **deployed 2026-09-29** ([#144](https://github.com/Gerrrt/HomeLab/issues/144), [ADR-0061](adr/0061-add-linkding-to-the-sensitive-tier-behind-one-factor.md)). Actual ([#142](https://github.com/Gerrrt/HomeLab/issues/142)), the household's budget, is the fifth beyond ADR-0008's nine, **deployed 2026-09-29** ([ADR-0062](adr/0062-add-actual-to-the-sensitive-tier.md)), claimed from SOPS before its first start. It holds no real budget before #404 step 10. Stirling-PDF, the household's PDF editor at `pdf.matrix.elysium`, is the sixth, **deployed 2026-09-29** ([#143](https://github.com/Gerrrt/HomeLab/issues/143), [ADR-0063](adr/0063-add-stirling-pdf-to-the-sensitive-tier-and-keep-its-documents-in-memory.md)): its documents live on a tmpfs and never reach a disk. Glance, the operator's browser start page at `start.matrix.elysium`, is **deployed 2026-10-21** ([#1223](https://github.com/Gerrrt/HomeLab/issues/1223), [ADR-0098](adr/0098-add-glance-as-the-operators-start-page-beside-homepage.md)): the estate's alerts, probes and targets read from `prometheus` with the reader token, and feeds read from a Miniflux user of its own. Since [ADR-0100](adr/0100-grow-glance-into-a-homelab-page-and-keep-the-operators-lists-in-sops.md) it has a page per subject โ€” Home, Read, Watch, Sports & Markets, Homelab, Network & Storage and Maintenance โ€” the estate's read from `prometheus`, and the operator's own lists come from SOPS. It also serves the household's page at `home.matrix.elysium` ([ADR-0103](adr/0103-retire-homepage-and-serve-the-household-page-from-glance.md)), which took over from Homepage. The office wall page, static files under `wall/` that Caddy serves at `wall.matrix.elysium` with ten fixed Prometheus questions and nineteen Home Assistant entities behind it (most of them template sensors from its own `wall_*.yaml` packages), is **deployed 2026-11-17** for `heimdall`'s kiosk ([ADR-0119](adr/0119-put-the-office-wall-dashboard-on-a-pi-5-on-hicks.md)), with its host override on `morpheus` and a blackbox probe, `wall`. Mosquitto and ring-mqtt bring the Ring Alarm into Home Assistant, the broker on an internal network that only those two join, **deployed 2026-10-22** ([ADR-0104](adr/0104-bring-the-ring-alarm-into-home-assistant-through-ring-mqtt.md)). Alloy agent (Docker, `scripts/deploy-agent.sh`), pushing to `prometheus` like `oracle`'s | | `smaug` (10.0.40.30) | ๐ŸŸก 40 | [`stacks/media`](../stacks/media) | [ADR-0008](adr/0008-place-services-by-data-trust.md)'s media tier on the ThinkServer TS150 of [#413](https://github.com/Gerrrt/HomeLab/issues/413), placed and addressed by [ADR-0016](adr/0016-open-casabonita-inward-and-keep-it-terminal-outward.md) and running TrueNAS rather than Ubuntu Server by [ADR-0040](adr/0040-run-truenas-on-smaug-and-keep-the-media-stack-in-this-repository.md). **Built, pooled and deployed**: TrueNAS on its boot SSD, the static above since 2026-09-16, its inbound rules verified in position (four that day; [`network.md`](network.md#casabonita--vlan-40--media) counts them now), the mirror `erebor` since 2026-09-18 and this stack running on it since 2026-09-19 โ€” from a copy of the compose file on the pool, brought up with `docker compose` under TrueNAS's own Docker ([`build-the-nas.md`](runbooks/build-the-nas.md) ยง6). Jellyfin, publishing 8096 to the segment because the televisions reach it natively and no firewall rule is involved at all ([#138](https://github.com/Gerrrt/HomeLab/issues/138)); and Audiobookshelf on 13378, **deployed 2026-09-29**, whose clients are phones on Hicks and which therefore brought a fifth inbound rule by ADR-0050's count, the seventh to exist ([#140](https://github.com/Gerrrt/HomeLab/issues/140), [ADR-0050](adr/0050-add-audiobookshelf-to-the-media-tier-behind-a-fifth-hicks-pass.md)). And Navidrome on 4533 for music, **deployed 2026-09-30** on the same terms, whose Hicks pass was created 2026-09-22, ahead of the service and of Audiobookshelf's ([#141](https://github.com/Gerrrt/HomeLab/issues/141)). The `media` share gets a Hicks pass on `445` for workstations, used by a second SMB user, `samwise`, so the televisions' `bilbo` stays theirs; it was **created on 2026-09-23** ([#523](https://github.com/Gerrrt/HomeLab/issues/523), [ADR-0051](adr/0051-let-hicks-workstations-mount-the-media-share-as-a-user-of-their-own.md)). Scraped by `prometheus` on `9100`; it pushes nothing, and runs no Alloy โ€” the estate's first scraped host, and the reason [#256](https://github.com/Gerrrt/HomeLab/issues/256) was more than a line of YAML. That issue settled the fork TrueNAS opened in it: `node_exporter`, as a digest-pinned container in this stack rather than TrueNAS's own endpoint, so the existing `99 โ†’ 40:9100` pass, the `host-overview` dashboard and seven rules in `host.rules.yaml` all keep working unchanged. MakeMKV, the disc ripper, is in the file behind the compose profile `rip` and is **not yet deployed**: it reads this host's DVD-RW and writes only into `erebor/media/rips`, runs only while someone is ripping, and is reached from Hicks on `5800` through a pass ยง6.11 creates ([ADR-0114](adr/0114-rip-discs-on-smaug-with-makemkv-started-only-to-rip.md)). The `node` job and `prometheus/targets/node.yaml` are live, and the target with them since 2026-09-19, once the exporter answered from the pool. SMART reaches the same scrape by [ADR-0047](adr/0047-collect-smaug-smart-through-a-root-cron-and-the-textfile-collector.md): a root cron job in TrueNAS's UI runs the estate's collector and the exporter serves the file โ€” still no agent, still nothing initiating from 40 โ€” and patch state is deliberately not collected on an appliance ([#483](https://github.com/Gerrrt/HomeLab/issues/483)) | | `bahamut` (10.0.30.50) | ๐ŸŸข 30 | *(none โ€” Windows)* | Windows Server 2025 domain controller, PDC emulator and DNS for `ad.matrix.elysium` โ€” Tier 0. Static, because every member finds a DC through DNS and the DCs *are* the DNS. Built by hand 2026-09-24 to 2026-09-25 ([#414](https://github.com/Gerrrt/HomeLab/issues/414)) and promoted for `ad.matrix.elysium`. Scraped by `alexander` on `9182`; it pushes nothing, and runs no Alloy ([ADR-0029](adr/0029-size-the-lab-domain-and-separate-its-namespace-and-clock.md)) | | `leviathan` (10.0.30.51) | ๐ŸŸข 30 | *(none โ€” Windows)* | Windows Server 2025 second domain controller and DNS โ€” Tier 0. Static, for the same reason. Built by hand 2026-09-24 to 2026-09-25 ([#414](https://github.com/Gerrrt/HomeLab/issues/414)) and promoted for `ad.matrix.elysium`. Scraped by `alexander` on `9182`; it pushes nothing, and runs no Alloy ([ADR-0029](adr/0029-size-the-lab-domain-and-separate-its-namespace-and-clock.md)) | diff --git a/docs/changelog.md b/docs/changelog.md index 63e93d15..6bdccdd0 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -17,6 +17,28 @@ roadmap as it read that day, and the *Done* entries keep the shape they had there. `check_docs.py` does not check this file, for the reason its module docstring gives: it is a record, not a claim about now. +## 2026-11-19 + +- **The wall shows what is playing, and how the backups stand.** The fourth + of the wall's five steps. + - `wall_media.yaml` makes `sensor.wall_media`: the title, artist and app of + the first playing media player labelled `wall_media`. It is a context + card, *Now playing*, after the to-do list and before the Hebrew word. No + player is labelled yet, so it stays hidden. + - Under "All quiet", the Alerts card now gives two lines from Prometheus + in place of "Nothing is firing.". The first is the backups, the restore + test and the off-site copy, each by its most overdue job against the + allowance `install-timers.sh` gives it (`/api/q/backups`). The second + is the security updates and reboots waiting (`/api/q/patches`). Both + read series that already exist. + - SSH failures and the IDS's findings are left out. They are Loki rules + whose alerts go to Alertmanager, not to Prometheus's `ALERTS`, so the + wall has no query that can read them. The same is true of every Loki + alert: the wall's Alerts card shows Prometheus's alerts only. + + I previewed both at 1920x1080 against stubbed answers; neither has run + against the real Prometheus or Home Assistant. + ## 2026-11-18 - **The wall's context card gets its sources.** The third of the wall's diff --git a/docs/security.md b/docs/security.md index d2405db0..6b992646 100644 --- a/docs/security.md +++ b/docs/security.md @@ -1134,24 +1134,27 @@ from Home Assistant with *not enough permissions*. that difference is accepted. It holds two credentials: the reader token, which can only query, and a Fever key that can only mark items read for a Miniflux user that follows public feeds. -- **The wall page answers eight fixed questions** +- **The wall page answers ten fixed questions** ([ADR-0119](adr/0119-put-the-office-wall-dashboard-on-a-pi-5-on-hicks.md)): `wall.matrix.elysium` on `trinity`'s Caddy. Each `/api/q/NAME` is one PromQL query written in the Caddyfile, sent with the reader token, which Caddy adds. The caller picks a name, never a query, and its own query string is discarded. Only GET and HEAD are served, because Prometheus would take a POST body's `query=` over the URL's. Like Glance it has no login, so - anything that reaches `trinity:443` can read those eight answers: the + anything that reaches `trinity:443` can read those ten answers: the 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, and the page and the Pi hold no credential. - **Its household half reads eighteen Home Assistant entities the same way.** + the UPS, `heimdall`'s temperature, when each backup, restore test and + off-site copy last succeeded, and how many security updates and reboots + each host is waiting for. That is less than Glance's Homelab and + Maintenance pages already show, and the page and the Pi hold no credential. + **Its household half reads nineteen Home Assistant entities the same way.** Each `/api/ha/NAME` is one `GET /api/states/` written in the Caddyfile: the weather, today's forecast, the alarm's mode, four door contacts, two window contacts, the office lights, the thermostat, the Litter-Robot's summary, the next drive, the Shabbat times, the open to-do items, the next trash pickup, the packages to collect by their own labels, - and `sensor.wall_today`, + what the labelled players are playing (title, artist and app, never the + player's name or room), and `sensor.wall_today`, which holds the next seven days' calendar events. Caddy adds the token of HA's non-admin `wall` user. Home Assistant has no read-only role, so that token could call services, the alarm's included. It is read-only only because it lives in diff --git a/stacks/sensitive/Caddyfile b/stacks/sensitive/Caddyfile index 3247283b..9659dba8 100644 --- a/stacks/sensitive/Caddyfile +++ b/stacks/sensitive/Caddyfile @@ -390,6 +390,22 @@ wall.matrix.elysium { import wall_prometheus } + # The backups' proofs for the quiet Alerts card: when each backup, restore + # test and off-site copy last succeeded, its allowance and its last exit + # (scripts/run-scheduled.sh, scripts/install-timers.sh). + # {__name__=~"homelab_job_last_success_timestamp_seconds|homelab_job_max_age_seconds|homelab_job_last_exit_code",homelab_job=~"backup-.*|verify-backups.*|offsite-copy"} + handle /api/q/backups { + rewrite * /api/v1/query?query=%7B__name__%3D~%22homelab_job_last_success_timestamp_seconds%7Chomelab_job_max_age_seconds%7Chomelab_job_last_exit_code%22%2Chomelab_job%3D~%22backup-.%2A%7Cverify-backups.%2A%7Coffsite-copy%22%7D + import wall_prometheus + } + + # Security updates waiting and reboots needed, per host (rules/host.rules.yaml). + # {__name__=~"homelab_apt_security_upgrades_pending|homelab_reboot_required"} + handle /api/q/patches { + rewrite * /api/v1/query?query=%7B__name__%3D~%22homelab_apt_security_upgrades_pending%7Chomelab_reboot_required%22%7D + import wall_prometheus + } + # The header's weather: condition, temperature, humidity, wind. handle /api/ha/weather { rewrite * /api/states/weather.forecast_home? @@ -464,6 +480,7 @@ wall.matrix.elysium { # todo the open items of the lists labelled wall_todo # trash the next pickup, from three helpers # deliveries packages to go and get (17TRACK) + # media what the players labelled wall_media are playing handle /api/ha/commute { rewrite * /api/states/sensor.wall_commute? import wall_ha @@ -489,6 +506,11 @@ wall.matrix.elysium { import wall_ha } + handle /api/ha/media { + rewrite * /api/states/sensor.wall_media? + import wall_ha + } + # Today's high and low, the next rain and the next sunrise or sunset, # asked of weather.get_forecasts by # home-assistant/packages/wall_weather.yaml: since HA 2024.4 a forecast diff --git a/stacks/sensitive/README.md b/stacks/sensitive/README.md index 2b5edea8..1aa9482a 100644 --- a/stacks/sensitive/README.md +++ b/stacks/sensitive/README.md @@ -771,7 +771,12 @@ container of its own: Caddy serves `wall/` as static files. Pi's DejaVu. - **It says when it does not know.** No answer from Prometheus, or a Watchdog that is not firing, is shown in red as exactly that, never as - "All quiet". A host that stops reporting reads *no data*. The status bar + "All quiet". Under a real "All quiet", two lines say how the lab stands: + the backups, the restore test and the off-site copy, each by its most + overdue job against its own allowance (`/api/q/backups`), and the security + updates and reboots waiting (`/api/q/patches`). Overdue, failed, never + succeeded or waiting is amber. What no host reports is left out rather + than shown as none, and with neither line, "Nothing is firing." stays. A host that stops reporting reads *no data*. The status bar gives each source's age and turns amber at two and a half minutes. - **The household half comes from Home Assistant, the same way.** Each `/api/ha/NAME` rewrites to `GET /api/states/`. The rewrite ends @@ -810,7 +815,8 @@ container of its own: Caddy serves `wall/` as static files. (`/api/ha/commute`); Shabbat or Yom Tov, from six hours before candle lighting to havdalah (`/api/ha/shabbat`); the bins, from 16:00 the evening before pickup to noon on the day (`/api/ha/trash`); packages to go and - get (`/api/ha/deliveries`); the open to-do items (`/api/ha/todo`); and + get (`/api/ha/deliveries`); the open to-do items (`/api/ha/todo`); what is + playing on the players labelled `wall_media` (`/api/ha/media`); and otherwise a Hebrew word of the day from a static list in the page. The others that also apply are named on the card's last line. Each source is a `wall_*.yaml` package and stays unavailable, its card hidden, until what @@ -818,7 +824,8 @@ container of its own: Caddy serves `wall/` as static files. `Home`, region US, any destination, its polling off) and the label `wall_commute` on each calendar to route from, the Jewish Calendar integration, a to-do list labelled `wall_todo`, the trash helpers' - pickup day, and the 17TRACK integration with the household's account. The + pickup day, the 17TRACK integration with the household's account, and the + label `wall_media` on each player to show. The commute card sends the next labelled event's location to Waze. The UPS's mains or battery, charge and runtime are in its node tile, `mjolnir`. Booted on Home Assistant 2026.11.1 against its demo calendars on 2026-11-18: the diff --git a/stacks/sensitive/home-assistant/packages/README.md b/stacks/sensitive/home-assistant/packages/README.md index f055a4de..959c6993 100644 --- a/stacks/sensitive/home-assistant/packages/README.md +++ b/stacks/sensitive/home-assistant/packages/README.md @@ -32,6 +32,7 @@ and nothing else. This README is not YAML and Home Assistant ignores it. | `wall_house.yaml` | `sensor.wall_alarm`, `binary_sensor.wall_office_lights` and `sensor.wall_litter` for the office wall (ADR-0119): the house's one alarm panel's mode, and whether any light whose id contains `office` is on. Their own ids name the city and a person, so the wall reads these instead. Unavailable when nothing matches. `sensor.wall_litter` is `ok` or `attention`, with what in `needs`: the drawer at 90%, the litter under 30% or a cat's weight dropping, `litter_robot.yaml`'s thresholds | | `wall_commute.yaml` | `sensor.wall_commute` for the office wall's context card (ADR-0119): the minutes of the quickest live-traffic route from the home zone to the next timed event within three hours, on a calendar labelled `wall_commute` in the UI, whose location looks like a place (a digit or a comma, and not Teams, Zoom, Meet, Webex or a link), and when to leave, five minutes ahead. Asked of `waze_travel_time.get_travel_times` every five minutes, only while there is such an event; the Waze Travel Time integration has to be added once in the UI for the action to exist. Sends that location to Waze. `none` when there is nothing to drive to | | `wall_deliveries.yaml` | `sensor.wall_deliveries` for the office wall's context card (ADR-0119): the 17TRACK packages delivered today, ready to be picked up or undelivered, by their own labels, and how many are in transit. Asked of `seventeentrack.get_packages` every fifteen minutes. Never the tracking numbers. Unavailable until the 17TRACK integration is added | +| `wall_media.yaml` | `sensor.wall_media` for the office wall's context card (ADR-0119): `playing` or `idle`, with the title, artist or series and app of the first playing media player labelled `wall_media` in the UI. Never the player's name or room, and no album art. Unavailable while no player carries the label | | `wall_shabbat.yaml` | `sensor.wall_shabbat` for the office wall's context card (ADR-0119): the upcoming candle lighting as its state, with havdalah, the parsha, the Hebrew date and any Yom Tov's name, from the Jewish Calendar integration's entities, found by what their ids end with. Unavailable until that integration is added | | `wall_todo.yaml` | `sensor.wall_todo` for the office wall's context card (ADR-0119): the open items, title and due date, of the to-do lists labelled `wall_todo` in the UI, asked of `todo.get_items` every minute. Unavailable while no list carries the label | | `wall_trash.yaml` | `sensor.wall_trash` for the office wall's context card (ADR-0119): the next pickup date and whether recycling goes with it, from three helpers set in the UI (`input_select.trash_pickup_day`, `input_select.recycling_schedule`, `input_datetime.recycling_reference_date`). No integration; a holiday that moves a pickup is not known. Unavailable until the pickup day is set | diff --git a/stacks/sensitive/home-assistant/packages/wall_media.yaml b/stacks/sensitive/home-assistant/packages/wall_media.yaml new file mode 100644 index 00000000..4aa8a273 --- /dev/null +++ b/stacks/sensitive/home-assistant/packages/wall_media.yaml @@ -0,0 +1,36 @@ +--- +# What is playing in the house, for the office wall's context card (ADR-0119): +# the first media player labelled `wall_media` in the UI that is playing, its +# title, its artist or show, and the app. The label picks the players, a +# HomePod, the Apple TV or Spotify alike, so none is named here. +# +# What reaches the wall: the title, the artist or series and the app. Not the +# player's name or room, which can name a person, and no album art, which +# would be a fetch from outside the page. Unavailable while no player carries +# the label, which hides the card; `idle` while none of them is playing. + +template: + - sensor: + - name: Wall media + unique_id: wall_media + default_entity_id: sensor.wall_media + icon: mdi:music + availability: >- + {{ label_entities('wall_media') | select('match', 'media_player\.') | list | count > 0 }} + state: >- + {% set p = label_entities('wall_media') | select('match', 'media_player\.') + | sort | select('is_state', 'playing') | first | default('') %} + {{ 'playing' if p else 'idle' }} + attributes: + title: >- + {% set p = label_entities('wall_media') | select('match', 'media_player\.') + | sort | select('is_state', 'playing') | first | default('') %} + {{ ((state_attr(p, 'media_title') or '') if p else '')[:80] }} + artist: >- + {% set p = label_entities('wall_media') | select('match', 'media_player\.') + | sort | select('is_state', 'playing') | first | default('') %} + {{ ((state_attr(p, 'media_artist') or state_attr(p, 'media_series_title') or '') if p else '')[:60] }} + app: >- + {% set p = label_entities('wall_media') | select('match', 'media_player\.') + | sort | select('is_state', 'playing') | first | default('') %} + {{ ((state_attr(p, 'app_name') or '') if p else '')[:30] }} diff --git a/stacks/sensitive/wall/wall.css b/stacks/sensitive/wall/wall.css index eb3086dd..86f586cb 100644 --- a/stacks/sensitive/wall/wall.css +++ b/stacks/sensitive/wall/wall.css @@ -134,6 +134,9 @@ html, body { .alerts-body { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: hidden; } .quiet { font: 600 56px/1.15 var(--sans); color: var(--fg-dim); margin-top: 20px; } .quiet small { display: block; font: 400 28px/1.4 var(--sans); color: var(--mute); margin-top: 12px; } +.quiet small.lab { font-size: 24px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.quiet small.lab:first-of-type { margin-top: 14px; } +.quiet .lab .warn { color: var(--yellow); } .al { display: flex; gap: 16px; align-items: stretch; } .al .sev { width: 8px; border-radius: 4px; flex: none; background: var(--blue); } .al.warning .sev { background: var(--yellow); } @@ -245,6 +248,7 @@ html, body { .word-sub { font: 400 28px/1.4 var(--sans); color: var(--fg-dim); margin-top: 10px; } .word-sub b { font-weight: 600; color: var(--fg); } .ctx-hero { font: 600 56px/1.15 var(--sans); color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.ctx-hero.media { font-size: 44px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .ctx-hero.warn { color: var(--yellow); } .ctx-hero.alert { color: var(--red); } .ctx-sub { font: 400 28px/1.35 var(--sans); color: var(--fg-dim); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } diff --git a/stacks/sensitive/wall/wall.js b/stacks/sensitive/wall/wall.js index fcfd3e2c..4d68c70d 100644 --- a/stacks/sensitive/wall/wall.js +++ b/stacks/sensitive/wall/wall.js @@ -34,7 +34,10 @@ { name: "mjolnir", src: "snmp", role: "UPS" }, ]; - const QUESTIONS = ["alerts", "cpu", "snmp", "wan", "wan_hour", "rtt", "ups", "pi_temp"]; + // "backups" and "patches" are the quiet Alerts card's two lines: the + // backups' proofs, and security updates and reboots waiting (renderLab). + const QUESTIONS = ["alerts", "cpu", "snmp", "wan", "wan_hour", "rtt", "ups", "pi_temp", + "backups", "patches"]; // Home Assistant entities, by the names the Caddyfile gives them. const DOORS = [ ["front_door", "Front"], ["garage_door", "Garage"], @@ -50,8 +53,9 @@ // "today" is sensor.wall_today: the calendars' events for the next seven // days, gathered by home-assistant/packages/wall_calendar.yaml. // The context card's sources (wall_commute, wall_shabbat, wall_todo, - // wall_trash, wall_deliveries), each unavailable until it is set up. - const CARDS = ["commute", "shabbat", "todo", "trash", "deliveries"]; + // wall_trash, wall_deliveries, wall_media), each unavailable until it is + // set up. + const CARDS = ["commute", "shabbat", "todo", "trash", "deliveries", "media"]; const HA = [...HOUSE, "today", ...CARDS]; const states = {}; // HA name -> the entity's state object const answers = {}; // name -> data.result of the last good answer @@ -199,7 +203,11 @@ verdict.dataset.state = "ok"; text.textContent = "All quiet"; const q = el("div", "quiet", "All quiet"); - q.append(el("small", null, "Nothing is firing.")); + // With nothing firing, the space under it says how the backups and + // patches stand. Without an answer for them, it says what it always did. + const lab = labLines(); + if (lab.length) for (const line of lab) q.append(line); + else q.append(el("small", null, "Nothing is firing.")); body.append(q); return; } @@ -224,6 +232,85 @@ fitList(body, "al", Math.max(0, faults.length - SHOWN)); } + // ---------- lab depth: backups and patches, under "All quiet" ---------- + // An age in words, short: "40 min", "5 h", "12 d". + const ago = (s) => (s < 5400 ? `${Math.max(1, Math.round(s / 60))} min` + : s < 172800 ? `${Math.round(s / 3600)} h` : `${Math.round(s / 86400)} d`); + function labLines() { + const lines = []; + const part = (line, text, warn) => { + if (line.childElementCount) line.append(el("span", "sep", " ยท ")); + line.append(el("span", warn ? "warn" : null, text)); + }; + if (fresh("backups")) { + // One entry per job: its last success, allowance and last exit. + const jobs = new Map(); + for (const r of answers.backups || []) { + const j = jobs.get(r.metric.homelab_job) || {}; + j[r.metric.__name__] = Number(r.value[1]); + j.now = Number(r.value[0]); + jobs.set(r.metric.homelab_job, j); + } + // The worst of a kind. A job that has never succeeded comes first: + // run-scheduled.sh writes a success time of 0 after a first run that + // failed, and install-timers.sh declares an allowance before any run. + // Then a failed last run, then how much of its allowance each has used: + // a fortnightly backup at six days is fresher than a nightly one at two. + const worst = (test) => { + let w = null; + for (const [name, j] of jobs) { + if (!test(name)) continue; + const last = j.homelab_job_last_success_timestamp_seconds || 0; + const never = last <= 0; + const age = never ? Infinity : j.now - last; + const share = never ? Infinity : j.homelab_job_max_age_seconds ? age / j.homelab_job_max_age_seconds : 0; + const failed = (j.homelab_job_last_exit_code || 0) !== 0; + const rank = never ? 2 : failed ? 1 : 0; + if (!w || rank > w.rank || (rank === w.rank && share > w.share)) w = { age, share, failed, never, rank }; + } + return w; + }; + const line = el("small", "lab"); + for (const [label, test] of [ + ["Backups", (n) => n.startsWith("backup-")], + ["tested", (n) => n.startsWith("verify-backups")], + ["off-site", (n) => n === "offsite-copy"], + ]) { + const w = worst(test); + if (!w) continue; + const text = w.never ? `${label}: none yet` : w.failed ? `${label} failed` : `${label} ${ago(w.age)}`; + part(line, text, w.never || w.failed || w.share > 1); + } + if (line.childElementCount) lines.push(line); + } + if (fresh("patches")) { + // A fresh answer can still be empty, or carry one family and not the + // other. "None" is said only of a family some host reports; one no host + // reports is left out, and with neither the line goes. + let updates = 0; + const updating = new Set(); + const reboot = []; + const seen = new Set(); + for (const r of answers.patches || []) { + seen.add(r.metric.__name__); + const v = num(r); + if (!(v > 0)) continue; + if (r.metric.__name__ === "homelab_reboot_required") reboot.push(r.metric.instance); + else { updates += v; updating.add(r.metric.instance); } + } + const line = el("small", "lab"); + if (seen.has("homelab_apt_security_upgrades_pending")) { + part(line, updates ? `${updates} security update${updates === 1 ? "" : "s"} on ${updating.size} host${updating.size === 1 ? "" : "s"}` + : "No security updates", updates > 0); + } + if (seen.has("homelab_reboot_required")) { + part(line, reboot.length ? `reboot ${reboot.sort().join(", ")}` : "no reboots", reboot.length > 0); + } + if (line.childElementCount) lines.push(line); + } + return lines; + } + // ---------- nodes ---------- function renderNodes() { const grid = $("nodes"); @@ -326,6 +413,7 @@ ["house", HOUSE.map((n) => `ha:${n}`)], ["calendar", ["ha:today"]], ["cards", CARDS.map((n) => `ha:${n}`)], + ["lab", ["backups", "patches"]], ]; for (const [label, names] of groups) { const oldest = Math.min(...names.map((n) => lastOk[n] ?? 0)); @@ -705,6 +793,15 @@ fitList(list, "todo-item", Math.max(0, (Number(states.todo.state) || 0) - items.length)); } + // Now playing: while any player labelled wall_media is. + function mediaLive() { return haFresh("media") && states.media.state === "playing" && attrs("media").title; } + function renderMedia(box) { + const a = attrs("media"); + box.append(el("div", "ctx-hero media", String(a.title))); + sub(box, a.artist ? String(a.artist) : ""); + sub(box, a.app ? String(a.app) : ""); + } + const CONTEXT = [ { title: "Commute", short: "commute", when: commuteLive, render: renderCommute }, { title: () => (attrs("shabbat").holiday ? String(attrs("shabbat").holiday) : "Shabbat"), @@ -712,6 +809,7 @@ { title: "Trash", short: "trash", when: trashLive, render: renderTrash }, { title: "Packages", short: "packages", when: deliveriesLive, render: renderDeliveries }, { title: "To-do", short: "to-do", when: todoLive, render: renderTodo }, + { title: "Now playing", short: "playing", when: mediaLive, render: renderMedia }, { title: "Word of the day", short: "word", when: () => true, render: renderWord }, ];