From b4761453d3437088ecc74d2e14fd681bf30a5666 Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Sat, 21 Nov 2026 05:13:49 +0000 Subject: [PATCH 1/3] docs(ups): accept the shutdown sequence without a live test (ADR-0121); DNS test done The operator will not run shut-down-on-the-ups.md steps 5 and 6. ADR-0121 accepts the applied steps 0 to 4b, the roadmap's #574 entry leaves, and the runbook, hardware.md and security.md stop listing the proof as owed. The DNS failure test was run by the operator and paged; it is recorded and leaves #404's list. Co-Authored-By: Claude Opus 5.5 --- README.md | 4 +- ...e-ups-from-a-nut-server-on-the-firewall.md | 5 ++ ...-the-ups-and-bound-saruman-s-guest-stop.md | 6 +++ ...pt-the-ups-shutdown-without-a-live-test.md | 50 +++++++++++++++++++ docs/changelog.md | 10 ++++ docs/hardware.md | 10 ++-- docs/roadmap.md | 18 ------- docs/runbooks/forward-dns-to-adguard.md | 6 ++- docs/runbooks/shut-down-on-the-ups.md | 13 +++++ docs/security.md | 2 +- 10 files changed, 97 insertions(+), 27 deletions(-) create mode 100644 docs/adr/0121-accept-the-ups-shutdown-without-a-live-test.md diff --git a/README.md b/README.md index 26501b0a..30976afd 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ documents for different readers. at all. Every pinned digest is also scanned weekly for fixable HIGH and CRITICAL CVEs, and each image with findings has an open issue until a scan finds it clean. -- **Documented decisions and runbooks.** 120 ADRs covering what was chosen +- **Documented decisions and runbooks.** 121 ADRs covering what was chosen and what was rejected — including the costs accepted knowingly; 55 runbooks for the operations that are easy to get wrong at 1am, one of which is the handover page a successor reads first. Every critical alert links to @@ -236,7 +236,7 @@ inbound passes may still reach it. Data flow and the maintained Mermaid topology │ ├── architecture.md network.md hardware.md │ ├── observability.md security.md roadmap.md changelog.md │ ├── diagrams/ # the network diagram (SVG) and its predecessors -│ ├── adr/ # 120 ADRs — architecture decision records +│ ├── adr/ # 121 ADRs — architecture decision records │ ├── exercises/ # purple-team exercise records — see its README │ └── runbooks/ # 55 runbooks; successor-handover.md is the front door └── Makefile # make help diff --git a/docs/adr/0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md b/docs/adr/0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md index 4345e90b..2d1beb8f 100644 --- a/docs/adr/0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md +++ b/docs/adr/0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md @@ -6,6 +6,11 @@ power source [#413](https://github.com/Gerrrt/HomeLab/issues/413) owed `hardware.md` > [!NOTE] +> **No live test, 2026-11-21.** +> [ADR-0121](0121-accept-the-ups-shutdown-without-a-live-test.md) accepts the +> sequence as configured. The runbook's forced-shutdown proof and mains pull +> will not be run, and #574 closes on the applied steps. +> > **Renumbered to 0049 on 2026-09-21.** This landed as ADR-0048 in > [#586](https://github.com/Gerrrt/HomeLab/pull/586) and > [#588](https://github.com/Gerrrt/HomeLab/pull/588) took the same number diff --git a/docs/adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md b/docs/adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md index eb45cebd..30795f62 100644 --- a/docs/adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md +++ b/docs/adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md @@ -5,6 +5,12 @@ left open, and amends its low-battery reasoning for the guest set `Saruman` now carries +> [!NOTE] +> **No live test, 2026-11-21.** +> [ADR-0121](0121-accept-the-ups-shutdown-without-a-live-test.md) accepts the +> sequence as configured. The runbook's forced-shutdown proof and mains pull +> will not be run, and #574 closes on the applied steps. + ## Context ADR-0049's *Who shuts down* table ends with a row it could not fill: diff --git a/docs/adr/0121-accept-the-ups-shutdown-without-a-live-test.md b/docs/adr/0121-accept-the-ups-shutdown-without-a-live-test.md new file mode 100644 index 00000000..ad4f5f0a --- /dev/null +++ b/docs/adr/0121-accept-the-ups-shutdown-without-a-live-test.md @@ -0,0 +1,50 @@ +# ADR-0121: Accept the UPS shutdown sequence without a live test + +**Status:** Accepted · 2026-11 · amends +[ADR-0049](0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md) and +[ADR-0107](0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md) + +## Context + +ADR-0049 decided who halts on the UPS's signal, and ADR-0107 added `trinity` +and bounded `Saruman`'s guest stop. Every configuration step is applied: +steps 0 to 4 of +[`shut-down-on-the-ups.md`](../runbooks/shut-down-on-the-ups.md) on +2026-09-23, `Saruman`'s 3.6 and 3.7 on 2026-11-13, and step 4b, `HOSTSYNC +600` and the 16-minute low-battery duration on 2026-11-20. Each secondary +reads `OL` from `morpheus`. + +The runbook's steps 5 and 6 were left as the proof. Step 5 forces the +sequence with `upsmon -c fsd`, halting every subscribed host on purpose. +Step 6 pulls the mains to measure the pack. The operator will not run either. +A forced halt of the whole rack, and a deliberate power cut, cost more than +the certainty they would buy for a home lab, and a test that stays listed as +owed and is never run is noise. + +## Decision + +**The UPS shutdown sequence is accepted as configured, without a live test.** + +- Steps 5 and 6 of the runbook are not owed. They stay in the runbook as + a procedure anyone may run, and nothing lists them as outstanding. +- [#574](https://github.com/Gerrrt/HomeLab/issues/574) closes on the applied + configuration. +- The pack's runtime stays the card's estimate, about 47 minutes at 21 % + load. The 16-minute low-battery duration was sized from the worst-case + bound in step 3.8, not from a measurement, so it does not depend on one. + +**Unchanged:** every rule, alert and setting ADR-0049 and ADR-0107 put in +place. `UpsOnBattery`, `UpsBatteryLow` and the self-test alerts still watch +the pack. + +## Consequences + +- A fault in the sequence would first show in a real outage that outlasts + the pack. The operator accepts that. +- The UPS's outlet-group turn-off and load-shedding settings stay unread. + That is a look at the card's web page, not a test. A shed on group 1 + would cut the PDU before or during the halt, and the card's page is where + to check. +- `SmartDriveUnsafeShutdownsGrowing` still pages if a host loses power + uncleanly, so a sequence that fails in a real outage is still seen + afterwards. diff --git a/docs/changelog.md b/docs/changelog.md index 1d75941e..11b8e239 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,16 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-21 +- **The UPS shutdown sequence is accepted without a live test, and the DNS + failure test is recorded as done.** + [ADR-0121](adr/0121-accept-the-ups-shutdown-without-a-live-test.md): the + operator will not run `shut-down-on-the-ups.md` steps 5 and 6, the forced + halt with `upsmon -c fsd` and the mains pull that measures the pack. Steps 0 + to 4b are applied, #574 closes on them, and its roadmap entry leaves. + Separately, the operator confirmed that they stopped AdGuard on purpose and + `AdGuardNotAnswering` paged. The day was not written down, so the runbook's + table records it as before 2026-11-21, and the test leaves #404's list. + - **`trinity` reads SMART from its own disks.** It was the one host with a checkout and Alloy that collected none, so a failing NVMe under the password vault, or a failing photo disk, would have shown first as I/O errors. A new diff --git a/docs/hardware.md b/docs/hardware.md index bb74f677..c8e50793 100644 --- a/docs/hardware.md +++ b/docs/hardware.md @@ -54,17 +54,17 @@ UPS's model is read off the card as `upsIdentModel` and was in no document before then either. Who acts on the pack running out — and who does not — is [ADR-0049](adr/0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md), and the runtime the pack actually gives at this load is **not measured**: the -card claimed 47 minutes at 21 % load on 2026-09-20, and the one mains pull -that turns that estimate into a number is -[`shut-down-on-the-ups.md`](runbooks/shut-down-on-the-ups.md) §6. Since the +card claimed 47 minutes at 21 % load on 2026-09-20, and that estimate stands +([ADR-0121](adr/0121-accept-the-ups-shutdown-without-a-live-test.md)). Since the move, `trinity`, `gandalf` and the console are on the PDU too, and `smaug` is on it directly rather than by the long cord to the media room it had until 2026-11-06. [ADR-0107](adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md) makes `trinity` a third host that halts on the signal: the runbook's step 4b, applied on 2026-11-20. The card's low-battery duration was raised to 16 -minutes the same day, to cover `Saruman`'s bounded guest stop. Nobody has -watched the sequence run yet. `gandalf`, the console and the KVM are left to +minutes the same day, to cover `Saruman`'s bounded guest stop. The sequence +is accepted as configured, without a live test +([ADR-0121](adr/0121-accept-the-ups-shutdown-without-a-live-test.md)). `gandalf`, the console and the KVM are left to the pack by decision. Off-rack: only the eero Pro 6E units, distributed through the house. diff --git a/docs/roadmap.md b/docs/roadmap.md index c5cae056..0fc49992 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -42,21 +42,6 @@ What an entry here may contain: Closes when it is empty. -- **[#574](https://github.com/Gerrrt/HomeLab/issues/574) Shut down on the - UPS's signal.** Decided by - [ADR-0049](adr/0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md). - Steps 0–4 were built on 2026-09-23: NUT on `morpheus`, its rules, and - `Saruman` and `smaug` subscribed. The sequence is armed and not proved. - Since the rack move, - [ADR-0107](adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md) - adds `trinity` as a third subscriber and caps `Saruman`'s ordered guests at - `down=90`. `Saruman`'s half (steps 3.6 and 3.7 on `Saruman`) was applied - on 2026-11-13; `trinity`'s subscription, `HOSTSYNC 600` on `morpheus` and - step 3.8 on 2026-11-20. The gate is a rack visit. It reads the outlet - groups, proves the order - with `upsmon -c fsd`, and pulls the mains once to replace the card's - 47-minute claim with a number. - → [runbook](runbooks/shut-down-on-the-ups.md) - **[#1226](https://github.com/Gerrrt/HomeLab/issues/1226) The HomePods in Home Assistant, for control.** Decided by [ADR-0099](adr/0099-control-the-homepods-from-home-assistant-and-leave-their-audio-out.md). @@ -108,9 +93,6 @@ Closes when #404 and #132 close, and #455 has its holder. host.** **Built and deployed 2026-09-28** ([ADR-0034](adr/0034-run-the-sensitive-tier-on-the-prodesk-and-make-it-the-spare-hardware.md), → [runbook](runbooks/build-the-sensitive-tier-host.md)). What is left: - - the DNS failure test, which proves `AdGuardNotAnswering` pages. #135 - closed on 2026-09-28 without a record of it, so it is owed here - (→ [runbook](runbooks/forward-dns-to-adguard.md#4-stop-adguard-on-purpose-and-time-the-page)); - the step 10 gate: the second age recipient, the off-estate copy (#455), ADR-0022's identity-provider record and ADR-0023's *Independent* test. Until #455 exists, the originals' only copy beyond diff --git a/docs/runbooks/forward-dns-to-adguard.md b/docs/runbooks/forward-dns-to-adguard.md index 476627ac..c9865d68 100644 --- a/docs/runbooks/forward-dns-to-adguard.md +++ b/docs/runbooks/forward-dns-to-adguard.md @@ -236,7 +236,11 @@ Then step 3's leak test once more, and wait for the *resolved* notification. | Date | Stopped | Page arrived | DNS back | Resolved notice | | --- | --- | --- | --- | --- | -| *not yet run* | — | — | — | — | +| before 2026-11-21, day not written down | yes | yes | yes | — | + +The operator ran this and the `AdGuardNotAnswering` page arrived. The times +were not written down when it happened; the row above was recorded on +2026-11-21 from their account. **If AdGuard cannot be brought back** and the house needs DNS now: add `1.1.1.1` under *System → General Setup → DNS Servers* on `morpheus` and diff --git a/docs/runbooks/shut-down-on-the-ups.md b/docs/runbooks/shut-down-on-the-ups.md index c343232e..a7896222 100644 --- a/docs/runbooks/shut-down-on-the-ups.md +++ b/docs/runbooks/shut-down-on-the-ups.md @@ -64,6 +64,12 @@ follow the steps.** > > §6.5 now keeps the low-battery duration at or above the worst case plus > half again, whatever the measured run says. +> +> **Steps 5 and 6 will not be run, 2026-11-21.** +> [ADR-0121](../adr/0121-accept-the-ups-shutdown-without-a-live-test.md) +> accepts the sequence as configured. Steps 0 to 4b are applied, and #574 +> closes on them. Steps 5 to 7 stay below as a procedure, and nothing lists +> them as owed. ## What this does @@ -903,6 +909,10 @@ and `LISTEN 10.0.99.1` in place of `LISTEN 10.0.30.1`. ## Step 5 — Prove the shutdown order +**Not run, by decision** +([ADR-0121](../adr/0121-accept-the-ups-shutdown-without-a-live-test.md)). +Kept as a procedure, not as a step owed. + This halts everything. Your window must be open and you must be able to power the four hosts back on by hand. @@ -1106,6 +1116,9 @@ investigate before step 6. ## Step 6 — Measure the pack +**Not run, by decision** +([ADR-0121](../adr/0121-accept-the-ups-shutdown-without-a-live-test.md)). + Everything running, step 5 passed, every host back up. ### 6.1 Take a baseline diff --git a/docs/security.md b/docs/security.md index 6df8fc38..82763a1e 100644 --- a/docs/security.md +++ b/docs/security.md @@ -34,7 +34,7 @@ What this network is actually built to survive: | Someone with the trusted Wi-Fi key quietly joining | Kea's lease log reaches Loki; `UnknownDeviceOnTrustedSegment` fires the first time a MAC appears on VLAN 50 in seven days ([ADR-0019](adr/0019-read-device-joins-from-the-dhcp-server.md)) | | Losing visibility of a failure | 183 alert rules, 30 days of metrics and logs | | Someone on a reachable VLAN silencing an alert to hide a failure | Alertmanager binds to `127.0.0.1`; silences go through authenticated Grafana | -| Mains power loss | **The rack, yes; the monitoring path, yes — on two laptop cells that were measured for the first time on 2026-09-12.** A pack fitted to `mjolnir` on 2026-08-28 passed its self-test; the TP-Link carrying `prometheus` and `oracle` has been on UPS power since 2026-09-08 ([#110](https://github.com/Gerrrt/HomeLab/issues/110)); the laptops ride a cut out on their own batteries, which `HostBatteryHealthLow` in `host.rules.yaml` now reads — `prometheus`'s cell was replaced on 2026-09-18 and reads 101 % of design, `oracle`'s was replaced on 2026-09-29 and reads 100 %, its design figure rather than a learned one ([#531](https://github.com/Gerrrt/HomeLab/issues/531)) — and **each runtime was measured once: `prometheus`'s on 2026-09-19, about 2.5 hours from full at the stack's load, and `oracle`'s on 2026-09-29, about 5.2 hours**; since the same day the projection is recorded on every cut and pages under thirty minutes (`HostBatteryRuntimeLow`, [#532](https://github.com/Gerrrt/HomeLab/issues/532)), but neither pack reports a moving cell temperature, so this row is answered for both hosts' runtime and for neither's cell temperature — see below. **What happens when the cut outlasts the pack is armed and not proved.** Since 2026-09-23 the firewall's NUT server reads `mjolnir`, and `Saruman` and `smaug` subscribe to it on their own gateway addresses, so a real cut would now try to run the sequence [ADR-0049](adr/0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md) decides: `Saruman` and `smaug` halt first and `morpheus` last. Nobody has watched it run. Since the move into the 32U rack on 2026-11-06 the PDU also carries `trinity`, `gandalf` (off until its build) and the console, with `smaug` racked and on the PDU directly rather than by its old long cord to the media room. [ADR-0107](adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md) makes `trinity` a third subscriber and bounds `Saruman`'s guest stop. `Saruman`'s half was applied on 2026-11-13 (`down=90` on the four ordered guests, and its monitor stays logged in until they are down); `trinity`'s subscription, `HOSTSYNC 600` on `morpheus` and the card's 16-minute threshold followed on 2026-11-20, so all three subscribers would now halt before the pack empties, unwatched; `gandalf`, the console and `neo` are left to the pack by decision. The pack itself is unmeasured: about 47 minutes at 21 % load is the card's own estimate. [`shut-down-on-the-ups.md`](runbooks/shut-down-on-the-ups.md) §5 to §7 are what is left — the forced-shutdown proof and the one mains pull that measures the pack ([#574](https://github.com/Gerrrt/HomeLab/issues/574)) | +| Mains power loss | **The rack, yes; the monitoring path, yes — on two laptop cells that were measured for the first time on 2026-09-12.** A pack fitted to `mjolnir` on 2026-08-28 passed its self-test; the TP-Link carrying `prometheus` and `oracle` has been on UPS power since 2026-09-08 ([#110](https://github.com/Gerrrt/HomeLab/issues/110)); the laptops ride a cut out on their own batteries, which `HostBatteryHealthLow` in `host.rules.yaml` now reads — `prometheus`'s cell was replaced on 2026-09-18 and reads 101 % of design, `oracle`'s was replaced on 2026-09-29 and reads 100 %, its design figure rather than a learned one ([#531](https://github.com/Gerrrt/HomeLab/issues/531)) — and **each runtime was measured once: `prometheus`'s on 2026-09-19, about 2.5 hours from full at the stack's load, and `oracle`'s on 2026-09-29, about 5.2 hours**; since the same day the projection is recorded on every cut and pages under thirty minutes (`HostBatteryRuntimeLow`, [#532](https://github.com/Gerrrt/HomeLab/issues/532)), but neither pack reports a moving cell temperature, so this row is answered for both hosts' runtime and for neither's cell temperature — see below. **What happens when the cut outlasts the pack is configured and accepted without a live test.** Since 2026-09-23 the firewall's NUT server reads `mjolnir`, and `Saruman` and `smaug` subscribe to it on their own gateway addresses, so a real cut would now try to run the sequence [ADR-0049](adr/0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md) decides: `Saruman` and `smaug` halt first and `morpheus` last. Since the move into the 32U rack on 2026-11-06 the PDU also carries `trinity`, `gandalf` (off until its build) and the console, with `smaug` racked and on the PDU directly rather than by its old long cord to the media room. [ADR-0107](adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md) makes `trinity` a third subscriber and bounds `Saruman`'s guest stop. `Saruman`'s half was applied on 2026-11-13 (`down=90` on the four ordered guests, and its monitor stays logged in until they are down); `trinity`'s subscription, `HOSTSYNC 600` on `morpheus` and the card's 16-minute threshold followed on 2026-11-20, so all three subscribers would now halt before the pack empties; `gandalf`, the console and `neo` are left to the pack by decision. The pack itself is unmeasured: about 47 minutes at 21 % load is the card's own estimate. Neither the forced-shutdown proof nor a mains pull will be run ([ADR-0121](adr/0121-accept-the-ups-shutdown-without-a-live-test.md)) | | The estate being down while the person who runs it is unavailable | **Documentation, yes; data, not yet off the estate.** ADR-0011 puts the emergency tier on paper; [ADR-0023](adr/0023-keep-the-household-recovery-path-outside-the-estate.md) extends the same reasoning to the sensitive tier's data. That tier has held real photographs since 2026-09-28, and their off-estate copy is built but has no holder yet ([#455](https://github.com/Gerrrt/HomeLab/issues/455)) — see below | What it explicitly does **not** defend against: a determined attacker with From 43fcdf913a1f78b6bc9994a9ee5130f837e230d6 Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Sat, 21 Nov 2026 05:22:44 +0000 Subject: [PATCH 2/3] docs(adr): the unsafe-shutdown alert is a conditional signal, not a verdict (ADR-0121) Co-Authored-By: Claude Opus 5.5 --- .../0121-accept-the-ups-shutdown-without-a-live-test.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/adr/0121-accept-the-ups-shutdown-without-a-live-test.md b/docs/adr/0121-accept-the-ups-shutdown-without-a-live-test.md index ad4f5f0a..aba2b1bc 100644 --- a/docs/adr/0121-accept-the-ups-shutdown-without-a-live-test.md +++ b/docs/adr/0121-accept-the-ups-shutdown-without-a-live-test.md @@ -45,6 +45,9 @@ the pack. That is a look at the card's web page, not a test. A shed on group 1 would cut the PDU before or during the halt, and the card's page is where to check. -- `SmartDriveUnsafeShutdownsGrowing` still pages if a host loses power - uncleanly, so a sequence that fails in a real outage is still seen - afterwards. +- `SmartDriveUnsafeShutdownsGrowing` is a conditional power-loss signal, + not a verdict on the sequence. It also pages when the UPS cuts its output + after a clean halt, and its one-day comparison with a one-hour pending + period can miss a host that stays down for a long outage. Whether the + sequence ran and finished is in each host's shutdown log, and + `shut-down-on-the-ups.md` *If something goes wrong* says how to read it. From 65e7fe92d1b06e98b91ea7c35a8613a1659318c7 Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Sat, 21 Nov 2026 05:31:08 +0000 Subject: [PATCH 3/3] chore(backup): drop the household copy and its requirement (ADR-0122) ADR-0122 supersedes ADR-0073 and amends ADR-0023, ADR-0024 and ADR-0064: the Durable class no longer requires a copy outside the estate. The operator does not want a household holder, drive visits or a holder's proof. Removed: carry-household-copy.sh, household-recipients.sh, household.recipients, household-age.sha256, the household-copy and household-proof make targets and SENSITIVE_JOBS rows, both runbooks, HouseholdCopyStale and its tests, and check_sops_rules.py's household check. The stale-job rules, ScheduledJobNeverRan and ScheduledJobFailed skip both job names so an older homelab-jobs.prom on trinity stays quiet. Library sets are encrypted to the sensitive rule's recipients only, and paperless-documents leaves backup-volumes.sh's sentinel tables. ADR-0064's nightly copy to oracle stays and is no longer interim. The WD Elements drive is spare. #455's roadmap entry leaves. The photographs, documents and budget have no copy outside the house. Refs #455. Co-Authored-By: Claude Opus 5.5 --- .sops.yaml | 5 - Makefile | 50 +- README.md | 12 +- ...sehold-recovery-path-outside-the-estate.md | 7 + ...recipient-and-prove-each-one-separately.md | 6 + ...oracle-until-the-off-estate-copy-exists.md | 7 + ...sehold-copy-on-a-drive-the-holder-keeps.md | 17 +- docs/adr/0122-drop-the-household-copy.md | 89 +++ docs/architecture.md | 2 +- docs/changelog.md | 26 +- docs/hardware.md | 58 +- docs/observability.md | 15 +- docs/roadmap.md | 41 +- .../runbooks/build-the-sensitive-tier-host.md | 17 +- docs/runbooks/carry-the-household-copy.md | 238 ------- docs/runbooks/deploy-stack.md | 2 +- docs/runbooks/open-the-household-copy.md | 198 ------ docs/runbooks/restore-the-sensitive-tier.md | 20 +- docs/runbooks/schedule-maintenance.md | 16 +- docs/runbooks/successor-handover.md | 11 +- docs/security.md | 37 +- scripts/README.md | 3 +- scripts/backup-library.sh | 56 +- scripts/backup-offsite.sh | 3 +- scripts/backup-volumes.sh | 13 - scripts/carry-household-copy.sh | 617 ------------------ scripts/check_sops_rules.py | 55 +- scripts/household-recipients.sh | 280 -------- scripts/install-timers.sh | 23 +- scripts/medium.sh | 15 +- stacks/observability/README.md | 2 +- .../prometheus/rules/backup.rules.yaml | 76 +-- .../prometheus/tests/backup.test.yaml | 106 +-- stacks/sensitive/README.md | 66 +- stacks/sensitive/household-age.sha256 | 18 - stacks/sensitive/household.recipients | 35 - .../sensitive/homelab-backup-library.service | 8 +- .../homelab-smart-state-sensitive.service | 4 - 38 files changed, 352 insertions(+), 1902 deletions(-) create mode 100644 docs/adr/0122-drop-the-household-copy.md delete mode 100644 docs/runbooks/carry-the-household-copy.md delete mode 100644 docs/runbooks/open-the-household-copy.md delete mode 100755 scripts/carry-household-copy.sh delete mode 100755 scripts/household-recipients.sh delete mode 100644 stacks/sensitive/household-age.sha256 delete mode 100644 stacks/sensitive/household.recipients diff --git a/.sops.yaml b/.sops.yaml index 84b6c619..40f5b3c2 100644 --- a/.sops.yaml +++ b/.sops.yaml @@ -95,11 +95,6 @@ creation_rules: # second's recipient (ADR-0024, #294) was added by #835, after the tier had # held real data on one key for days. scripts/check_sops_rules.py now fails # if this file, or any whose key guards data, opens with fewer than two. - # - # The household holder's key never goes here (ADR-0073): it would open the - # tier's passwords as well as the household's copy. It goes in - # stacks/sensitive/household.recipients, and scripts/check_sops_rules.py - # fails if it ever appears in any rule. - path_regex: secrets/sensitive(\..+)?\.sops\.ya?ml$ age: >- age1cpdxl6p4synccrwaaeh308n4g8rww9tv9znv32laprnk3kdpm95satjtsw, diff --git a/Makefile b/Makefile index dd0d99f1..5086afb4 100644 --- a/Makefile +++ b/Makefile @@ -931,7 +931,7 @@ backup-library: ## On trinity: archive Immich's library off its USB disk, encryp @# backup-firewall gives for FW_KEEP; two, because every set is the whole @# library and oracle's root volume is the limit. ARGS=--prove hashes @# every original in the newest set against immich-db's checksums. - @# Off-host, NOT off-estate: ADR-0064 is the interim, #455 the answer. + @# Off-host, NOT off-house: ADR-0064, and ADR-0122 says there is no other. ./scripts/backup-library.sh $(ARGS) .PHONY: verify-backups @@ -950,9 +950,7 @@ verify-backups: ## Re-verify every retained set of every kind: volume, NAS and w @# STACK=sensitive is trinity's half, and what @# homelab-verify-backups-sensitive.timer runs (#856): the tier's volume @# sets and Immich's library sets (ADR-0064), and no NAS or wiki set, - @# which trinity never holds. Not backups/paperless-documents/ either: - @# household-copy re-makes that set on every visit and nothing else reads - @# it (#942, carry-the-household-copy.md §4). Both scripts' --verify-only also has oracle + @# which trinity never holds. Both scripts' --verify-only also has oracle @# hash every archive it holds against the MANIFEST here, so oracle's @# copies are re-verified by the same run, and nothing is decrypted there. @rc=0; \ @@ -997,50 +995,6 @@ backup-offsite: ## Copy the newest set of each kind to the offline medium and pr -- ./scripts/backup-offsite.sh "$(DEST)"; \ fi -.PHONY: household-copy -household-copy: ## On trinity: carry the household's photographs and documents to the holder's drive (DEST=/path/to/the/drive) - @# ADR-0073: the copy ADR-0023 requires, on the drive the household holder - @# keeps at their own address. backup-offsite's shape for the same reason: - @# a deadline and no timer, recorded as household-copy only for a copy of - @# record, with HouseholdCopyStale at ninety days. Two guards before the - @# wrapper, so that neither a forgotten DEST nor a recipients file with no - @# household key is recorded as a FAILED copy: the first is a typo and the - @# second is a decision nobody has taken yet. ARGS=--rehearse writes the - @# same copy without a holder and records nothing; --list, --verify-only and - @# --prune look at or tidy the drive without resetting the deadline. - @[[ -n "$(DEST)" ]] || { \ - printf '\033[0;31merror:\033[0m DEST is required\n' >&2; \ - printf 'Mount the drive, then: make household-copy DEST=/path/to/the/drive\n' >&2; \ - printf 'See docs/runbooks/carry-the-household-copy.md\n' >&2; \ - exit 2; \ - } - @if [[ -n "$(ARGS)" ]]; then \ - ./scripts/carry-household-copy.sh "$(DEST)" $(ARGS); \ - else \ - ./scripts/household-recipients.sh --has-holder || { \ - printf '\033[0;31merror:\033[0m stacks/sensitive/household.recipients has no household key yet\n' >&2; \ - printf 'The copy of record needs the holder (ADR-0073). Rehearse instead: make household-copy DEST=$(DEST) ARGS=--rehearse\n' >&2; \ - exit 2; \ - }; \ - ./scripts/run-scheduled.sh --job household-copy --lock backups \ - -- ./scripts/carry-household-copy.sh "$(DEST)"; \ - fi - -.PHONY: household-proof -household-proof: ## On trinity: record the holder's own proof, from the code they read out (CODE=1234-5678-9012) - @# ADR-0023's second condition, made checkable: the holder opened - @# PROOF/proof.txt.age on their own device, with their own key and without - @# the operator, and read the code back. Checked unwrapped first, so a - @# misheard digit is a retry and not a FAILED household-proof; recorded - @# only on a match. Due yearly, beside ADR-0011's drill. - @[[ -n "$(CODE)" ]] || { \ - printf '\033[0;31merror:\033[0m CODE is required: the twelve digits the holder read from PROOF/proof.txt.age\n' >&2; \ - printf 'See docs/runbooks/open-the-household-copy.md\n' >&2; \ - exit 2; \ - } - @./scripts/carry-household-copy.sh --check-code "$(CODE)" - @./scripts/run-scheduled.sh --job household-proof -- ./scripts/carry-household-copy.sh --prove-code "$(CODE)" - .PHONY: restore restore: ## Restore the stack's volumes from a backup set (ARGS="--from ") @# Deliberately a separate script from `backup`. One script that both writes diff --git a/README.md b/README.md index 30976afd..485a4a2e 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ documents for different readers. can't run an agent (firewall, switch, UPS, iLO). One agent config, deployed identically everywhere. [How](docs/architecture.md#observability-data-flow) - **Dashboards and alerting as code.** 8 provisioned dashboards, 156 panels, and - 183 alert rules — 162 metric-based in Prometheus, 21 log-based in Loki — sharing + 182 alert rules — 161 metric-based in Prometheus, 21 log-based in Loki — sharing one Alertmanager routing tree. No dashboard exists only in a database. - **Secrets encrypted in-repo with SOPS + age.** Per-device credentials, decrypted at deploy time into gitignored paths, with `git log` showing which @@ -136,8 +136,8 @@ documents for different readers. at all. Every pinned digest is also scanned weekly for fixable HIGH and CRITICAL CVEs, and each image with findings has an open issue until a scan finds it clean. -- **Documented decisions and runbooks.** 121 ADRs covering what was chosen - and what was rejected — including the costs accepted knowingly; 55 +- **Documented decisions and runbooks.** 122 ADRs covering what was chosen + and what was rejected — including the costs accepted knowingly; 53 runbooks for the operations that are easy to get wrong at 1am, one of which is the handover page a successor reads first. Every critical alert links to one. @@ -207,7 +207,7 @@ inbound passes may still reach it. Data flow and the maintained Mermaid topology . ├── stacks/ │ ├── observability/ # the estate's stack on prometheus — ten services -│ │ ├── prometheus/ # config, file_sd targets, 162 alert rules +│ │ ├── prometheus/ # config, file_sd targets, 161 alert rules │ │ ├── alertmanager/ # routing and inhibition │ │ ├── loki/ # single-binary config + 21 LogQL rules │ │ ├── alloy/ # the agent config directory, shipped to every host @@ -236,9 +236,9 @@ inbound passes may still reach it. Data flow and the maintained Mermaid topology │ ├── architecture.md network.md hardware.md │ ├── observability.md security.md roadmap.md changelog.md │ ├── diagrams/ # the network diagram (SVG) and its predecessors -│ ├── adr/ # 121 ADRs — architecture decision records +│ ├── adr/ # 122 ADRs — architecture decision records │ ├── exercises/ # purple-team exercise records — see its README -│ └── runbooks/ # 55 runbooks; successor-handover.md is the front door +│ └── runbooks/ # 53 runbooks; successor-handover.md is the front door └── Makefile # make help ``` diff --git a/docs/adr/0023-keep-the-household-recovery-path-outside-the-estate.md b/docs/adr/0023-keep-the-household-recovery-path-outside-the-estate.md index 80fe03ee..650b6a19 100644 --- a/docs/adr/0023-keep-the-household-recovery-path-outside-the-estate.md +++ b/docs/adr/0023-keep-the-household-recovery-path-outside-the-estate.md @@ -3,6 +3,13 @@ **Status:** Accepted · 2026-09 > [!NOTE] +> **No copy outside the estate, 2026-11-21.** +> [ADR-0122](0122-drop-the-household-copy.md) amends this record. The +> **Durable** class no longer requires a copy outside the estate, and the +> household copy that [#455](https://github.com/Gerrrt/HomeLab/issues/455) and +> ADR-0073 built is removed. Immich, Paperless-ngx and Actual have no copy +> outside the house. The other classes are unchanged. The table is not edited. +> > **Actual is Durable, 2026-09-29.** The household's budget joins the tier > in the class of Immich and Paperless-ngx, and holds no real data before the > off-estate copy exists, for the same reason. Every client keeps a copy of diff --git a/docs/adr/0024-hold-a-second-age-recipient-and-prove-each-one-separately.md b/docs/adr/0024-hold-a-second-age-recipient-and-prove-each-one-separately.md index 609e1b1c..94191218 100644 --- a/docs/adr/0024-hold-a-second-age-recipient-and-prove-each-one-separately.md +++ b/docs/adr/0024-hold-a-second-age-recipient-and-prove-each-one-separately.md @@ -3,6 +3,12 @@ **Status:** Accepted · 2026-09 > [!NOTE] +> **No household role, 2026-11-21.** +> [ADR-0122](0122-drop-the-household-copy.md) removes +> `stacks/sensitive/household.recipients`, so the second recipient is no +> longer the household copy's fallback. Its place on the `sensitive` rule is +> unchanged. +> > **No proof deadline, 2026-11-20.** > [ADR-0120](0120-drop-the-age-key-proof-deadline.md) removes part 3's > ninety-day deadline and `SecretsKeyBackupUnproven`. Proving a copy is diff --git a/docs/adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md b/docs/adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md index 3d3b461c..66468e2a 100644 --- a/docs/adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md +++ b/docs/adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md @@ -6,6 +6,13 @@ satisfy [ADR-0023](0023-keep-the-household-recovery-path-outside-the-estate.md), and it amends nothing in it. > [!NOTE] +> **Not interim any more, 2026-11-21.** +> [ADR-0122](0122-drop-the-household-copy.md) drops the off-estate copy and +> [#455](https://github.com/Gerrrt/HomeLab/issues/455) with it. This copy to +> `oracle` is not superseded and stays as the library's copy off the host. +> New sets are encrypted to the sensitive rule's recipients only, not to the +> household's keys. +> > **The sets open with the household's keys too, 2026-10-01.** > [ADR-0073](0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md) > encrypts every library set to `stacks/sensitive/household.recipients` as diff --git a/docs/adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md b/docs/adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md index 4e37627a..d10ee217 100644 --- a/docs/adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md +++ b/docs/adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md @@ -1,10 +1,17 @@ # ADR-0073: Carry the household's copy on a drive the holder keeps -**Status:** Accepted · 2026-10 · settles the first of -[ADR-0023](0023-keep-the-household-recovery-path-outside-the-estate.md)'s two -conditions for [#455](https://github.com/Gerrrt/HomeLab/issues/455). The -second, the proof from the other person's device, is a person's to run, and -this record says how it is recorded, not that it has happened. +**Status:** Superseded · 2026-11 · by +[ADR-0122](0122-drop-the-household-copy.md) · accepted 2026-10 + +> [!NOTE] +> Wholly superseded: [ADR-0122](0122-drop-the-household-copy.md) drops the +> household copy and the requirement for it. The scripts, the recipients +> file, the jobs and `HouseholdCopyStale` described here are removed. The text +> here is left as written, per ADR-0001 and ADR-0115. +> +> As accepted, this record settled the first of +> [ADR-0023](0023-keep-the-household-recovery-path-outside-the-estate.md)'s two +> conditions for [#455](https://github.com/Gerrrt/HomeLab/issues/455). ## Context diff --git a/docs/adr/0122-drop-the-household-copy.md b/docs/adr/0122-drop-the-household-copy.md new file mode 100644 index 00000000..9b3c74c8 --- /dev/null +++ b/docs/adr/0122-drop-the-household-copy.md @@ -0,0 +1,89 @@ +# ADR-0122: Drop the household copy + +**Status:** Accepted · 2026-11 · supersedes +[ADR-0073](0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md); +amends +[ADR-0023](0023-keep-the-household-recovery-path-outside-the-estate.md), +[ADR-0024](0024-hold-a-second-age-recipient-and-prove-each-one-separately.md) +and +[ADR-0064](0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md) + +## Context + +[ADR-0023](0023-keep-the-household-recovery-path-outside-the-estate.md) +classes Immich and Paperless-ngx as **Durable**, and Actual joined them on +2026-09-29 ([ADR-0062](0062-add-actual-to-the-sensitive-tier.md)). Each was to +have an encrypted copy outside the estate, with visible staleness, opened once +from another person's device. Issue +[#455](https://github.com/Gerrrt/HomeLab/issues/455) was that copy. +[ADR-0073](0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md) +built it: a WD Elements drive kept by a household holder at their own +address, sets encrypted at the source to `stacks/sensitive/household.recipients`, +`make household-copy` every ninety days, `make household-proof` once a year, +and `HouseholdCopyStale` watching both. [ADR-0024](0024-hold-a-second-age-recipient-and-prove-each-one-separately.md)'s +second recipient was in that file as the fallback. + +No holder was ever chosen. The drive held a rehearsal and nothing else, both +deadline jobs sat in `ScheduledJobNeverRan` from the day they were declared, +and the library has been copied nightly to `oracle` under +[ADR-0064](0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md) +since 2026-09-29. + +On 2026-11-21 the operator said: "I don't want it and I want the requirement +removed." They do not want a household holder, visits to a drive at another +address, or a holder's proof. A requirement nobody intends to meet is a +standing alert and a gate in the roadmap that never clears. + +## Decision + +**The household copy is dropped, and so is the requirement for it.** + +- **ADR-0073 is superseded.** `scripts/carry-household-copy.sh`, + `scripts/household-recipients.sh`, `stacks/sensitive/household.recipients`, + `stacks/sensitive/household-age.sha256`, the `household-copy` and + `household-proof` Makefile targets and their two runbooks are deleted. +- **The jobs and the alert go.** `household-copy` and `household-proof` + leave `SENSITIVE_JOBS` in `scripts/install-timers.sh`, and + `HouseholdCopyStale` leaves `backup.rules.yaml` with its tests. + `ScheduledJobStale`, `ScheduledJobStaleCritical`, `ScheduledJobNeverRan` and + `ScheduledJobFailed` skip both names, so a `trinity` whose + `homelab-jobs.prom` predates this stays quiet until `make install-timers` + rewrites it. [ADR-0120](0120-drop-the-age-key-proof-deadline.md) did the + same for the age-key proof. +- **ADR-0023 is amended.** No copy outside the estate is required for the + **Durable** class. Immich, Paperless-ngx and Actual may be down and should + not be lost, and what stands between them and loss is the host, the + nightly sets and the copies on `oracle`. The rest of ADR-0023 stands: + Vaultwarden's **Independent** class, Home Assistant's **Fail-safe** class, + and keeping step-ca and Caddy off every household recovery step. +- **ADR-0064's copy stays, and is no longer interim.** The nightly + encrypted library set to `oracle` is the library's copy off the host. It is + not waiting for #455, and nothing supersedes it. +- **ADR-0024's second recipient loses its household role.** It was the + fallback key in `household.recipients`. That file is gone. The recipient + stays on the `sensitive` rule for ADR-0024's own reasons. +- **Library sets are encrypted to the sensitive rule's recipients only.** + `backup-library.sh` no longer adds the household file's keys. + `check_sops_rules.py` loses its household check; its other checks are + unchanged, and so is every rule in `.sops.yaml`. +- **The drive is spare.** The WD Elements bought for this is not used for + anything ([`hardware.md`](../hardware.md)). + +## Consequences + +- **The photographs, documents and budget have no copy outside the house.** + They are on `trinity` and, encrypted, on `oracle`, in the same room and on + the same power. A fire, flood or theft that takes the rack loses them. The + operator accepts that. +- **The Paperless export form has no carrier.** `paperless-documents` was an + archive name for the drive's sets alone, and it leaves + `backup-volumes.sh`'s sentinel tables. Paperless's volume sets are + unchanged. +- **`scripts/medium.sh` has one caller again**, `backup-offsite.sh`. It + keeps the arguments it was given for two, because they cost nothing. +- **The estate's offsite copy is unchanged.** + [ADR-0048](0048-carry-the-estates-backup-sets-with-the-second-recipient.md)'s + `offsite-copy` and `OffsiteCopyStale` are a separate decision about a + separate medium. +- **Bringing the copy back is a new decision**, and the deleted tooling is in + this repository's history if it is wanted. diff --git a/docs/architecture.md b/docs/architecture.md index 7a1bb9cb..c1aa1093 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. Applied on the host 2026-11-19 ([#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)). Since 2026-11-20 it is a NUT secondary of `morpheus`, on `10.0.99.1:3493`, and halts first when the UPS runs low ([ADR-0107](adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.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 twenty 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 | +| `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)). Since 2026-11-20 it is a NUT secondary of `morpheus`, on `10.0.99.1:3493`, and halts first when the UPS runs low ([ADR-0107](adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.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 ([ADR-0064](adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md)), and there is no copy outside the house by decision ([ADR-0122](adr/0122-drop-the-household-copy.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, with the nightly volume set on `oracle` its only copy off the host. 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 twenty 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 11b8e239..a62509cd 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,28 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-21 +- **The household copy is dropped, and so is the requirement for it.** + [ADR-0122](adr/0122-drop-the-household-copy.md) supersedes ADR-0073 and + amends ADR-0023, ADR-0024 and ADR-0064. The operator said: "I don't want + it and I want the requirement removed." No household holder was ever + chosen, so the copy never had a copy of record: the WD Elements drive + bought for it on 2026-09-22 held one rehearsal, written on 2026-10-01, and + `household-copy` and `household-proof` sat in `ScheduledJobNeverRan` from + the day they were declared. Removed: `carry-household-copy.sh`, + `household-recipients.sh`, `household.recipients`, `household-age.sha256`, + the two make targets, `carry-the-household-copy.md`, + `open-the-household-copy.md`, both `SENSITIVE_JOBS` rows, + `HouseholdCopyStale` and its tests, and `check_sops_rules.py`'s household + check. The stale-job rules, `ScheduledJobNeverRan` and `ScheduledJobFailed` + skip both job names, so a `trinity` whose `homelab-jobs.prom` predates this + stays quiet until `make install-timers PROFILE=sensitive` rewrites it. + Library sets are now encrypted to the sensitive rule's recipients only, and + `paperless-documents` leaves `backup-volumes.sh`'s sentinel tables. ADR-0064's + nightly copy to `oracle` stays and is no longer interim. The photographs, + documents and budget have no copy outside the house, and a loss of the house + loses them. The drive is spare. #455's roadmap entry leaves, and #404's + step 10 gate no longer waits on an off-estate copy. + - **The UPS shutdown sequence is accepted without a live test, and the DNS failure test is recorded as done.** [ADR-0121](adr/0121-accept-the-ups-shutdown-without-a-live-test.md): the @@ -4402,7 +4424,7 @@ docstring gives: it is a record, not a claim about now. verification, on purpose** ([#942](https://github.com/Gerrrt/HomeLab/issues/942)). #856 left `backups/paperless-documents/` as the one kind of set on `trinity` that is never re-read. It stays that way, and - [`carry-the-household-copy.md`](runbooks/carry-the-household-copy.md) §4 + [`carry-the-household-copy.md`](https://github.com/Gerrrt/HomeLab/blob/19f6d4c89a70d7b9ed64f35173fc0265b34e7f14/docs/runbooks/carry-the-household-copy.md) §4 says why. Each household visit exports Paperless again and prunes the old set. A restore reads the drive, not `trinity`. The documents themselves are in the volume sets that `verify-backups-sensitive` re-reads nightly. @@ -5960,7 +5982,7 @@ docstring gives: it is a record, not a claim about now. and `metadata.json`, written as the operator into `export/`. - **Not yet done.** The WD Elements has not been formatted or rehearsed on. That needs `sudo` and the drive at `trinity` - ([`carry-the-household-copy.md`](runbooks/carry-the-household-copy.md) + ([`carry-the-household-copy.md`](https://github.com/Gerrrt/HomeLab/blob/19f6d4c89a70d7b9ed64f35173fc0265b34e7f14/docs/runbooks/carry-the-household-copy.md) §1–2). A holder, and their proof, are still #455's. - **The lab's VM templates are written for Packer, and not yet built** diff --git a/docs/hardware.md b/docs/hardware.md index c8e50793..b51d1b98 100644 --- a/docs/hardware.md +++ b/docs/hardware.md @@ -473,10 +473,11 @@ the runbook rather than backed up. encrypted root, with a recovery passphrase in a second keyslot ([ADR-0054](adr/0054-encrypt-trinitys-disks-and-seal-the-root-key-to-the-tpm.md)). It reports itself as a *PS4 Game Drive*. - One consumer spinning disk with no mirror, so the off-estate copy - [ADR-0023](adr/0023-keep-the-household-recovery-path-outside-the-estate.md) - requires is what protects it — the same as would have been true of a bought - drive, which this replaces. + One consumer spinning disk with no mirror, so the nightly encrypted copy + of the library on `oracle` + ([ADR-0064](adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md)) + is what protects it. There is no copy outside the house + ([ADR-0122](adr/0122-drop-the-household-copy.md)). - Lenovo ThinkServer TS150 — Xeon E3-1225 v6 (4 cores, 3.3 GHz, Intel HD P630 with Quick Sync), 8 GB ECC, four 3.5" bays, no drives, no OS — bought 2026-09-09, **in hand since 2026-09-15**. The NAS `smaug` of @@ -1162,43 +1163,20 @@ the runbook rather than backed up. `PC4-2133P-EE1-11` off the installed module, `EE` being ECC unbuffered, and this listing naming `PC4-17000P-E` for the same thing. - WD Elements Portable 5 TB, `WDBU6Y0050BBK-WESN`[^Elements] — 2.5" USB 3.2 - Gen 1, bus-powered, no power brick — **bought 2026-09-22**, under - [#455](https://github.com/Gerrrt/HomeLab/issues/455). The drive + Gen 1, bus-powered, no power brick, shingled — **bought 2026-09-22**, + arrived 2026-09-29, **$236.70**. Bought for the household copy of the + photographs and documents that [ADR-0023](adr/0023-keep-the-household-recovery-path-outside-the-estate.md) - was waiting on: the off-estate copy of the household's photographs and - documents, kept at another address. **Not the estate's backup sets** — - those ride with the second age recipient - ([ADR-0048](adr/0048-carry-the-estates-backup-sets-with-the-second-recipient.md), - [`copy-the-backups-offsite.md`](runbooks/copy-the-backups-offsite.md)) and - this drive is not that medium. 5 TB against a 2 TB source — Immich's - originals on `trinity`'s USB disk, plus Paperless's documents — so the - capacity question does not come back. **$236.70**, against the ~$150 #455 - estimated when it was filed. - **Delayed in transit, then arrived 2026-09-29.** Amazon moved the delivery - estimate on 2026-09-22 and refunded the delivery fee. On 2026-09-26 the - delay went to Amazon customer service. It landed on 2026-09-29. - **It has no vendor encryption and that is why it qualifies**: ADR-0023 - requires a key that is not the one only the operator holds, and a drive - password is a single-holder secret behind a vendor utility, which is the - failure that ADR exists to prevent moved one shelf further away. The - encryption is the estate's own. Whose key it is and which filesystem were - settled on 2026-10-01 by - [ADR-0073](adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md): - age archives on **exFAT**, which any holder's computer reads, encrypted to - the household holder with the technical second as a fallback. The proof - from the other person's device is still - [#455](https://github.com/Gerrrt/HomeLab/issues/455)'s. Three things the fit - checks rather than assumes: it ships formatted for Windows (NTFS, - `Elements`); its cable is USB 3.0 Micro-B at the drive end, so **the cable - travels with the drive** or the drive is a brick at the other address; and - a 5 TB 2.5" drive of this class is shingled, which is fine for an archive - written in one pass and not fine as a live target. - **Formatted and rehearsed on 2026-10-01**, on `trinity`. It reads as - `WDC WD50NDZW-11BCSS0`, serial `WD-WXD2D3684F6U`, 4.5 TiB. It now holds one - GPT partition, exFAT, labelled `HOUSEHOLD`. It does not report as removable - media, so the carry's warning about that is expected on every visit. The - first rehearsal wrote 1.7 GB. It holds a rehearsal, not the household's - copy, until there is a holder. + required and + [ADR-0073](adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md) + built. It reads as `WDC WD50NDZW-11BCSS0`, 4.5 TiB, one GPT partition, + exFAT, labelled `HOUSEHOLD`, and held only a rehearsal. **No longer used + for this, and spare.** + [ADR-0122](adr/0122-drop-the-household-copy.md) dropped the household copy + on 2026-11-21. It is not the estate's offsite medium either: that is the + second age recipient's + ([ADR-0048](adr/0048-carry-the-estates-backup-sets-with-the-second-recipient.md)). + Its cable is USB 3.0 Micro-B at the drive end, and stays with it. - ViewSonic N1700W LCD, used as a rack console via the KVM - RJ45 Cat6 in-line couplers[^Couplers] - Cat6 patch cables[^Patchcables] diff --git a/docs/observability.md b/docs/observability.md index 1290600b..7f227af1 100644 --- a/docs/observability.md +++ b/docs/observability.md @@ -352,7 +352,7 @@ separates a quiet stream from a stopped one. ## Alerting -183 rules in total: 162 metric-based in `prometheus/rules/`, and 21 log-based in +182 rules in total: 161 metric-based in `prometheus/rules/`, and 21 log-based in `loki/rules/`. ### Log-based (Loki ruler) @@ -513,7 +513,7 @@ argument and for what to do when it exits 1. ### Metric-based (Prometheus) -162 rules across twelve files in `prometheus/rules/`: +161 rules across twelve files in `prometheus/rules/`: | File | Covers | | --- | --- | @@ -525,7 +525,7 @@ argument and for what to do when it exits 1. | `watchdog.rules.yaml` | One rule that always fires, so that its absence is detectable | | `blackbox.rules.yaml` | Whether an endpoint can actually be reached, from outside the service, and how many days its certificate has left — the sensitive tier's seven-day ACME leaves excepted, which an hours pair watches for a stalled renewal instead — `TlsAcmeRenewalLate` at 48h, `TlsAcmeRenewalStalled` at 36h ([#426](https://github.com/Gerrrt/HomeLab/issues/426)) — Grafana and the wiki verified against the lab CA ([#847](https://github.com/Gerrrt/HomeLab/issues/847)), the APC card's self-signed one read but not trusted, Prometheus, Loki and Alertmanager over plain http (the switch UI's probes were removed on 2026-09-06, `targets/blackbox.yaml`), each of the household sites behind `trinity`'s Caddy, verified against the tier's root, paging as `SiteDown` after ten minutes so a `make up` restart does not ([#855](https://github.com/Gerrrt/HomeLab/issues/855)), and — the other way round — that the ingest proxy on `10.0.99.20:9090` and `:3100` still refuses a request with no token (`IngestAuthNotEnforced`, [#182](https://github.com/Gerrrt/HomeLab/issues/182)). `EeroUnreachable` is a warning for an eero unit that has not answered ping for five minutes, from the `blackbox-eero` job, through one Winterfell pass in force since 2026-11-11 ([#1228](https://github.com/Gerrrt/HomeLab/issues/1228), [ADR-0112](adr/0112-probe-the-eeros-by-icmp-from-prometheus.md)). The iLO and pfSense UIs are written into `targets/blackbox.yaml` and left disabled: each needs a firewall pass from `10.0.99.20` that is a segmentation decision, not a monitoring one ([#91](https://github.com/Gerrrt/HomeLab/issues/91)). Their certificates' expiry is watched without that pass, from `host.rules.yaml` ([#857](https://github.com/Gerrrt/HomeLab/issues/857)) | | `dns.rules.yaml` | Whether the house is still filtering DNS, asked directly at AdGuard Home on port 53 rather than through pfSense. Since [ADR-0055](adr/0055-forward-to-adguard-alone.md) AdGuard is the only forwarder, so `AdGuardNotAnswering` is **critical** at five minutes: the house cannot resolve outside names. `AdGuardNotFiltering` stays a warning, because a filter that fails open is a convenience lost, not an outage. The targets in `targets/blackbox-dns.yaml` are live since 2026-09-28, against AdGuard on `trinity` ([#126](https://github.com/Gerrrt/HomeLab/issues/126), [#404](https://github.com/Gerrrt/HomeLab/issues/404)) | -| `backup.rules.yaml` | Whether the scheduled maintenance jobs are still being run at all — staleness, failure, never-ran, and the page: `ScheduledJobStaleCritical` at three of a job's own periods and never under a day, because the warning reaches only the in-house channel and a backup that stopped in week one was otherwise a notification repeating on the same network for as long as nobody acted (2026-10-14) — whether the CA key's offline copy has been proved lately ([#496](https://github.com/Gerrrt/HomeLab/issues/496)), whether the newest backup sets have been carried onto the second recipient's medium within ninety days ([ADR-0048](adr/0048-carry-the-estates-backup-sets-with-the-second-recipient.md)), and whether the household's copy has been carried to the holder's drive within ninety days and proved by the holder within a year ([ADR-0073](adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md)) | +| `backup.rules.yaml` | Whether the scheduled maintenance jobs are still being run at all — staleness, failure, never-ran, and the page: `ScheduledJobStaleCritical` at three of a job's own periods and never under a day, because the warning reaches only the in-house channel and a backup that stopped in week one was otherwise a notification repeating on the same network for as long as nobody acted (2026-10-14) — whether the CA key's offline copy has been proved lately ([#496](https://github.com/Gerrrt/HomeLab/issues/496)), and whether the newest backup sets have been carried onto the second recipient's medium within ninety days ([ADR-0048](adr/0048-carry-the-estates-backup-sets-with-the-second-recipient.md)) | | `deploy.rules.yaml` | Whether each host that pulls — `prometheus` and `trinity` ([#533](https://github.com/Gerrrt/HomeLab/issues/533)) — is running what the repository says: an uncommitted edit made on the host, a revision that did not verify, and how far behind `main` it is, and a host whose record stopped arriving. Reads the record `scripts/converge.sh` writes hourly ([#99](https://github.com/Gerrrt/HomeLab/issues/99), [ADR-0021](adr/0021-converge-on-a-timer-instead-of-deploying-over-ssh.md)). Also whether convergence had to start a stack service that something stopped — `DeployServiceRevived` — and whether one has been left stopped for two hours, held or under a backup — `DeployServicesStopped` ([ADR-0087](adr/0087-start-a-stopped-stack-service-from-the-converge-timer.md)) | | `internet.rules.yaml` | Why the internet is slow ([#914](https://github.com/Gerrrt/HomeLab/issues/914)): three scheduled speed tests in a row under 400 Mbit/s down or 100 up, the WAN held above 85% of what it can carry, frames arriving corrupted on the WAN port — `WanReceiveErrors`, the fault found the day these were written, when a cable between the XB7 and `morpheus` cut downloads to ~2 Mbit/s — and `speedtest-tracker` itself going quiet or unreachable. Also records `homelab_wan_bits_per_second` from pf's own em0 counters. Download thresholds are against the ~940 Mbit/s the 1000baseT WAN port can carry, not the plan's 2000. `speedtest-tracker` is left out of `InstanceDown`, so its outage is a warning and not a page | | `ids.rules.yaml` | Whether Suricata is running on each interface it is declared for, read from the firewall's process table over SNMP — the fast, per-interface half; `SuricataLogsStopped` in `loki/rules/security.rules.yaml` is the slow, aggregate half ([#90](https://github.com/Gerrrt/HomeLab/issues/90), [#441](https://github.com/Gerrrt/HomeLab/issues/441)) | @@ -549,7 +549,7 @@ as loaded and healthy and could not fire for any input ([#63](https://github.com `prometheus/tests/*.test.yaml` holds `promtool test rules` unit tests, which feed a rule synthetic series and assert it fires — paired with a case asserting it stays quiet, because a test that only ever expects silence would have passed -against the broken rule too. Coverage is 162 rules of 162 so far ([#843](https://github.com/Gerrrt/HomeLab/issues/843)) — all twelve +against the broken rule too. Coverage is 161 rules of 161 so far ([#843](https://github.com/Gerrrt/HomeLab/issues/843)) — all twelve in `blackbox.rules.yaml`, all three in `dns.rules.yaml`, `GatewayFilesystemCritical`, `ContainerHighMemory`, `ContainerNearMemoryLimit`, `ContainerRestartLoop`, `ContainerCpuThrottled`, the three container-state rules from @@ -988,10 +988,9 @@ that cannot be automated, because each needs a human to mount removable media: [ADR-0048](adr/0048-carry-the-estates-backup-sets-with-the-second-recipient.md) `backup-offsite` for the sets themselves, which carries the newest of each kind onto the second recipient's medium and hashes it there. `OffsiteCopyStale` nags at -ninety days instead. On `trinity`, `household-copy` -and `household-proof` are the household's equivalents -([ADR-0073](adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md)), -and `HouseholdCopyStale` nags at ninety days and at a year. Three outputs leave: `backup-firewall` copies each export +ninety days instead. `trinity` has no such job: its household copy and +`HouseholdCopyStale` went with +[ADR-0122](adr/0122-drop-the-household-copy.md). Three outputs leave: `backup-firewall` copies each export to `oracle` and fails if it cannot, so its failure alert doubles as "the config has stopped leaving this host"; since [#535](https://github.com/Gerrrt/HomeLab/issues/535) `backup-volumes` does the diff --git a/docs/roadmap.md b/docs/roadmap.md index 0fc49992..0f6121ae 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -32,7 +32,7 @@ What an entry here may contain: 1. [**Nothing blocks these**](https://github.com/Gerrrt/HomeLab/milestone/1) — first because nothing gates them; most wait on an upstream release. 2. [**trinity**](https://github.com/Gerrrt/HomeLab/milestone/2) — the host - is built and serving; what is left is its gates, and the off-estate copy. + is built and serving; what is left is its gates. 3. [**exercises**](https://github.com/Gerrrt/HomeLab/milestone/5) — the pipeline is built; what is left is using it, one exercise per weakness. 4. [**last**](https://github.com/Gerrrt/HomeLab/milestone/6) — gated on the @@ -87,47 +87,22 @@ The milestone has no order between its issues. ## trinity -Closes when #404 and #132 close, and #455 has its holder. +Closes when #404 and #132 close. - **[#404](https://github.com/Gerrrt/HomeLab/issues/404) Build the tier's host.** **Built and deployed 2026-09-28** ([ADR-0034](adr/0034-run-the-sensitive-tier-on-the-prodesk-and-make-it-the-spare-hardware.md), → [runbook](runbooks/build-the-sensitive-tier-host.md)). What is left: - - the step 10 gate: the second age recipient, the off-estate copy - (#455), ADR-0022's identity-provider record and ADR-0023's - *Independent* test. Until #455 exists, the originals' only copy beyond - the USB disk is the nightly one to `oracle`, in the same room + - the step 10 gate: the second age recipient, ADR-0022's + identity-provider record and ADR-0023's *Independent* test. There is no + off-estate copy to wait for: + [ADR-0122](adr/0122-drop-the-household-copy.md) dropped it, and the + originals' only copy beyond the USB disk is the nightly one to `oracle`, + in the same room ([ADR-0064](adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md)). - **[#132](https://github.com/Gerrrt/HomeLab/issues/132) Immich**, the one of ADR-0008's nine still open; the issue says what is left. Its restore is rehearsed (→ [runbook](runbooks/restore-the-sensitive-tier.md#restore-immich)). -- **[#455](https://github.com/Gerrrt/HomeLab/issues/455) The off-estate copy.** - **The drive is here.** It was bought 2026-09-22 and arrived 2026-09-29 - ([`hardware.md`](hardware.md)). **The key is decided**: on 2026-10-01 - [ADR-0073](adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md) - settled the first of - [ADR-0023](adr/0023-keep-the-household-recovery-path-outside-the-estate.md)'s - two conditions. The copy is encrypted to the household holder's key, with - [ADR-0024](adr/0024-hold-a-second-age-recipient-and-prove-each-one-separately.md)'s - second recipient as a fallback. The keys are kept in - `stacks/sensitive/household.recipients` and not in a sops rule. The drive - holds age archives on exFAT. **The copy is built**: `make household-copy` - carries it, `HouseholdCopyStale` watches it, and the holder's page is - [`open-the-household-copy.md`](runbooks/open-the-household-copy.md). - The drive was formatted and rehearsed on 2026-10-01. - **What is left is a person**: choosing the - holder, and the holder opening the copy once **from their own device, - without the operator present**. Both were meant to come before the tier - held real data, and they did not. - [ADR-0022](adr/0022-expire-the-sso-deferral-when-the-tier-holds-real-data.md)'s - first trigger, the first real photo, fired on 2026-09-28. Until this lands, - [ADR-0064](adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md)'s - nightly copy to `oracle` stands in for the library, off-host and not - off-estate. When this lands, it supersedes ADR-0064. **It does not carry - Memos yet.** `make household-copy` writes Immich's library and a - Paperless export; `memos-data`, which holds real notes since 2026-10-22, - has only the nightly volume set on `oracle`. Adding it to the copy is - part of this, and Memos' *Durable* row is not met before it is. ## exercises diff --git a/docs/runbooks/build-the-sensitive-tier-host.md b/docs/runbooks/build-the-sensitive-tier-host.md index 1a67fdcf..be0389a2 100644 --- a/docs/runbooks/build-the-sensitive-tier-host.md +++ b/docs/runbooks/build-the-sensitive-tier-host.md @@ -707,11 +707,13 @@ pass SMART through is left out with a warning in ## 13. Before the first real photo, document or vault item -These five are the gate on the data, not on the containers, and each is +These four are the gate on the data, not on the containers, and each is written in a document that already exists. The gate was passed with most of it open: Immich's first real photographs arrived on 2026-09-28, and the stack -README's warning records it. Items 1 and 4 are done, and item 3 has an interim -stand-in, ADR-0064's copy to `oracle`, which does not close it. ADR-0022's +README's warning records it. Items 1 and 3 are done. There was a fifth, the +off-estate copy, and +[ADR-0122](../adr/0122-drop-the-household-copy.md) dropped it: ADR-0064's +copy to `oracle` is the library's only copy off the host. ADR-0022's TOTP floor is met: Home Assistant's owner since 2026-09-28, Stirling-PDF's admin since 2026-09-29, and Vaultwarden and Paperless-ngx by 2026-10-02. @@ -724,15 +726,10 @@ admin since 2026-09-29, and Vaultwarden and Paperless-ngx by 2026-10-02. Run `make secrets-add-recipient STACK=sensitive PUBKEY=age1…`, then one more `make backup STACK=sensitive`, so a set exists that the second key opens. -3. **The off-estate copy** - ([ADR-0023](../adr/0023-keep-the-household-recovery-path-outside-the-estate.md), - [ADR-0048](../adr/0048-carry-the-estates-backup-sets-with-the-second-recipient.md), - [`copy-the-backups-offsite.md`](copy-the-backups-offsite.md)). This covers - the library disk as well as the volume sets. -4. **ADR-0022's decision recorded.** Either an identity provider, or the +3. **ADR-0022's decision recorded.** Either an identity provider, or the deferral re-accepted with reasons. Done on 2026-10-02: re-accepted, by [ADR-0075](../adr/0075-re-accept-the-sso-deferral-once-the-tier-holds-real-data.md). -5. **ADR-0023's *Independent* test.** The household's own credentials open +4. **ADR-0023's *Independent* test.** The household's own credentials open from the other person's device, without the operator present. ## 14. Write it down diff --git a/docs/runbooks/carry-the-household-copy.md b/docs/runbooks/carry-the-household-copy.md deleted file mode 100644 index bbe73737..00000000 --- a/docs/runbooks/carry-the-household-copy.md +++ /dev/null @@ -1,238 +0,0 @@ -# Runbook: Carry the household copy - -**Target:** the household drive, a WD Elements Portable 5 TB, mounted on -`trinity` (10.0.99.40), from the Immich library sets and a fresh Paperless-ngx -export -**Time:** an afternoon the first time, because the drive is formatted and the -whole library is written to it. About an hour every ninety days after that -**You will need:** the drive and its Micro-B cable, a shell on `trinity`, and, -for a copy of record, a `household` key in -[`stacks/sensitive/household.recipients`](../../stacks/sensitive/household.recipients) - -[ADR-0073](../adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md) -is the decision this carries out, and -[`open-the-household-copy.md`](open-the-household-copy.md) is the holder's half. -Read both before the first visit. - -## Why - -[ADR-0023](../adr/0023-keep-the-household-recovery-path-outside-the-estate.md) -classes Immich and Paperless-ngx as *Durable*. Every copy short of this one -shares the house: - -- the library's USB disk; -- `trinity`'s SSD; -- `oracle`, where - [ADR-0064](../adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md) - sends a set every night. - -One fire takes all three. This drive lives at the holder's address. Each set -on it opens with the holder's key and with ADR-0024's technical second's, and -the holder can open it on their own computer. - -**What a visit is.** `make household-copy` re-verifies everything the drive -already holds. It then carries the newest library set and a Paperless export -made on the spot, and hashes each copy. It also refreshes the age binaries and -`HOW-TO-OPEN.txt`, and leaves a proof challenge only the holder's key opens. A -successful run records `household-copy`, and `HouseholdCopyStale` fires ninety -days later. The drive is visited, never scheduled, so nothing else resets that -deadline. - -**No holder, no copy of record.** Until the recipients file has a `household` -key, `make household-copy` refuses before it runs, and `ScheduledJobNeverRan` -reports `household-copy` and `household-proof`. That is correct: there is no -copy ADR-0023 would accept yet. `ARGS=--rehearse` writes the same thing to the -drive without recording it. - -## 1. Before the first visit - -**The tools.** The drive carries `age` for every OS the holder might use, -pinned in -[`stacks/sensitive/household-age.sha256`](../../stacks/sensitive/household-age.sha256). -Download them once into `backups/household/tools/` on `trinity`: - -```bash -mkdir -p backups/household/tools && cd backups/household/tools -for a in windows-amd64.zip windows-arm64.zip darwin-arm64.tar.gz darwin-amd64.tar.gz linux-amd64.tar.gz linux-arm64.tar.gz; do - curl -fsSLO "https://github.com/FiloSottile/age/releases/download/v1.3.2/age-v1.3.2-$a" -done -cd - >/dev/null -``` - -Every run hashes each one against its pinned line, and refuses a mismatch -before it writes anything. - -**The drive.** It ships formatted for Windows. Give it one exFAT partition, -because the holder's OS is unknown and exFAT is the filesystem all three read. -Find its device with `lsblk` and be certain of it. The commands below erase the -whole disk: - -```bash -lsblk -o NAME,SIZE,MODEL,TRAN -sudo wipefs -a /dev/sdX -sudo parted -s /dev/sdX mklabel gpt mkpart HOUSEHOLD 1MiB 100% -sudo mkfs.exfat -L HOUSEHOLD /dev/sdX1 -``` - -**Mount it** as the user that runs the stack, with nothing readable by anyone -else: - -```bash -sudo mkdir -p /mnt/household -sudo mount -o uid=$(id -u),gid=$(id -g),umask=077 /dev/sdX1 /mnt/household -``` - -It is shingled. The first copy writes the whole library in one sequential -pass, which is how it should be written, and it is slow. - -## 2. Rehearse - -This writes the full copy and proves it, records nothing, and marks the drive -`REHEARSAL-NOT-THE-HOUSEHOLD-COPY.txt`: - -```bash -make household-copy DEST=/mnt/household ARGS=--rehearse -make household-copy DEST=/mnt/household ARGS=--verify-only -``` - -To rehearse the holder's side too, make a throwaway key **on another -computer**, ideally a Windows or Mac machine. Write the proof to its public -half, then follow [`open-the-household-copy.md`](open-the-household-copy.md) -§2 on that computer: - -```bash -make household-copy DEST=/mnt/household ARGS="--rehearse --proof-recipient age1..." -``` - -The rehearsal's sets open with the technical second's key and `trinity`'s, not -with the throwaway. Only `PROOF/` opens with it, which is what keeps the real -archives away from a key made for practice. - -## 3. Add the holder - -The holder makes their key on their own computer -([`open-the-household-copy.md`](open-the-household-copy.md) §1) and sends the -`age1…` line. Add it **above** the technical second, under its role: - -```text -# role: household (, generated on their own device, ) -age1... -``` - -If the holder **is** the technical second, do not add a second line. Change -the existing role comment to `# role: household-and-technical-second`, because -one person's single key is written once. - -```bash -./scripts/household-recipients.sh --check -python3 scripts/check_sops_rules.py -``` - -The first refuses a mistyped key by its checksum. If it does, ask for the -line again rather than correcting it by eye. - -Commit it. It is a public key, and it never goes in `.sops.yaml`; the check -fails if it does. The next nightly library set encrypts to it. Wait for that -set, or make one now: - -```bash -make backup-library -``` - -A library set made before the key was added cannot be opened with it. The -copy refuses such a set by name rather than carrying it. - -## 4. Copy, and prove it - -```bash -make household-copy DEST=/mnt/household -``` - -In order, and each step stops the run if it fails: - -1. Re-verify every set already on the drive, and every tool against its pin. -2. Refuse a newest library set that some household recipient cannot open. -3. Export Paperless-ngx into `stacks/sensitive/export/`, and archive it into - `backups/paperless-documents//`. The archive is encrypted and - verified like every other set. -4. Check the drive has room for the new sets before the old ones are pruned. -5. Copy each set into a `.part`, writing its MANIFEST last, then sync, rename - and hash it again. -6. Refresh `tools/` and `HOW-TO-OPEN.txt`. A challenge still waiting to be - proved stays as it is. Otherwise write a new one to `PROOF/`, encrypted to - the household key only. -7. Prune to one set of each kind, and remove dead `.part`s. - -The Paperless set in `backups/paperless-documents/` is not re-verified -nightly, unlike every other set on `trinity` -([#942](https://github.com/Gerrrt/HomeLab/issues/942)). Nothing reads it -after the visit that made it. The next visit exports Paperless again, step 3 -verifies the new set, and the old one is pruned. A restore copies the set back -from the drive, not from `trinity`. The documents themselves are in the -nightly volume sets (`paperless-media` and `paperless-db-data`), and -`verify-backups-sensitive` re-reads those every night, here and on `oracle`. -The copy on the drive is checked at every visit, by step 1 and -`ARGS=--verify-only`. - -The last line is green and names both sets. Then: - -```bash -sudo umount /mnt/household -``` - -The drive goes back to the holder's address, **with its cable**. - -## 5. The holder's proof - -Once a year, and once after the first copy of record, the holder opens -`PROOF/proof.txt.age` on their own computer without you there, and phones you -the code: - -```bash -make household-proof CODE=1234-5678-9012 -``` - -A mistyped code fails before anything is recorded, so try again. A match -records `household-proof`, which is ADR-0023's second condition. Write the date -in [`changelog.md`](../changelog.md). The first proof is also the day -ADR-0064 stops being the stand-in. Its NOTE says how to mark that. - -## The ninety-day deadline - -`HouseholdCopyStale` fires when `household-copy` is older than ninety days, or -`household-proof` older than a year. Its thresholds are the two sensitive rows -in `scripts/install-timers.sh`. Between visits the recovery point on the drive -is the last visit. The nightly copy to `oracle` covers the disk failing in the -meantime, but not the house. - -## Restoring from the drive - -The sets are the estate's standard layout. On `trinity`, or its replacement: - -```bash -cp -a /mnt/household/household/immich-library/ backups/immich-library/ -cp -a /mnt/household/household/paperless-documents/ backups/paperless-documents/ -``` - -Then follow [`restore-the-sensitive-tier.md`](restore-the-sensitive-tier.md). -Without this estate, the holder's own page restores the files themselves. -Paperless re-imports its export with `document_importer` at the same version -(3.2.1 today). - -## If something goes wrong - -- **"no household holder".** Correct until §3 is done. Rehearse instead. -- **"… is not encrypted to age1…".** The newest library set predates a - recipient. Run `make backup-library`, then copy again. -- **"differs from its MANIFEST entry".** The drive does not hold what was - written. Nothing was copied or deleted. Remove the named set from the drive - and run again; it is copied fresh. If it recurs, the drive is failing. -- **"does not match its pinned sha256".** A tool under - `backups/household/tools/` is not the pinned build. Delete it and download it - again. -- **"has … free and this visit needs …".** Prune with `ARGS=--prune`. If the - library itself no longer fits twice on 5 TB (about 2.4 TB), the drive is - outgrown, and that is a decision, not a fix. -- **"the destination is …".** It refused a path that is not the drive, such - as RAM, `/tmp` or `trinity`'s own disk. Mount the drive and point `DEST` at - it. diff --git a/docs/runbooks/deploy-stack.md b/docs/runbooks/deploy-stack.md index 618d90d4..9df5cb21 100644 --- a/docs/runbooks/deploy-stack.md +++ b/docs/runbooks/deploy-stack.md @@ -151,7 +151,7 @@ Then in the UI: 1. **Prometheus → Status → Targets.** Every job `UP`. The four `snmp` targets take up to 45 seconds on their first scrape. 2. **Prometheus → Status → Rules.** Every rule loaded, none in error. The - page lists 168: the 162 alert rules this repository counts everywhere + page lists 167: the 161 alert rules this repository counts everywhere else, plus the six recording rules: `homelab_suricata_expected_interface`, `homelab_battery_runtime_seconds`, and the two directions each of diff --git a/docs/runbooks/open-the-household-copy.md b/docs/runbooks/open-the-household-copy.md deleted file mode 100644 index fcd5c510..00000000 --- a/docs/runbooks/open-the-household-copy.md +++ /dev/null @@ -1,198 +0,0 @@ -# Runbook: Open the household copy - -**Target:** the household drive (a WD Elements, 5 TB) and **your own -computer**: Windows, a Mac or Linux -**Time:** twenty minutes the first time; ten minutes once a year after that -**You will need:** the drive and its cable, your computer, and somewhere to -keep a small file and a sheet of paper that are not the drive - -This page is for the person who keeps the household drive. You do not need to -know anything about the computers it came from. A copy of this page is on the -drive as `HOW-TO-OPEN.txt`, so you can follow it without the internet. - -Do every step yourself, on your own computer, signed in as you. Nobody else -should be there to help. The point is to show that you can open it alone, -because the day you need it, you may be alone. - -## Why - -The drive holds the household's photographs and documents. They are locked, -so a lost or stolen drive shows nobody anything. **The key is yours.** You -make it in step 1, on your own computer, and it never leaves you. Only its -public half is sent back: it can lock things and cannot open them. -[ADR-0073](../adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md) -records why it is done this way. - -**Keep the key and the drive apart.** Someone who has both has everything. Keep -the key file on your computer or in your password manager, and keep a paper -copy somewhere else in your home. Never put the key on the drive. - -## Plug the drive in - -The drive uses the cable that came with it. It has a small, flat plug at the -drive end, and the cable stays with the drive. The drive shows up as -`HOUSEHOLD`. You will see these on it: - -```text -HOW-TO-OPEN.txt this page -tools\ the program that opens it, for each kind of computer -household\immich-library\ the photographs -household\paperless-documents\ the documents -PROOF\proof.txt.age a short code, to show you opened it -``` - -## 1. Make your key (once, the first time) - -**Windows.** Open `tools` on the drive and copy `age-v1.3.2-windows-amd64.zip` -to your Documents folder. Use `age-v1.3.2-windows-arm64.zip` instead if your -computer has an ARM processor (Settings, System, About). Right-click the copy, -choose *Extract All*, and extract it to `C:\age`. Then open **Command Prompt** -(search the Start menu for `cmd`). Use Command Prompt, not PowerShell: some -versions of PowerShell damage the files this page decrypts. Type: - -```bat -C:\age\age\age-keygen.exe -o "%USERPROFILE%\household-key.txt" -``` - -**Mac.** Open `tools` on the drive and double-click -`age-v1.3.2-darwin-arm64.tar.gz`, or `age-v1.3.2-darwin-amd64.tar.gz` on an -older Intel Mac. This makes a folder called `age`. Move that folder to your -home folder. Open **Terminal** and type: - -```bash -xattr -dr com.apple.quarantine ~/age -~/age/age-keygen -o ~/household-key.txt -``` - -**Linux.** Extract `tools/age-v1.3.2-linux-amd64.tar.gz` (or `-arm64`) to your -home directory, then: - -```bash -~/age/age-keygen -o ~/household-key.txt -``` - -The command prints one line that starts `Public key: age1`. **Send that line, -and nothing else, to the person who set this up.** Text or email is fine, -because it can only lock and never open. Then: - -- Print `household-key.txt`, or copy it out by hand. Keep the paper in your - home, away from the drive. -- Keep the file itself where you keep important things, such as your - password manager. Do not delete it. - -The drive cannot open with your key until it has been written again with your -public key. They will tell you when that is done, and bring the drive back. - -## 2. Open the proof - -This is what shows the copy really is yours to open. In the same window, with -the drive plugged in (on Windows it will be a letter such as `E:`): - -**Windows:** - -```bat -C:\age\age\age.exe -d -i "%USERPROFILE%\household-key.txt" E:\PROOF\proof.txt.age -``` - -**Mac or Linux:** first say where the drive is, once per window. On a Mac it -is `/Volumes/HOUSEHOLD`. On Linux it is usually `/media//HOUSEHOLD`; `ls /media/$USER` shows it. - -On a Mac: - -```bash -D=/Volumes/HOUSEHOLD -``` - -On Linux: - -```bash -D=/media/$USER/HOUSEHOLD -``` - -Then: - -```bash -~/age/age -d -i ~/household-key.txt "$D/PROOF/proof.txt.age" -``` - -It prints a twelve-digit code. **Phone the person who set this up and read it -to them.** That is the whole proof, and it counts only if you did it yourself. - -If it says `no identity matched any of the recipients`, the drive has not been -written for your key yet. Tell them, and stop here. - -## 3. Open the documents - -Make a folder for what you open. On Windows, `C:\Restored`; on a Mac or Linux, -`~/Restored`. Then, replacing `` with the one folder name you see -under `household\paperless-documents\`: - -**Windows:** - -```bat -mkdir C:\Restored -C:\age\age\age.exe -d -i "%USERPROFILE%\household-key.txt" -o C:\Restored\documents.tar.gz E:\household\paperless-documents\\paperless-documents.tar.gz.age -tar -xzf C:\Restored\documents.tar.gz -C C:\Restored -``` - -**Mac or Linux**, with `D` set as in step 2: - -```bash -mkdir -p ~/Restored -~/age/age -d -i ~/household-key.txt "$D"/household/paperless-documents/*/paperless-documents.tar.gz.age | tar -xzf - -C ~/Restored -``` - -Open `Restored` and open one document. They are the original files, with -their original names. `manifest.json` beside them is the list Paperless-ngx -reads to import them again, and you can ignore it. - -## 4. Open a few photographs - -The photographs are one large file and can take an hour to unpack. For the -yearly check, you only need to see that they start coming out. Do the same as -step 3, with `household\immich-library\\immich-library.tar.gz.age`, -into a folder of its own, `C:\Restored\photos` or `~/Restored/photos`: - -**Windows:** - -```bat -mkdir C:\Restored\photos -C:\age\age\age.exe -d -i "%USERPROFILE%\household-key.txt" -o C:\Restored\photos.tar.gz E:\household\immich-library\\immich-library.tar.gz.age -tar -xzf C:\Restored\photos.tar.gz -C C:\Restored\photos -``` - -**Mac or Linux**, with `D` set as in step 2: - -```bash -mkdir -p ~/Restored/photos -~/age/age -d -i ~/household-key.txt "$D"/household/immich-library/*/immich-library.tar.gz.age | tar -xzf - -C ~/Restored/photos -``` - -The photographs are under `photos/library` and `photos/upload`, in folders by -person and year. Once you have seen a few, you can stop it with Ctrl+C and -delete `Restored`. For the yearly check that is enough. On the day you need -them, let it finish. - -## When it is done - -- Unplug the drive, put it back where you keep it, and keep the cable with - it. -- Delete the `Restored` folder unless you need what is in it. It is not - locked. -- Expect the person who set this up to borrow the drive about every three - months, to bring it up to date. They will not need your key to do that. - -## If something goes wrong - -- **`no identity matched any of the recipients`.** This file was not written - for your key. Either the drive has not been updated since you sent your - public key, or you are using a different key file. Do not make a new key. - Find the one you made in step 1, or the paper copy. -- **Windows: "tar is not recognized".** Your Windows is older than Windows 10 - (1803). Open the `.tar.gz` file with 7-Zip instead. -- **Mac: "cannot be opened because the developer cannot be verified".** Run - the `xattr` line in step 1 again. -- **You lost the key and the paper.** Nothing on the drive can be opened with - a new key. Tell the person who set this up. They hold a second key for - exactly this, and the drive can be written again for a new one of yours. diff --git a/docs/runbooks/restore-the-sensitive-tier.md b/docs/runbooks/restore-the-sensitive-tier.md index 56a1fd79..6ae1be04 100644 --- a/docs/runbooks/restore-the-sensitive-tier.md +++ b/docs/runbooks/restore-the-sensitive-tier.md @@ -83,10 +83,9 @@ step 9, installed with `make install-timers PROFILE=sensitive` Its outcome is `backup-sensitive` in the estate's `ScheduledJob*` alerts, so a night that fails, or a timer that stops, is a finding within two days. Every set is on `trinity` and on `oracle`. Both are in the same room and on the same -power, so neither is the off-estate copy that +power, and there is no copy outside the house: the one [ADR-0023](../adr/0023-keep-the-household-recovery-path-outside-the-estate.md) -requires. That copy is step 10, and it is one reason the vault holds nothing -real yet. +required was dropped by [ADR-0122](../adr/0122-drop-the-household-copy.md). **The key that opens it is not the only one.** A set encrypted to `trinity`'s key alone dies with `trinity`'s disk, so [ADR-0024](../adr/0024-hold-a-second-age-recipient-and-prove-each-one-separately.md)'s @@ -478,10 +477,8 @@ Everything was deleted afterwards. on a single-volume restore, not a fault. **What is still not proven** (as of 2026-09-28; the next subsection closes the -first point). Nothing came back from anywhere but `trinity`, -and there is no copy of the originals off it. That is [#455](https://github.com/Gerrrt/HomeLab/issues/455), -and until it exists the checksum pass above proves only that a copy of *this -disk* restores. The restored server was not reached through Caddy, nor by a +first point). Nothing came back from anywhere but `trinity`, so the checksum +pass above proves only that a copy of *this disk* restores. The restored server was not reached through Caddy, nor by a phone. A phone reconnecting to a restored server is the moment a wrong restore would first be noticed, and nobody has watched it. Machine learning did not run, so the face and CLIP vectors came back but nothing used them. @@ -540,12 +537,9 @@ key alone, so it proves a restore on a host that has that key. Losing `trinity` as well as the disk is recoverable only if the key has a proven copy (`make secrets-verify-backup STACK=sensitive`). Everything the 2026-09-28 rehearsal left open about phones, Caddy, machine learning and -cross-version restores is still open. And this is not off the estate. That is -still [#455](https://github.com/Gerrrt/HomeLab/issues/455). Its copy is built -([`carry-the-household-copy.md`](carry-the-household-copy.md)) and is waiting -on a holder. A restore from the household drive copies its set directories back -into `backups/immich-library/` and `backups/paperless-documents/`, and then -follows this page. +cross-version restores is still open. And this is not off the estate, nor +will any copy be: [ADR-0122](../adr/0122-drop-the-household-copy.md) dropped +the household copy, so a loss of the house loses the library. --- diff --git a/docs/runbooks/schedule-maintenance.md b/docs/runbooks/schedule-maintenance.md index 709763b9..f2ebf40e 100644 --- a/docs/runbooks/schedule-maintenance.md +++ b/docs/runbooks/schedule-maintenance.md @@ -743,8 +743,6 @@ checkout ([#404](https://github.com/Gerrrt/HomeLab/issues/404) step 9): | `converge-sensitive` | `make converge` with `STACK=sensitive` | hourly at :25 | 3 hours | | `verify-backups-sensitive` | `make verify-backups` with `STACK=sensitive` | daily 06:30 | 2 days | | `smart-state-sensitive` | `make smart-state-sensitive`, as **root** | daily 08:30 | 2 days | -| `household-copy` | **you**, `make household-copy DEST=…` | no timer | 90 days | -| `household-proof` | **you** and the holder, `make household-proof CODE=…` | no timer | 1 year | It runs daily, not weekly like the estate's backup, because it holds the password vault. Each run also copies the set to `oracle`, the same way the @@ -791,11 +789,13 @@ make install-timers PROFILE=sensitive ``` That writes a `homelab-jobs.prom` on `trinity` that declares only these -seven. `household-copy` and `household-proof` are the household's copy -([ADR-0073](../adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md), -[`carry-the-household-copy.md`](carry-the-household-copy.md)). They have no -timer, and `HouseholdCopyStale` reads them. The alert rules join on the job name alone, so a name may appear in only -one table, and `--check` enforces that. The installer primes `backup-library`, +five. Every one has a timer: `household-copy` and `household-proof` were +the two human rows until +[ADR-0122](../adr/0122-drop-the-household-copy.md) dropped the household +copy, and the stale-job rules skip both names so a `homelab-jobs.prom` +written before that stays quiet until this rewrites it. The alert rules join +on the job name alone, so a name may appear in only one table, and `--check` +enforces that. The installer primes `backup-library`, `converge-sensitive`, `verify-backups-sensitive` and `smart-state-sensitive`, which stop nothing, and not `backup-sensitive`, which stops the tier. `make check-timers` checks both profiles, and `make validate` on `trinity` fails until the backup and converge timers are installed. @@ -920,7 +920,7 @@ expected rather than a second fault. | Symptom | Cause | Fix | | --- | --- | --- | -| `ScheduledJobNeverRan` right after install | The job has a threshold declared and has never reported a result | Expected for `verify-ca-key-backup` until you first verify the CA key, for `offsite-copy` until the first visit makes the copy, and on `trinity` for `household-copy` and `household-proof` until there is a household holder and the holder has opened it. For anything else, `systemctl start homelab-.service` and read the journal | +| `ScheduledJobNeverRan` right after install | The job has a threshold declared and has never reported a result | Expected for `verify-ca-key-backup` until you first verify the CA key, and for `offsite-copy` until the first visit makes the copy. For anything else, `systemctl start homelab-.service` and read the journal | | `ScheduledJobStaleCritical` | A job has gone three of its own periods without a success — one and a half of the allowance in the `JOBS` table, which is twice the period; a weekly backup three weeks stale, a nightly one three nights, and never under a day for the hourly collectors — and the `ScheduledJobStale` warning for it has been repeating on the in-house channel unanswered | The same first look as the warning: `systemctl list-timers 'homelab-*'`, then `journalctl -u homelab-.service`. The rows below name the usual cause per job. The page holds the warning back while it is up, so a job that recovers clears both at once | | `OffsiteCopyStale` | Ninety days since the newest sets were last copied to the second recipient's medium and proved there | Mount it and run `make backup-offsite DEST=…` — [`copy-the-backups-offsite.md`](copy-the-backups-offsite.md). `--list`, `--verify-only` and `--prune` do not clear it, on purpose | | `CaKeyBackupUnproven` | No offline copy of `certificates/ca-key.pem` has been proved in ninety days — or ever, or not since the CA was re-minted, which the fingerprint label tells apart | Mount the medium and `make certs-verify-backup KEY=…` ([`back-up-the-ca-key.md`](back-up-the-ca-key.md)). After a re-mint, copy the new key there first; the old copy is refused | diff --git a/docs/runbooks/successor-handover.md b/docs/runbooks/successor-handover.md index 4732e111..8a3cd73a 100644 --- a/docs/runbooks/successor-handover.md +++ b/docs/runbooks/successor-handover.md @@ -41,10 +41,12 @@ The household's *data* recovery is a separate and newer question with its own answer: [ADR-0023](../adr/0023-keep-the-household-recovery-path-outside-the-estate.md) constrains it rather than making anything highly available — nothing the -household needs in an emergency may have the estate on its only route. None of -what it requires is built, and it falls due on ADR-0022's triggers rather than -on a date, so a successor inherits it as a written constraint and not as a -running system. +household needs in an emergency may have the estate on its only route. Its +copy outside the estate for the photographs, documents and budget was dropped +by [ADR-0122](../adr/0122-drop-the-household-copy.md): there is none, and a +loss of the house loses them. What is left of it is not built, and it falls +due on ADR-0022's triggers rather than on a date, so a successor inherits it +as a written constraint and not as a running system. --- @@ -200,7 +202,6 @@ inherits without knowing. | **The external heartbeat watcher** — a free-tier cron-monitor on somebody else's account | Whenever that account lapses | Nothing here can tell you. A watcher on this host would fail with the thing it watches, which is why it is off-host and therefore outside anything this repository can check | | **An offline copy of the age key stops working** | Whenever it happens | Nothing alerts. Checking a copy is optional and has no deadline ([ADR-0120](../adr/0120-drop-the-age-key-proof-deadline.md)); `make secrets-verify-backup KEY=…` checks one when you want to know ([`back-up-the-age-key.md`](back-up-the-age-key.md)) | | **The offsite copy of the backup sets goes stale** | 90 days after the last visit that carried them | `OffsiteCopyStale`, routed to the normal alert channel. Before the first visit it is `ScheduledJobNeverRan` naming `offsite-copy` instead, which is the honest state of a copy nobody has made ([`copy-the-backups-offsite.md`](copy-the-backups-offsite.md)) | -| **The household's copy goes stale, or its holder's proof does** | 90 days after the last visit to the household drive; a year after the holder last opened it | `HouseholdCopyStale`, naming `household-copy` or `household-proof`. Until a household holder is named in `stacks/sensitive/household.recipients` it is `ScheduledJobNeverRan` for both. The drive is the household's, at their address, and their key opens it without you ([ADR-0073](../adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md), [`carry-the-household-copy.md`](carry-the-household-copy.md)) | | **The CA key backup goes unproven** | 90 days after the last proof, and immediately after a re-mint | `CaKeyBackupUnproven`, routed to the normal alert channel. The proof is a comparison of public keys against a copy on the offline medium, keyed on the key's fingerprint so a re-minted root starts at never ([`back-up-the-ca-key.md`](back-up-the-ca-key.md)) | | **Grafana's leaf certificate** | 825 days from issue; the APC card's own certificate expires on its own clock | `TlsCertificateExpiringSoon` at 30 days, `TlsCertificateExpiryImminent` at 7 — read off the served handshake by `blackbox-exporter`, not off a file. Let it lapse and `up{job="grafana"}` goes to 0 as well | | **The sensitive tier's certificates**, once `trinity` exists | Seven days after step-ca last answered Caddy — every leaf there is renewed automatically and lives a week, so the tier stays up for as long as its CA does ([ADR-0037](../adr/0037-give-the-sensitive-tier-its-own-root-and-issue-beneath-it-over-acme.md)) | Nothing pages on it yet: the estate's expiry rules are sized for 825-day leaves and would fire permanently on seven-day ones, so the tier is deliberately outside them until [#426](https://github.com/Gerrrt/HomeLab/issues/426) lands. Until then a dead step-ca is found by a browser refusing the handshake, a week late | diff --git a/docs/security.md b/docs/security.md index 82763a1e..b4c3a288 100644 --- a/docs/security.md +++ b/docs/security.md @@ -32,10 +32,10 @@ What this network is actually built to survive: | A range target with a path out | It has none — `gandalf`'s targets sit on a bridge with no physical port, on `172.30.30.0/24`, which the firewall does not route and on which nothing has a default route at all ([ADR-0014](adr/0014-put-ifrit-on-imaginationlan-and-give-the-targets-no-route.md), [ADR-0017](adr/0017-buy-ifrit-for-iops-and-keep-the-range-disposable.md)) | | Someone on Winterfell or Hicks logging in to `trinity` | **Open until the runbook's `sshd` step is applied; no host firewall by decision.** `trinity` holds the household's data and the sensitive tier's age key, and its `sshd` answers Hicks (by [ADR-0031](adr/0031-narrow-hicks-to-a-named-list-on-winterfell-and-leave-the-lab-open.md)'s list) and every host on VLAN 99, between which pfSense never filters. [`build-the-sensitive-tier-host.md`](runbooks/build-the-sensitive-tier-host.md) §3 now makes `sshd` key-only through a drop-in that outranks cloud-init's, refuses root and X11 forwarding, and keeps `authorized_keys` to `prometheus`'s key and Hicks's. The audit of 2026-11-13 found it taking passwords, with X11 forwarding on and 17 keys imported from GitHub, and that is still the host's state: the step was written on 2026-11-20 and has not been applied. Until it is, a guessed password is root. `ufw` is installed and stays disabled, unlike `phoenix`'s ([ADR-0117](adr/0117-give-phoenix-a-key-only-sshd-and-a-default-deny-inbound-policy.md)): the other two ports `trinity` answers, `443` and `53`, are published by Docker, whose rules run ahead of `ufw`'s, so a policy would govern `22` alone, which the drop-in closes once applied. Nothing routes through `trinity`, and as the spare firewall a host policy is one more thing to get in the way the day it stands in for `morpheus`. What reaches `443` and `53` is set by pfSense and by the stack's bind addresses | | Someone with the trusted Wi-Fi key quietly joining | Kea's lease log reaches Loki; `UnknownDeviceOnTrustedSegment` fires the first time a MAC appears on VLAN 50 in seven days ([ADR-0019](adr/0019-read-device-joins-from-the-dhcp-server.md)) | -| Losing visibility of a failure | 183 alert rules, 30 days of metrics and logs | +| Losing visibility of a failure | 182 alert rules, 30 days of metrics and logs | | Someone on a reachable VLAN silencing an alert to hide a failure | Alertmanager binds to `127.0.0.1`; silences go through authenticated Grafana | | Mains power loss | **The rack, yes; the monitoring path, yes — on two laptop cells that were measured for the first time on 2026-09-12.** A pack fitted to `mjolnir` on 2026-08-28 passed its self-test; the TP-Link carrying `prometheus` and `oracle` has been on UPS power since 2026-09-08 ([#110](https://github.com/Gerrrt/HomeLab/issues/110)); the laptops ride a cut out on their own batteries, which `HostBatteryHealthLow` in `host.rules.yaml` now reads — `prometheus`'s cell was replaced on 2026-09-18 and reads 101 % of design, `oracle`'s was replaced on 2026-09-29 and reads 100 %, its design figure rather than a learned one ([#531](https://github.com/Gerrrt/HomeLab/issues/531)) — and **each runtime was measured once: `prometheus`'s on 2026-09-19, about 2.5 hours from full at the stack's load, and `oracle`'s on 2026-09-29, about 5.2 hours**; since the same day the projection is recorded on every cut and pages under thirty minutes (`HostBatteryRuntimeLow`, [#532](https://github.com/Gerrrt/HomeLab/issues/532)), but neither pack reports a moving cell temperature, so this row is answered for both hosts' runtime and for neither's cell temperature — see below. **What happens when the cut outlasts the pack is configured and accepted without a live test.** Since 2026-09-23 the firewall's NUT server reads `mjolnir`, and `Saruman` and `smaug` subscribe to it on their own gateway addresses, so a real cut would now try to run the sequence [ADR-0049](adr/0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md) decides: `Saruman` and `smaug` halt first and `morpheus` last. Since the move into the 32U rack on 2026-11-06 the PDU also carries `trinity`, `gandalf` (off until its build) and the console, with `smaug` racked and on the PDU directly rather than by its old long cord to the media room. [ADR-0107](adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md) makes `trinity` a third subscriber and bounds `Saruman`'s guest stop. `Saruman`'s half was applied on 2026-11-13 (`down=90` on the four ordered guests, and its monitor stays logged in until they are down); `trinity`'s subscription, `HOSTSYNC 600` on `morpheus` and the card's 16-minute threshold followed on 2026-11-20, so all three subscribers would now halt before the pack empties; `gandalf`, the console and `neo` are left to the pack by decision. The pack itself is unmeasured: about 47 minutes at 21 % load is the card's own estimate. Neither the forced-shutdown proof nor a mains pull will be run ([ADR-0121](adr/0121-accept-the-ups-shutdown-without-a-live-test.md)) | -| The estate being down while the person who runs it is unavailable | **Documentation, yes; data, not yet off the estate.** ADR-0011 puts the emergency tier on paper; [ADR-0023](adr/0023-keep-the-household-recovery-path-outside-the-estate.md) extends the same reasoning to the sensitive tier's data. That tier has held real photographs since 2026-09-28, and their off-estate copy is built but has no holder yet ([#455](https://github.com/Gerrrt/HomeLab/issues/455)) — see below | +| The estate being down while the person who runs it is unavailable | **Documentation, yes; data, no copy outside the house, by decision.** ADR-0011 puts the emergency tier on paper; [ADR-0023](adr/0023-keep-the-household-recovery-path-outside-the-estate.md) extends the same reasoning to the sensitive tier's data. That tier has held real photographs since 2026-09-28. [ADR-0122](adr/0122-drop-the-household-copy.md) dropped their copy outside the estate, so a loss of the house loses them — see below | What it explicitly does **not** defend against: a determined attacker with physical access to the rack, a supply-chain compromise in an upstream container @@ -97,28 +97,17 @@ refuses the handshake rather than degrading. declines to make any of it highly available and constrains the path instead: **nothing the household needs in an emergency may have the estate on its only route.** The household's own credentials are recoverable without Vaultwarden; -Immich, Paperless-ngx and Actual get an encrypted copy outside the estate whose -staleness is visible, off-*estate* rather than off-*host*, because `oracle` -shares the rack and the power feed; nothing on the break-glass card depends on a -certificate this estate issues; and nothing physical may be operable only -through Home Assistant. Those fall due on ADR-0022's triggers — the first real -credential, photo or document. The photo trigger fell on 2026-09-28, when 615 -photographs reached Immich before the copy existed. The copy is built, and was -rehearsed onto the household drive on 2026-10-01, but there is no copy of record -until a household holder's key is in -[`household.recipients`](../stacks/sensitive/household.recipients) -([#455](https://github.com/Gerrrt/HomeLab/issues/455), -[*What backs Immich up*](../stacks/sensitive/README.md#what-backs-immich-up-and-what-does-not-yet)). **The copy leaving -the house is a new residual**: it is the first household data to sit in someone -else's building, reduced to an availability problem by encryption at rest with a -key that never leaves here, and accepted on that basis. -[ADR-0073](adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md) -decided on 2026-10-01 that "here" means the household. The copy goes on a -drive the household holder keeps at their own address, and the holder's key -stays with them, apart from the drive. **The residual this adds** is that one -burglary at the holder's address could take the drive and the key together. -Accepted, because the alternative is a key the holder has to ask this estate -for, which is the failure ADR-0023 exists to prevent. +nothing on the break-glass card depends on a certificate this estate issues; +and nothing physical may be operable only through Home Assistant. Those fall +due on ADR-0022's triggers — the first real credential, photo or document. +ADR-0023 also required an encrypted copy of Immich, Paperless-ngx and Actual +outside the estate. [ADR-0122](adr/0122-drop-the-household-copy.md) dropped +that requirement on 2026-11-21. **The residual is the whole house**: the +photographs, documents and budget are on `trinity` and, encrypted, on +`oracle`, in the same room and on the same power, and a fire, flood or theft +that takes the rack takes every copy +([*What backs Immich up*](../stacks/sensitive/README.md#what-backs-immich-up-and-what-does-not-yet)). +Accepted by the operator. **The estate's own backup sets leave the house too, and with a key.** Decided 2026-09-20: the newest firewall export, volume set and NAS set are carried onto diff --git a/scripts/README.md b/scripts/README.md index 21113424..0eaf30c8 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -110,8 +110,7 @@ and only its fixtures run in CI, through `self-tests.sh`. | `backup-wiki.sh` | `backup-wiki` | A dump of the wiki's database, pulled off `oracle` ([ADR-0065](../docs/adr/0065-pull-the-wikis-database-to-prometheus-as-a-dump.md)) | | `backup-library.sh` | `backup-library` | Immich's library, archived on `trinity` and copied to `oracle` ([ADR-0064](../docs/adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md)) | | `backup-offsite.sh` | `backup-offsite` | The newest set of each kind onto the medium that leaves the estate ([ADR-0048](../docs/adr/0048-carry-the-estates-backup-sets-with-the-second-recipient.md)) | -| `carry-household-copy.sh`, `household-recipients.sh` | `household-copy`, `household-proof` | The household's photos and documents onto the holder's drive, and who can open it ([ADR-0073](../docs/adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md)) | -| `medium.sh` | — | Sourced by both of the above: the refusals that stop a "medium" being this host in disguise | +| `medium.sh` | — | Sourced by `backup-offsite.sh`: the refusals that stop a "medium" being this host in disguise | ## Collectors: state as metrics diff --git a/scripts/backup-library.sh b/scripts/backup-library.sh index 88e50947..ff4b6f15 100755 --- a/scripts/backup-library.sh +++ b/scripts/backup-library.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # # Archive Immich's library off its USB disk, encrypt it here, prove it, and -# copy it to oracle. The interim copy ADR-0064 decides, until #455's exists. +# copy it to oracle, the copy ADR-0064 decides. # # WHAT THIS PROTECTS, AND WHAT IT DOES NOT # @@ -28,15 +28,11 @@ # This copy is OFF-HOST and NOT OFF-ESTATE. oracle is on the same shelf, in # the same room, on the same power, and every set here is encrypted to the # recipients of secrets/sensitive.sops.yaml — trinity's key and, since #835, -# the technical second's — and, since ADR-0073, to -# stacks/sensitive/household.recipients as well. Sets taken before #835 landed -# open with trinity's key alone. It protects against the USB disk failing, and -# against trinity failing only if one of those keys has a proven copy -# (`make secrets-verify-backup STACK=sensitive`). -# It does NOT satisfy ADR-0023's Durable row, and ADR-0064 says so: that needs -# the copy on #455's drive, encrypted to a key the operator does not solely -# hold. The set format is the estate's standard one so that #455 can carry -# these sets beside the others rather than building a second mechanism. +# the technical second's. Sets taken before #835 landed open with trinity's key +# alone. It protects against the USB disk failing, and against trinity failing +# only if one of those keys has a proven copy +# (`make secrets-verify-backup STACK=sensitive`). It does not protect against +# losing the house: ADR-0122 dropped the copy outside it, and there is none. # # WHY NOTHING IS STOPPED # @@ -77,8 +73,8 @@ # firewall sets and beneath its own dead man's switch. A library that outgrows # it must fail this run, loudly, and not fill that filesystem: the preflight # refuses unless the free space after one more set would still be at least -# LIB_OFFHOST_RESERVE_KB. When it refuses, ADR-0064 has expired — #455's drive, -# or an lvextend on oracle, is the answer, and the message names both. +# LIB_OFFHOST_RESERVE_KB. When it refuses, oracle has run out of room for the +# library, and an lvextend on oracle is the answer; the message says so. # # WHY LIB_KEEP AND NOT KEEP # @@ -119,9 +115,8 @@ # LIB_DB_CONTAINER default sensitive-immich-db where --prove reads the asset table # SOPS_AGE_KEY_FILE default ~/.config/sops/age/keys.txt # LIB_UNSAFE_SELF_TEST the self-test's, and nobody else's: it lifts the -# mountpoint check and lets LIB_OUT_DIR, LIB_RECIPIENTS, -# LIB_HOUSEHOLD_RECIPIENTS_FILE and LIB_PROVE_ROWS stand -# in for the host +# mountpoint check and lets LIB_OUT_DIR, LIB_RECIPIENTS +# and LIB_PROVE_ROWS stand in for the host # shellcheck disable=SC2016 # ^ the self-test hands assert() test expressions as single-quoted strings, on purpose. @@ -164,10 +159,6 @@ fi SHIM chmod +x "${T}/bin/age" : > "${T}/identity" - # Real recipients, public halves only: the household holder and the fallback. - HH=age1mt2p3n6xqzevjyqq7qpxhwc3zk6wlc3qace6rj5qfhhkzhl3gyqsq5r349 - HS=age1vfe5xddxdzh5ggqmhhte0l78s2ktvmuzyjrfpjsemuez5q9z8u2q9cdlwz - printf '# role: household\n%s\n# role: technical-second\n%s\n' "${HH}" "${HS}" > "${T}/household" # A library the shape trinity's is: markers in every folder, originals in # both trees, a dump, and derived files that must NOT travel. @@ -188,7 +179,7 @@ SHIM set +e OUT="$(PATH="${T}/bin:${PATH}" LIB_UNSAFE_SELF_TEST="${UNSAFE-1}" \ LIB_SOURCE="${SRC_FOR_TEST:-${T}/lib}" LIB_OUT_DIR="${T}/out" LIB_KEEP=2 \ - LIB_RECIPIENTS=age1fixture LIB_HOUSEHOLD_RECIPIENTS_FILE="${HH_FOR_TEST:-${T}/household}" \ + LIB_RECIPIENTS=age1fixture,age1second \ LIB_PROVE_ROWS="${ROWS_FOR_TEST:-${T}/rows}" \ SOPS_AGE_KEY_FILE="${T}/identity" "${BASH_SOURCE[0]}" "$@" 2>&1)" RC=$? @@ -215,8 +206,8 @@ SHIM '[[ -f ${first}/MANIFEST && -f ${first}/immich-library.tar.gz.age && ! -e ${first}/immich-library.tar.gz.age.part ]]' assert "the MANIFEST says what was read and which dump rides with it" \ 'grep -qx "mode live" "${first}/MANIFEST" && grep -q "^db_dump immich-db-backup-20260929T020000" "${first}/MANIFEST" && grep -qx "files 2" "${first}/MANIFEST"' - assert "the set is encrypted to the household's keys as well as the tier's (ADR-0073)" \ - 'grep -qx "recipient age1fixture,${HH},${HS}" "${first}/MANIFEST"' + assert "the set is encrypted to every recipient of the tier's sops rule" \ + 'grep -qx "recipient age1fixture,age1second" "${first}/MANIFEST"' # shellcheck disable=SC2034 # read by the assert() strings below listing="$(tar -tzf "${first}/immich-library.tar.gz.age")" assert "the originals, the profile and the dump travel" \ @@ -233,10 +224,6 @@ SHIM assert "and the refusal wrote no set" \ '[[ $(find "${T}/out" -mindepth 1 -maxdepth 1 -type d -name "2*" | wc -l) -eq 1 ]]' - printf '%s\n' "${HH}" > "${T}/household.bad" - HH_FOR_TEST="${T}/household.bad" run --local-only - check "a household file that does not parse fails the run, not the encryption" 1 "cannot read the household's recipients" - UNSAFE="" run --local-only check "a source that is not a mountpoint is refused outside the self-test" 1 "not a mountpoint" @@ -611,19 +598,6 @@ else mapfile -t AGE_RECIPIENTS < <("${REPO_ROOT}/scripts/key-recipients.sh" --list --stack sensitive) fi ((${#AGE_RECIPIENTS[@]})) || die "no age recipients from secrets/sensitive.sops.yaml — nothing to encrypt to" -# And the household's (ADR-0073): the keys that open the copy on the household -# drive, which are deliberately not in the sops rule. Encrypted to here, once, -# so the drive carries these bytes unchanged and nothing re-encrypts the -# library with trinity's key in hand. A file that does not parse fails the run: -# a set made without them is one the drive will refuse as unfit. -HOUSEHOLD_FILE="${REPO_ROOT}/stacks/sensitive/household.recipients" -((UNSAFE)) && [[ -n ${LIB_HOUSEHOLD_RECIPIENTS_FILE:-} ]] && HOUSEHOLD_FILE="${LIB_HOUSEHOLD_RECIPIENTS_FILE}" -household="$("${REPO_ROOT}/scripts/household-recipients.sh" --file "${HOUSEHOLD_FILE}" --list)" \ - || die "cannot read the household's recipients from ${HOUSEHOLD_FILE} — fix it before the next set (ADR-0073)" -while IFS= read -r r; do - [[ " ${AGE_RECIPIENTS[*]} " == *" ${r} "* ]] || AGE_RECIPIENTS+=("${r}") -done <<<"${household}" -unset household AGE_ARGS=() for r in "${AGE_RECIPIENTS[@]}"; do AGE_ARGS+=(--recipient "${r}"); done AGE_RECIPIENT="$(IFS=,; printf '%s' "${AGE_RECIPIENTS[*]}")" @@ -645,7 +619,7 @@ if ((LOCAL_ONLY == 0)); then far_kb="$(awk 'NR == 2 { print $4 }' <<<"${far}")" [[ ${far_kb} =~ ^[0-9]+$ ]] || die "df on ${OFFHOST_TARGET} returned '${far}', not a size" if ! lib_room_ok "${far_kb}" "${total_kb}" "${LIB_OFFHOST_RESERVE_KB}"; then - die "${OFFHOST_TARGET}:${OFFHOST_DIR} has $(human $((far_kb * 1024))) free; one more set of $(human $((total_kb * 1024))) would leave less than the $(human $((LIB_OFFHOST_RESERVE_KB * 1024))) reserve on oracle's root volume. ADR-0064 has run out: land #455's copy, or lvextend oracle and raise nothing here" + die "${OFFHOST_TARGET}:${OFFHOST_DIR} has $(human $((far_kb * 1024))) free; one more set of $(human $((total_kb * 1024))) would leave less than the $(human $((LIB_OFFHOST_RESERVE_KB * 1024))) reserve on oracle's root volume. Make room: lvextend oracle and raise nothing here" fi fi @@ -747,7 +721,7 @@ else exit 1 fi printf '\n' - info "Copied to ${OFFHOST_TARGET}:${OFFHOST_DIR} — off-host, NOT off-estate (ADR-0064). ADR-0023's copy is #455's." + info "Copied to ${OFFHOST_TARGET}:${OFFHOST_DIR} — off-host, NOT off-house (ADR-0064, ADR-0122)." fi info "Proving it against the database: make backup-library ARGS=--prove" info "Restoring it: docs/runbooks/restore-the-sensitive-tier.md § Restore Immich." diff --git a/scripts/backup-offsite.sh b/scripts/backup-offsite.sh index c0efff3c..fa76ec57 100755 --- a/scripts/backup-offsite.sh +++ b/scripts/backup-offsite.sh @@ -460,8 +460,7 @@ STACK="${STACK:-observability}" VOL_OFFHOST="atropos@10.0.99.30:backups/volumes/${STACK}" # shellcheck source=scripts/backup-volumes.sh source "${REPO_ROOT}/scripts/backup-volumes.sh" -# The refusals and the set's copy, proof and retention, which the household's -# carry shares (ADR-0073). +# The refusals and the set's copy, proof and retention. # shellcheck source=scripts/medium.sh source "${REPO_ROOT}/scripts/medium.sh" diff --git a/scripts/backup-volumes.sh b/scripts/backup-volumes.sh index 5bda8876..997e8c4d 100755 --- a/scripts/backup-volumes.sh +++ b/scripts/backup-volumes.sh @@ -559,17 +559,6 @@ human() { numfmt --to=iec --suffix=B "$1" 2>/dev/null || printf '%sB' "$1"; } # written beside it by every pg_dump since 8.x. Read off a dump of the running # 17.6 on 2026-09-30. No volume archive here carries a top-level toc.dat. # -# paperless-documents (#455) is the fourth: Paperless-ngx's own -# document_exporter output, which scripts/carry-household-copy.sh archives for -# the household's drive (ADR-0073). The volume sets carry paperless-media too, -# but beside the vault, and only Paperless at the same version can read them. -# The export is the original files plus manifest.json, the exporter's record -# of every document, written at the export's root on every run, even an empty -# one; metadata.json beside it carries the version. Read off an export of the -# running 3.2.1 on trinity on 2026-10-01, into the container's /tmp and -# removed after: those two files and nothing else, because no document had -# been imported yet. No volume here has a top-level manifest.json. -# # speedtest-data (#914) is speedtest-tracker's /config: the SQLite database # with every result and the app's settings, including the Prometheus switch # the scrape depends on. Read off a first boot of the pinned 1.15.0 on @@ -604,7 +593,6 @@ declare -A SENTINEL=( [actual-data]="./server-files/account.sqlite" [immich-library]="./library/.immich" [wiki-db]="toc.dat" - [paperless-documents]="./manifest.json" [speedtest-data]="./database.sqlite" ) @@ -652,7 +640,6 @@ declare -A COMPANIONS=( [actual-data]="./user-files ./.migrate" [immich-library]="./upload/.immich ./profile/.immich ./backups/.immich ./thumbs/.immich ./encoded-video/.immich" [wiki-db]="restore.sql" - [paperless-documents]="./metadata.json" [speedtest-data]="./.migrations ./nginx ./php" ) diff --git a/scripts/carry-household-copy.sh b/scripts/carry-household-copy.sh deleted file mode 100755 index 7a7d8ef4..00000000 --- a/scripts/carry-household-copy.sh +++ /dev/null @@ -1,617 +0,0 @@ -#!/usr/bin/env bash -# -# Carry the household's photographs and documents onto the drive the holder -# keeps at their own address, prove what landed, and leave them the means to -# open it without anyone from here. -# -# WHAT THIS IS -# -# ADR-0023's off-estate copy, as ADR-0073 decides it. Immich and Paperless-ngx -# are Durable: an off-estate copy has to exist, its staleness has to be -# visible, and it has to open with a key the operator does not solely hold. -# This script writes that copy. It runs on trinity, where the sets are, onto -# the WD Elements mounted at DEST. Like backup-offsite.sh, it is a job with a -# deadline and no timer, because no timer can mount a drive that lives at -# someone else's address. A successful copy of record is the household-copy -# job, and HouseholdCopyStale fires ninety days after the last one. -# -# WHAT LANDS ON THE DRIVE -# -# household/immich-library// the newest library set backup-library.sh made -# household/paperless-documents// a Paperless export made by this run -# tools/age-v*--.{zip,tar.gz} age for Windows, macOS and Linux, hash-checked -# PROOF/proof.txt.age, PROOF/ID a code only the household key opens -# HOW-TO-OPEN.txt docs/runbooks/open-the-household-copy.md, verbatim -# -# The sets are the estate's standard ones, already encrypted where they were -# made to the sensitive rule's recipients and to -# stacks/sensitive/household.recipients. Nothing here re-encrypts the library -# or reads a key to do it. A library set made before a household key was added -# cannot be opened by that key however well it hashes, so it is refused by -# name, the way backup-offsite.sh refuses a set its medium's key cannot open. -# -# Paperless is the exception, because nothing else makes its export. Each run -# runs document_exporter into stacks/sensitive/export/ (gitignored, and kept in -# sync with -d so the next run is incremental), then archives, encrypts and -# verifies it into backups/paperless-documents// as a standard set. That -# is the original files plus manifest.json, which a holder can browse as files -# and which re-imports into the same Paperless version. The volume set cannot -# go: it carries the vault beside the documents. -# -# NO HOLDER, NO COPY OF RECORD -# -# Until stacks/sensitive/household.recipients has a `household` key, the copy -# of record is refused. A success recorded with only the technical second's key -# would buy ninety days of silence for a copy that fails ADR-0023's first -# condition. --rehearse writes the same copy without recording anything and -# marks the drive REHEARSAL-NOT-THE-HOUSEHOLD-COPY.txt. With -# --proof-recipient, the rehearsal's PROOF opens with a throwaway key made on -# the machine that will rehearse the holder's side. -# -# THE PROOF -# -# ADR-0023's second condition: the copy is opened once from the other -# person's device, signed into their own account, without the operator -# present. Nothing here can watch that happen, but it can make it -# checkable. A copy of record writes a random code into PROOF/proof.txt.age, -# encrypted to the household keys ONLY: not trinity's, not the technical -# second's. Trinity keeps the code's sha256 and never the code. The holder -# opens it on their own device and reads the code back over the phone, and -# `make household-proof CODE=…` records the household-proof job. The code -# stays the same across visits until it is proved, then the next copy of -# record replaces it. -# -# Usage: -# scripts/carry-household-copy.sh the copy of record: make household-copy DEST=… -# scripts/carry-household-copy.sh --rehearse [--proof-recipient ] -# scripts/carry-household-copy.sh --list what is here and what is on the drive -# scripts/carry-household-copy.sh --verify-only re-hash everything on the drive -# scripts/carry-household-copy.sh --prune retention and leftovers only -# scripts/carry-household-copy.sh --check-code does this code match the open challenge -# scripts/carry-household-copy.sh --prove-code the same, and mark it proved: make household-proof -# scripts/carry-household-copy.sh --self-test -# -# Environment: -# HOUSEHOLD_KEEP default 1 complete sets of each kind kept on the drive -# SOPS_AGE_KEY_FILE default ~/.config/sops/age/keys.txt verifies the Paperless set -# HOUSEHOLD_UNSAFE_SELF_TEST the self-test's, and nobody else's: it lifts -# the medium checks and lets HOUSEHOLD_SOURCE, -# HOUSEHOLD_RECIPIENTS_FILE, HOUSEHOLD_SENSITIVE_RECIPIENTS -# and HOUSEHOLD_EXPORT_DIR stand in for the host - -# shellcheck disable=SC2016 -# ^ the self-test hands assert() test expressions as single-quoted strings, on purpose. -set -euo pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" - -# --------------------------------------------------------------------------- -# --self-test, before anything reads the host -# -# CI has no age binary and no key, so the fixtures put a pass-through `age` on -# PATH that also logs every recipient it was handed. That is how the proof's -# keys are asserted: the shim cannot show that only the household key opens -# PROOF, but it can show which keys it was encrypted to. Everything else — -# the refusals, the holder guard, fitness, the copy and its proof, retention, -# the tools and the code — is the real code. -# --------------------------------------------------------------------------- -if [[ "${1:-}" == "--self-test" ]]; then - T="$(mktemp -d)" - trap 'rm -rf "${T}"' EXIT - mkdir -p "${T}/bin" - cat > "${T}/bin/age" <<'SHIM' -#!/usr/bin/env bash -# Self-test stand-in for age: no encryption, the same argv shape, recipients -# logged one call per block, each block opened by a "--" line. -printf -- '--\n' >> "${AGE_SHIM_LOG:-/dev/null}" -out="" dec=0 last="" -while (($#)); do - case "$1" in - -d|--decrypt) dec=1 ;; - -i|--identity) shift ;; - -r|--recipient) printf '%s\n' "$2" >> "${AGE_SHIM_LOG:-/dev/null}"; shift ;; - -o|--output) out="$2"; shift ;; - *) last="$1" ;; - esac - shift -done -if ((dec)); then - if [[ -n ${last} ]]; then cat -- "${last}"; else cat; fi -else - cat > "${out}" -fi -SHIM - chmod +x "${T}/bin/age" - : > "${T}/identity" - - # Real recipients, made with age-keygen for this test; public halves only. - KH=age1mt2p3n6xqzevjyqq7qpxhwc3zk6wlc3qace6rj5qfhhkzhl3gyqsq5r349 # the household holder - KS=age1vfe5xddxdzh5ggqmhhte0l78s2ktvmuzyjrfpjsemuez5q9z8u2q9cdlwz # the technical second - KT=age1zkk7g3ufhfs5e78mkn80q3wawj8497y4d9lcffvjndw6fjepy4mq0ccxds # trinity - KR=age1x9dgekxhr2y9sxsfvth4dmm3l0pv2l2hdhc7w7dkf3gpflvlmarq3z5qe5 # a rehearsal's throwaway - # The recipients of the newest age call the shim saw, one per line. - # shellcheck disable=SC2317,SC2329 # called from assert()'s eval strings - last_call() { awk '/^--$/ { n = 0; delete k; next } { k[++n] = $0 } END { for (i = 1; i <= n; i++) print k[i] }' "${T}/recipients.log"; } - printf '# role: household\n%s\n# role: technical-second\n%s\n' "${KH}" "${KS}" > "${T}/both" - printf '# role: technical-second\n%s\n' "${KS}" > "${T}/second" - - # The repository the script reads, in miniature: a library set, a Paperless - # export, the runbook and the tools. - R="${T}/repo" - mkdir -p "${R}/backups/immich-library" "${R}/backups/household/tools" "${T}/export" - mklibset() { # - local d="${R}/backups/immich-library/$1" sha bytes - mkdir -p "${T}/lib/library" && printf 'immich\n' > "${T}/lib/library/.immich" && printf 'photo-%s\n' "$1" > "${T}/lib/library/a.jpg" - mkdir -p "${d}" - tar -C "${T}/lib" -czf "${d}/immich-library.tar.gz.age" . - sha="$(sha256sum "${d}/immich-library.tar.gz.age" | cut -d' ' -f1)" - bytes="$(stat -c %s "${d}/immich-library.tar.gz.age")" - printf '# fixture set %s\nrecipient\t%s\n#volume\tservice\tmount\tbytes\tsha256\nimmich-library\timmich-server\t/data\t%s\t%s\n' \ - "$1" "$2" "${bytes}" "${sha}" > "${d}/MANIFEST" - } - mklibset 20260929T051500Z "${KT},${KS}" - printf '[]\n' > "${T}/export/manifest.json" - printf '{"version": "3.2.1"}\n' > "${T}/export/metadata.json" - head -c 4096 /dev/urandom > "${T}/export/0000001.pdf" - mkdir -p "${R}/docs/runbooks" "${R}/stacks/sensitive" - printf 'How to open it.\n' > "${R}/docs/runbooks/open-the-household-copy.md" - printf 'age-for-windows\n' > "${R}/backups/household/tools/age-v0-windows-amd64.zip" - printf '%s age-v0-windows-amd64.zip\n' "$(sha256sum "${R}/backups/household/tools/age-v0-windows-amd64.zip" | cut -d' ' -f1)" \ - > "${R}/stacks/sensitive/household-age.sha256" - M="${T}/medium"; mkdir -p "${M}" - - fail=0 - run() { # → OUT, RC - set +e - OUT="$(PATH="${T}/bin:${PATH}" HOUSEHOLD_UNSAFE_SELF_TEST="${UNSAFE-1}" HOUSEHOLD_REPO="${R}" \ - HOUSEHOLD_RECIPIENTS_FILE="${RECIPIENTS_FOR_TEST:-${T}/both}" HOUSEHOLD_SENSITIVE_RECIPIENTS="${KT}" \ - HOUSEHOLD_EXPORT_DIR="${T}/export" HOMELAB_LOCK_DIR="${T}" AGE_SHIM_LOG="${T}/recipients.log" \ - SOPS_AGE_KEY_FILE="${T}/identity" "${BASH_SOURCE[0]}" "$@" 2>&1)" - RC=$? - set -e - } - check() { # - if [[ ${RC} == "$2" && ${OUT} == *"$3"* ]]; then - printf '\033[0;32m PASS\033[0m %s\n' "$1" - else - printf '\033[0;31m FAIL\033[0m %s\n exit %s, wanted %s; wanted output containing: %s\n' "$1" "${RC}" "$2" "$3" - printf '%s\n' "${OUT}" | sed 's/^/ | /' - fail=1 - fi - } - assert() { # - if eval "$2"; then printf '\033[0;32m PASS\033[0m %s\n' "$1" - else printf '\033[0;31m FAIL\033[0m %s\n' "$1"; fail=1; fi - } - - # The refusals, with the medium checks ON. - run; check "no DEST is a usage error" 2 "usage" - run "${R}"; check "a DEST inside the repository is refused" 1 "inside this repository" - UNSAFE="" run "${T}/medium"; check "a DEST under /tmp, or in RAM, is refused outside the self-test" 1 "the destination is" - - # No holder. - RECIPIENTS_FOR_TEST="${T}/second" run "${M}" - check "no household key: the copy of record is refused" 1 "no household holder" - assert "and nothing was written to the drive" '[[ -z $(ls -A "${M}") ]]' - - # A library set the household key cannot open. - run "${M}" - check "a library set made before the household key was added is refused by name" 1 "20260929T051500Z is not encrypted to ${KH}" - assert "and nothing reached the drive" '[[ ! -e "${M}/household/immich-library" ]]' - - # The rehearsal: no holder needed, nothing recorded, the drive marked. - : > "${T}/recipients.log" - RECIPIENTS_FOR_TEST="${T}/second" run "${M}" --rehearse --proof-recipient "${KR}" - check "--rehearse needs no holder" 0 "REHEARSAL" - assert "the rehearsal marks the drive" '[[ -f "${M}/REHEARSAL-NOT-THE-HOUSEHOLD-COPY.txt" ]]' - assert "the rehearsal's PROOF is encrypted to the throwaway key alone" '[[ $(last_call) == "${KR}" ]]' - - # A fit library set, and the copy of record. - sleep 1; mklibset 20260930T051500Z "${KT},${KS},${KH}" - : > "${T}/recipients.log" - run "${M}" - check "the copy of record lands and is proved" 0 "the drive holds the household's copy" - assert "the library set and a Paperless set are on the drive, complete" \ - '[[ -f "${M}/household/immich-library/20260930T051500Z/MANIFEST" && $(find "${M}/household/paperless-documents" -mindepth 2 -name MANIFEST | wc -l) -eq 1 ]]' - assert "the Paperless set is encrypted to the tier and the household both" \ - 'grep -q "^recipient ${KT},${KH},${KS}$" "$(find "${M}/household/paperless-documents" -mindepth 2 -name MANIFEST)"' - assert "the Paperless set holds the export" \ - 'tar -tzf "$(find "${M}/household/paperless-documents" -name "*.tar.gz.age")" | grep -qx "./0000001.pdf"' - assert "the proof is encrypted to the household key and nothing else" '[[ $(last_call) == "${KH}" ]]' - assert "the rehearsal marker is gone" '[[ ! -e "${M}/REHEARSAL-NOT-THE-HOUSEHOLD-COPY.txt" ]]' - assert "the holder's instructions and the tools travelled" \ - 'cmp -s "${M}/HOW-TO-OPEN.txt" "${R}/docs/runbooks/open-the-household-copy.md" && [[ -f "${M}/tools/age-v0-windows-amd64.zip" ]]' - assert "the code is not stored on trinity, only its hash" \ - 'code="$(cat "${M}/PROOF/proof.txt.age" | grep -oE "[0-9]{4}-[0-9]{4}-[0-9]{4}")" && ! grep -rq "${code}" "${R}/backups/household"' - - code="$(grep -oE '[0-9]{4}-[0-9]{4}-[0-9]{4}' "${M}/PROOF/proof.txt.age")" - run --check-code "1111-2222-3333"; check "a wrong code does not match" 1 "does not match" - run --check-code "${code}"; check "the right code matches" 0 "matches" - run --check-code "${code//-/ }"; check "spaces instead of dashes still match" 0 "matches" - sleep 1; run "${M}"; check "a second visit keeps the unproved challenge" 0 "the drive holds the household's copy" - assert "the code on the drive did not change" 'grep -q "${code}" "${M}/PROOF/proof.txt.age"' - run --prove-code "${code}"; check "--prove-code marks it proved" 0 "proved" - run --check-code "${code}"; check "a proved code is not open any more" 1 "no open challenge" - sleep 1; run "${M}"; check "the next visit after a proof" 0 "new proof challenge" - assert "replaced the code" '! grep -q "${code}" "${M}/PROOF/proof.txt.age"' - - run "${M}" --verify-only; check "--verify-only proves what the drive holds" 0 "every set on the drive verifies" - lib="${M}/household/immich-library/20260930T051500Z/immich-library.tar.gz.age" - printf 'x' | dd of="${lib}" bs=1 seek=10 conv=notrunc 2>/dev/null - run "${M}" --verify-only; check "a changed byte on the drive fails the verify" 1 "differs from its MANIFEST" - run "${M}"; check "and the copy refuses to write over it" 1 "differs from its MANIFEST" - assert "nothing was deleted" '[[ -f ${lib} ]]' - rm -rf "${M}/household/immich-library/20260930T051500Z" - - mv "${R}/backups/household/tools/age-v0-windows-amd64.zip" "${T}/tool.bak" - run "${M}" --rehearse; check "a rehearsal without a pinned tool is refused too" 1 "is not in" - mv "${T}/tool.bak" "${R}/backups/household/tools/age-v0-windows-amd64.zip" - printf 'not-age\n' > "${R}/backups/household/tools/age-v0-windows-amd64.zip" - run "${M}"; check "a tool that is not the pinned build is refused" 1 "does not match" - printf 'age-for-windows\n' > "${R}/backups/household/tools/age-v0-windows-amd64.zip" - - mkdir -p "${M}/household/immich-library/20260101T000000Z.part" "${M}/household/immich-library/not-a-stamp" - sleep 1; run "${M}" - check "a run after the bad set was removed copies it again" 0 "copied 20260930T051500Z" - assert "the dead copy's .part is swept and the stray is left" \ - '[[ ! -e "${M}/household/immich-library/20260101T000000Z.part" && -d "${M}/household/immich-library/not-a-stamp" ]]' - assert "HOUSEHOLD_KEEP=1 holds one Paperless set on the drive" \ - '[[ $(find "${M}/household/paperless-documents" -mindepth 2 -name MANIFEST | wc -l) -eq 1 ]]' - - printf 'age1notakey\n' > "${T}/bad" - RECIPIENTS_FOR_TEST="${T}/bad" run "${M}" - check "a recipients file that does not parse stops the run" 1 "is not an age recipient" - - exit "${fail}" -fi - -# --------------------------------------------------------------------------- -# Configuration -# --------------------------------------------------------------------------- -UNSAFE=0 -[[ -n ${HOUSEHOLD_UNSAFE_SELF_TEST:-} ]] && UNSAFE=1 -SCRIPTS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -# Set before the source line: backup-volumes.sh validates VOL_OFFHOST as it -# loads. Nothing here contacts it. -STACK=sensitive -VOL_OFFHOST="atropos@10.0.99.30:backups/volumes/sensitive" -# shellcheck source=scripts/backup-volumes.sh -source "${SCRIPTS}/backup-volumes.sh" -# shellcheck source=scripts/medium.sh -source "${SCRIPTS}/medium.sh" -# After the sources: backup-volumes.sh sets REPO_ROOT as it loads. -((UNSAFE)) && [[ -n ${HOUSEHOLD_REPO:-} ]] && REPO_ROOT="${HOUSEHOLD_REPO}" - -HOUSEHOLD_KEEP="${HOUSEHOLD_KEEP:-1}" -if ! [[ ${HOUSEHOLD_KEEP} =~ ^[0-9]+$ ]] || ((HOUSEHOLD_KEEP < 1)); then - die "HOUSEHOLD_KEEP must be a positive integer, got '${HOUSEHOLD_KEEP}'" -fi - -RECIPIENTS_FILE="${REPO_ROOT}/stacks/sensitive/household.recipients" -((UNSAFE)) && [[ -n ${HOUSEHOLD_RECIPIENTS_FILE:-} ]] && RECIPIENTS_FILE="${HOUSEHOLD_RECIPIENTS_FILE}" -EXPORT_DIR="${REPO_ROOT}/stacks/sensitive/export" -((UNSAFE)) && [[ -n ${HOUSEHOLD_EXPORT_DIR:-} ]] && EXPORT_DIR="${HOUSEHOLD_EXPORT_DIR}" -LIB_SRC="${REPO_ROOT}/backups/immich-library" -DOC_OUT="${REPO_ROOT}/backups/paperless-documents" -STATE_DIR="${REPO_ROOT}/backups/household" -TOOLS_SRC="${STATE_DIR}/tools" -TOOLS_SHA="${REPO_ROOT}/stacks/sensitive/household-age.sha256" -RUNBOOK="${REPO_ROOT}/docs/runbooks/open-the-household-copy.md" -PROOF_STATE="${STATE_DIR}/proof" -PAPERLESS_CONTAINER=sensitive-paperless - -hh() { "${SCRIPTS}/household-recipients.sh" --file "${RECIPIENTS_FILE}" "$@"; } - -# --------------------------------------------------------------------------- -# The proof's codes. Twelve digits in three groups, read over a phone. Only the -# sha256 of the digits is kept, in PROOF_STATE: "\t\t". -# --------------------------------------------------------------------------- -norm_code() { tr -cd '0-9' <<<"$1"; } -code_sha() { printf '%s' "$(norm_code "$1")" | sha256sum | cut -d' ' -f1; } -new_code() { od -An -N12 -tu1 /dev/urandom | awk '{ for (i = 1; i <= NF; i++) printf "%d", $i % 10 }' | sed -E 's/^(....)(....)(....)$/\1-\2-\3/'; } -proof_field() { [[ -r ${PROOF_STATE} ]] && awk -F'\t' -v n="$1" 'NR == 1 { print $n }' "${PROOF_STATE}"; } - -if [[ ${1:-} == --check-code || ${1:-} == --prove-code ]]; then - mode="$1" given="${2:-}" - [[ -n ${given} ]] || die "${mode} needs the code the holder read out" - [[ $(norm_code "${given}") =~ ^[0-9]{12}$ ]] || die "a code is twelve digits, got '${given}'" - [[ $(proof_field 3 || true) == pending ]] \ - || die "no open challenge on trinity — the last code was proved, or no copy of record has written one yet" - if [[ $(code_sha "${given}") != "$(proof_field 2)" ]]; then - die "the code does not match the open challenge ($(proof_field 1)). Read it again from PROOF/proof.txt.age on the holder's device" - fi - if [[ ${mode} == --check-code ]]; then - green "the code matches the open challenge $(proof_field 1)" - exit 0 - fi - printf '%s\t%s\tproved\t%s\n' "$(proof_field 1)" "$(proof_field 2)" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" > "${PROOF_STATE}.new" - mv "${PROOF_STATE}.new" "${PROOF_STATE}" - green "proved: the holder opened challenge $(proof_field 1) on their own device. ADR-0023's second condition holds as of today; record it in the changelog" - exit 0 -fi - -# --------------------------------------------------------------------------- -# Arguments -# --------------------------------------------------------------------------- -usage() { sed -n 's|^# \{0,1\}||; /^Usage:/,/^$/p' "${BASH_SOURCE[0]}" | head -12; } -MODE=copy -DEST="" -PROOF_RECIPIENT="" -while (($#)); do - case "$1" in - --rehearse) MODE=rehearse ;; - --proof-recipient) PROOF_RECIPIENT="${2:-}"; shift ;; - --list) MODE=list ;; - --verify-only) MODE=verify ;; - --prune) MODE=prune ;; - -h|--help) usage; exit 0 ;; - --*) usage >&2; die "unknown argument: $1" ;; - *) [[ -z ${DEST} ]] || die "one DEST only, got '${DEST}' and '$1'"; DEST="$1" ;; - esac - shift -done -if [[ -z ${DEST} ]]; then - usage >&2 - printf '\nusage: mount the drive, then: make household-copy DEST=/path/to/the/drive\n' >&2 - exit 2 -fi -[[ -z ${PROOF_RECIPIENT} || ${MODE} == rehearse ]] || die "--proof-recipient is for --rehearse only; a copy of record proves the household's own key" -[[ -z ${PROOF_RECIPIENT} || ${PROOF_RECIPIENT} =~ ^age1[02-9ac-hj-np-z]{58}$ ]] || die "--proof-recipient '${PROOF_RECIPIENT}' is not an age recipient" - -need sha256sum -need cmp -need df -need age - -[[ -d ${DEST} ]] || die "no such directory: ${DEST} -Mount the drive first. The path is a directory on it, not a device." -DEST_ABS="$(cd "${DEST}" && pwd -P)" -medium_refuse "${DEST_ABS}" "${REPO_ROOT}/backups" "${UNSAFE}" HouseholdCopyStale \ - docs/runbooks/carry-the-household-copy.md "the household's drive (ADR-0073)" - -LIB_DST="${DEST_ABS}/household/immich-library" -DOC_DST="${DEST_ABS}/household/paperless-documents" -REHEARSAL_MARK="${DEST_ABS}/REHEARSAL-NOT-THE-HOUSEHOLD-COPY.txt" - -# Who must be able to open what travels: every key in the household file. -WANT="$(hh --list)" || exit 1 - -# A sentence naming why a set cannot travel, or nothing. -unfit() { # - local have missing - have="$(manifest_field "$1" recipient | tr ',' '\n')" - if [[ -z ${have//[[:space:]]/} ]]; then - printf '%s records no recipients, so which keys open it is unknown\n' "$(basename "$1")" - return - fi - missing="$(cannot_open "${have}" "${WANT}")" - [[ -z ${missing} ]] || printf '%s is not encrypted to %s, so that key cannot open it\n' \ - "$(basename "$1")" "$(paste -sd, <<<"${missing}")" -} - -# Every complete set on the drive hashes to its MANIFEST, and every tool to -# its pinned line. 2 means there was nothing to check. -verify_drive() { - local d n=0 failed=0 name want - while read -r d; do - [[ -n ${d} ]] || continue - verify_set_dir "${d}" || failed=1 - n=$((n + 1)) - done < <(sets_in "${LIB_DST}"; sets_in "${DOC_DST}") - while read -r want name; do - [[ -f ${DEST_ABS}/tools/${name} ]] || continue - if [[ $(sha256sum -- "${DEST_ABS}/tools/${name}" | cut -d' ' -f1) != "${want}" ]]; then - red "${DEST_ABS}/tools/${name} does not match its pinned sha256 in stacks/sensitive/household-age.sha256" - failed=1 - fi - done < <(pinned_tools) - ((failed)) && return 1 - ((n)) || return 2 - green "every set on the drive verifies — ${n} set(s), each archive hashes to its MANIFEST entry" -} - -pinned_tools() { [[ -r ${TOOLS_SHA} ]] && awk '!/^#/ && NF == 2 { print $1, $2 }' "${TOOLS_SHA}"; } - -take_backups_lock() { - local lock_file="${HOMELAB_LOCK_DIR:-/run/lock}/homelab-backups.lock" - exec 8>"${lock_file}" || die "cannot open ${lock_file}" - flock -w 900 8 || die "another job holds the backups lock (${lock_file}) — a backup is running; waiting longer than 900s for it" -} - -# --------------------------------------------------------------------------- -# --list, --verify-only, --prune -# --------------------------------------------------------------------------- -case "${MODE}" in - list) - hh --check - printf '\nhere:\n' - printf ' library: %s\n' "$(sets_in "${LIB_SRC}" | head -1 | xargs -r basename || true)" - printf ' documents: %s\n' "$(sets_in "${DOC_OUT}" | head -1 | xargs -r basename || true)" - printf ' proof: %s\n' "$(cut -f1,3,4 "${PROOF_STATE}" 2>/dev/null | tr '\t' ' ' || printf 'none written')" - printf 'on the drive:\n' - printf ' library: %s\n' "$(sets_in "${LIB_DST}" | xargs -r -n1 basename | paste -sd' ' || true)" - printf ' documents: %s\n' "$(sets_in "${DOC_DST}" | xargs -r -n1 basename | paste -sd' ' || true)" - [[ -e ${REHEARSAL_MARK} ]] && printf ' a REHEARSAL, not the household copy\n' - exit 0 - ;; - verify) - rc=0; verify_drive || rc=$? - ((rc == 2)) && die "nothing to verify on ${DEST_ABS} — no complete set; an empty drive is not a proof" - exit "${rc}" - ;; - prune) - take_backups_lock - sweep_set_parts "${LIB_DST}" "${DOC_DST}" - prune_sets "${LIB_DST}" "${HOUSEHOLD_KEEP}" - prune_sets "${DOC_DST}" "${HOUSEHOLD_KEEP}" - green "pruned ${DEST_ABS} to ${HOUSEHOLD_KEEP} set(s) of each kind" - exit 0 - ;; -esac - -# --------------------------------------------------------------------------- -# The copy: of record, or a rehearsal -# --------------------------------------------------------------------------- -# The rehearsal runs unwrapped, so it takes the lock a copy of record runs -# under itself; the copy of record already holds it through run-scheduled.sh. -[[ ${MODE} == rehearse ]] && take_backups_lock - -HOLDERS="$(hh --list --role household)" || exit 1 -if [[ ${MODE} == copy && -z ${HOLDERS} ]]; then - die "no household holder in ${RECIPIENTS_FILE#"${REPO_ROOT}"/} — the copy of record needs a key the operator does not solely hold (ADR-0023, ADR-0073). -Rehearse instead: make household-copy DEST=${DEST} ARGS=--rehearse" -fi - -# 1. What is already on the drive is still what was written. -rc=0; verify_drive || rc=$? -((rc == 1)) && die "the drive does not verify — nothing written. Remove what differs, then run again: docs/runbooks/carry-the-household-copy.md" - -# 2. The newest library set, and it must open with every household key. -lib_set="$(sets_in "${LIB_SRC}" | head -1 || true)" -[[ -n ${lib_set} ]] || die "no complete library set under ${LIB_SRC} — run make backup-library first" -why="$(unfit "${lib_set}")" -[[ -z ${why} ]] || die "${why}. Make a set now that it is in the recipients file: make backup-library" - -# 3. The tools are the pinned builds, before anything is written. -mapfile -t tools < <(pinned_tools) -((${#tools[@]})) || die "no pinned tools in ${TOOLS_SHA}" -for line in "${tools[@]}"; do - read -r want name <<<"${line}" - # A rehearsal too: it is the same copy, and the binaries are what the - # holder's side of a rehearsal opens it with. - [[ -f ${TOOLS_SRC}/${name} ]] \ - || die "${name} is not in ${TOOLS_SRC} — download it once: docs/runbooks/carry-the-household-copy.md §1" - [[ $(sha256sum -- "${TOOLS_SRC}/${name}" | cut -d' ' -f1) == "${want}" ]] \ - || die "${TOOLS_SRC}/${name} does not match its pinned sha256 — not the build stacks/sensitive/household-age.sha256 names; delete it and download it again" -done - -# 4. The Paperless set: export, archive, encrypt, verify, MANIFEST last. -mapfile -t TIER < <( - if ((UNSAFE)) && [[ -n ${HOUSEHOLD_SENSITIVE_RECIPIENTS:-} ]]; then tr ',' '\n' <<<"${HOUSEHOLD_SENSITIVE_RECIPIENTS}" - else "${SCRIPTS}/key-recipients.sh" --list --stack sensitive; fi) -((${#TIER[@]})) || die "no age recipients from secrets/sensitive.sops.yaml" -RECIPS=("${TIER[@]}") -while IFS= read -r r; do - [[ -n ${r} && " ${RECIPS[*]} " != *" ${r} "* ]] && RECIPS+=("${r}") -done <<<"${WANT}" -AGE_ARGS=() -for r in "${RECIPS[@]}"; do AGE_ARGS+=(--recipient "${r}"); done - -if ! ((UNSAFE)) || [[ -z ${HOUSEHOLD_EXPORT_DIR:-} ]]; then - docker inspect -f '{{.State.Running}}' "${PAPERLESS_CONTAINER}" 2>/dev/null | grep -qx true \ - || die "${PAPERLESS_CONTAINER} is not running — the export needs it; nothing written" - info "exporting Paperless-ngx into ${EXPORT_DIR#"${REPO_ROOT}"/}" - docker exec "${PAPERLESS_CONTAINER}" document_exporter ../export --no-progress-bar -d -nt -c \ - || die "document_exporter failed — nothing written" -fi -[[ -f ${EXPORT_DIR}/manifest.json ]] || die "no manifest.json in ${EXPORT_DIR} — that is not a Paperless export" - -STAMP="$(date -u +%Y%m%dT%H%M%SZ)" -doc_set="${DOC_OUT}/${STAMP}" -mkdir -p "${DOC_OUT}" -mkdir "${doc_set}" || die "set ${STAMP} already exists" -part="${doc_set}/paperless-documents.tar.gz.age.part" -tar --numeric-owner -C "${EXPORT_DIR}" -cf - . | gzip | age "${AGE_ARGS[@]}" --output "${part}" \ - || die "tar, gzip or age failed writing ${part} — the incomplete set is at ${doc_set}" -verify "${part}" paperless-documents 0 || die "the Paperless archive did not verify — the incomplete set is at ${doc_set}" -bytes="$(stat -c %s "${part}")" -sha="$(sha256sum "${part}" | cut -d' ' -f1)" -mv "${part}" "${doc_set}/paperless-documents.tar.gz.age" -{ - printf '# %s set %s\n' "$(basename "$0")" "${STAMP}" - printf 'stack\tsensitive\nproject\tsensitive\nmode\tlive\n' - printf 'source\t%s\n' "${EXPORT_DIR}" - printf 'recipient\t%s\n' "$(IFS=,; printf '%s' "${RECIPS[*]}")" - printf 'archiver\thost-tar\n' - printf 'documents\t%s\n' "$(find "${EXPORT_DIR}" -type f ! -name '*.json' | wc -l)" - printf '#volume\tservice\tmount\tbytes\tsha256\n' - printf '%s\t%s\t%s\t%s\t%s\n' paperless-documents paperless /usr/src/paperless/export "${bytes}" "${sha}" -} > "${doc_set}/MANIFEST" -prune_sets "${DOC_OUT}" 1 - -# 5. Room: the new sets land before the old are pruned, so the drive needs -# room for both. A library past roughly 2.4 TB no longer fits twice on 5 TB. -need_bytes=0 -todo=() -for s in "${lib_set}" "${doc_set}"; do - kind="$(manifest_volumes "${s}" | head -1)" - [[ -f ${DEST_ABS}/household/${kind}/$(basename "${s}")/MANIFEST ]] && continue - todo+=("${s}") - need_bytes=$((need_bytes + $(manifest_bytes "${s}"))) -done -avail_bytes=$(($(df --output=avail -k "${DEST_ABS}" | tail -1 | tr -d ' ') * 1024)) -if ((need_bytes + need_bytes / 50 > avail_bytes)); then - die "the drive has $(human "${avail_bytes}") free and this visit needs $(human "${need_bytes}") before the old sets are pruned. Prune first (ARGS=--prune), or the library has outgrown a 5 TB drive (ADR-0073's ceiling); nothing written" -fi - -# 6. Copy, then the rest of what the holder needs. -failed=0 -for s in "${todo[@]}"; do - kind="$(manifest_volumes "${s}" | head -1)" - mkdir -p -- "${DEST_ABS}/household/${kind}" - copy_set "${s}" "${DEST_ABS}/household/${kind}" || failed=1 -done -((failed)) && die "the copy did not complete — the drive may hold a .part; the next run removes it and copies again" -for s in "${lib_set}" "${doc_set}"; do - kind="$(manifest_volumes "${s}" | head -1)" - [[ " ${todo[*]} " == *" ${s} "* ]] || info "the drive already holds ${kind} $(basename "${s}")" -done - -mkdir -p -- "${DEST_ABS}/tools" -for line in "${tools[@]}"; do - read -r want name <<<"${line}" - [[ -f ${TOOLS_SRC}/${name} ]] || continue - cmp -s -- "${TOOLS_SRC}/${name}" "${DEST_ABS}/tools/${name}" 2>/dev/null && continue - cp -- "${TOOLS_SRC}/${name}" "${DEST_ABS}/tools/${name}.part" - mv -- "${DEST_ABS}/tools/${name}.part" "${DEST_ABS}/tools/${name}" -done -cp -- "${RUNBOOK}" "${DEST_ABS}/HOW-TO-OPEN.txt" -cmp -s -- "${RUNBOOK}" "${DEST_ABS}/HOW-TO-OPEN.txt" || die "HOW-TO-OPEN.txt on the drive is not the runbook" - -# 7. The proof challenge. -write_proof() { # - local code="$1" id="$2"; shift 2 - local -a args=() - for r in "$@"; do args+=(--recipient "${r}"); done - mkdir -p -- "${DEST_ABS}/PROOF" - printf 'The code is: %s\n\nRead it to the person who asked you to open this.\n' "${code}" \ - | age "${args[@]}" --output "${DEST_ABS}/PROOF/proof.txt.age.part" - printf '%s\n' "${id}" > "${DEST_ABS}/PROOF/ID" - mv -- "${DEST_ABS}/PROOF/proof.txt.age.part" "${DEST_ABS}/PROOF/proof.txt.age" -} -if [[ ${MODE} == rehearse ]]; then - if [[ -n ${PROOF_RECIPIENT} ]]; then - write_proof "$(new_code)" "rehearsal-${STAMP}" "${PROOF_RECIPIENT}" - info "PROOF/ opens with the rehearsal key only; its code proves the rehearsal, not the holder" - fi - printf 'This drive holds a REHEARSAL of the household copy, written %s.\nIt is not the copy ADR-0023 asks for until a copy of record replaces this file.\n' "${STAMP}" > "${REHEARSAL_MARK}" -else - open_id="$(proof_field 1 || true)" - if [[ $(proof_field 3 || true) == pending && -f ${DEST_ABS}/PROOF/proof.txt.age \ - && $(cat "${DEST_ABS}/PROOF/ID" 2>/dev/null) == "${open_id}" ]]; then - info "the open proof challenge ${open_id} stays on the drive until it is proved" - else - mapfile -t holders <<<"${HOLDERS}" - code="$(new_code)" - write_proof "${code}" "${STAMP}" "${holders[@]}" - mkdir -p "${STATE_DIR}" - printf '%s\t%s\tpending\n' "${STAMP}" "$(code_sha "${code}")" > "${PROOF_STATE}.new" - mv "${PROOF_STATE}.new" "${PROOF_STATE}" - unset code - info "new proof challenge ${STAMP} written to PROOF/, encrypted to the household key only" - fi - rm -f -- "${REHEARSAL_MARK}" -fi - -sync -f "${DEST_ABS}" 2>/dev/null || sync -sweep_set_parts "${LIB_DST}" "${DOC_DST}" -prune_sets "${LIB_DST}" "${HOUSEHOLD_KEEP}" -prune_sets "${DOC_DST}" "${HOUSEHOLD_KEEP}" - -printf '\n' -if [[ ${MODE} == rehearse ]]; then - green "REHEARSAL written and proved on ${DEST_ABS} — nothing recorded; this is not the household's copy" -else - green "the drive holds the household's copy, proved: library $(basename "${lib_set}"), documents ${STAMP}. Unmount it and take it to the holder's address" -fi diff --git a/scripts/check_sops_rules.py b/scripts/check_sops_rules.py index 35c432ba..65890d09 100755 --- a/scripts/check_sops_rules.py +++ b/scripts/check_sops_rules.py @@ -40,24 +40,12 @@ 3. Which rule each path resolves to is printed, so the separation ADR-0020 decided is visible in CI output rather than inferred from two regexes. -4. **The household's recipients stay out of every rule** (ADR-0073). The keys - that open the household's copy live in stacks/sensitive/household.recipients, - not in a sops rule, because a key in the sensitive rule would also open the - tier's passwords. Nothing would stop a later `make secrets-add-recipient` - with the holder's key from collapsing that, so this fails on it: a - `household` key in any rule is an error. And the `technical-second` key there - must be the one the catch-all rule actually carries, so the file cannot - advertise a fallback that ADR-0024's proof never touches. A key in the - combined role, `household-and-technical-second` (one person in both, which - ADR-0073 allows), IS the technical second: it is held to the catch-all like - one, and is not a plain household key. - -5. **A file's recipients are its rule's** (#835). .sops.yaml is policy and the +4. **A file's recipients are its rule's** (#835). .sops.yaml is policy and the `sops:` block in each committed file is fact; they differ for as long as somebody added a key and forgot `sops updatekeys`, which is the window ADR-0024 calls a recovery path that does not exist. -6. **A stack whose key guards data has two recipients** (#835, ADR-0024). +5. **A stack whose key guards data has two recipients** (#835, ADR-0024). `secrets/sensitive.sops.yaml` was born with one on 2026-09-28, after #294 had closed, and its volume backups were encrypted to the same one key for days while the tier held the household's vault. Nothing noticed: no alert @@ -194,7 +182,7 @@ def check_recipients( rule_for: dict[str, set[str]], rule_of: dict[str, str] | None = None, ) -> list[str]: - """Checks 5 and 6: each file matches its rule, and the data-guarding ones + """Checks 4 and 5: each file matches its rule, and the data-guarding ones have two recipients. Pure, so --self-test can hand it fixtures. `rule_of` maps each file to its rule's path_regex, so the repair advice can @@ -397,40 +385,6 @@ def self_test() -> int: return 1 if failed else 0 -def check_household(rules: list[dict], matched_by: dict[str, str]) -> list[str]: - """ADR-0073: household keys in no rule; the technical second in the catch-all.""" - listed = subprocess.run( - [str(REPO / "scripts/household-recipients.sh"), "--roles"], - capture_output=True, - text=True, - check=False, - ) - if listed.returncode != 0: - return [f"stacks/sensitive/household.recipients: {listed.stderr.strip()}"] - - problems: list[str] = [] - catch_all = matched_by.get("secrets/observability.sops.yaml") - catch_all_keys = next((rule_keys(r) for r in rules if r.get("path_regex") == catch_all), set()) - for line in listed.stdout.splitlines(): - role, key = line.split(" ", 1) - if role == "household": # the combined role is the technical second, below - for rule in rules: - if key in rule_keys(rule): - problems.append( - f"household key {key} is a recipient of creation_rule " - f"{rule.get('path_regex')!r} — it would open that rule's " - f"secrets, which is what ADR-0073 keeps it out of. Take it " - f"out of {POLICY.name} and run `sops updatekeys`" - ) - elif role in ("technical-second", "household-and-technical-second") and key not in catch_all_keys: - problems.append( - f"{role} key {key} in stacks/sensitive/household.recipients " - f"is not a recipient of the catch-all rule — ADR-0024's proof covers " - f"that rule's keys, so this one is a fallback nothing has proved" - ) - return problems - - def main() -> int: if not POLICY.exists(): print(f"no {POLICY.name}", file=sys.stderr) @@ -480,10 +434,9 @@ def main() -> int: f"this rule was added for is not in effect (ADR-0020)" ) - problems.extend(check_household(rules, matched_by)) problems.extend(check_separation(rules, matched_by)) - # Checks 5 and 6, over every committed secrets file, tofu's included. + # Checks 4 and 5, over every committed secrets file, tofu's included. files: dict[str, set[str]] = {} rule_for: dict[str, set[str]] = {} rule_of: dict[str, str] = {} diff --git a/scripts/household-recipients.sh b/scripts/household-recipients.sh deleted file mode 100755 index 7c9e866e..00000000 --- a/scripts/household-recipients.sh +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/env bash -# -# Who can open the household's copy, read out of the one file that says so. -# -# WHY A FILE OF ITS OWN AND NOT A SOPS RULE -# -# ADR-0073. The household's archive has to open with a key that is not only -# the operator's (ADR-0023), and the obvious place to add one — the sensitive -# rule in .sops.yaml — would also hand that key secrets/sensitive.sops.yaml: -# the tier's passwords, Vaultwarden's admin token among them. The person who -# holds the household's photographs has no use for those, and ADR-0048 already -# made the estate's rule that one key doing two jobs means one leak takes both. -# So the household's recipients live in stacks/sensitive/household.recipients, -# which encrypts the library and document sets and opens nothing in secrets/. -# scripts/check_sops_rules.py holds the line: a `household` key in any sops -# rule fails it. -# -# THE FORMAT -# -# The file is valid input to `age -R` as it stands — comments and keys, one per -# line — so the holder's own copy of it is usable without this script. What -# this adds is a role per key, as the comment line directly above it: -# -# # role: household (who, generated on their own device, when) -# age1... -# # role: technical-second (ADR-0024's; the catch-all rule's second key) -# age1... -# -# `household` is the person ADR-0023 is about: the one who opens the copy from -# their own device without the operator there. `technical-second` is ADR-0024's -# recipient, carried here as the fallback the 2026-09-22 comment on #455 -# recommends — not instead of the household key. If they turn out to be the -# same person, ADR-0073 says the two collapse to one recipient, and that one -# key is written once under the third role, `household-and-technical-second`: -# it counts as a holder, it is the fallback, and, being the technical second, -# it stays in the catch-all rule where check_sops_rules.py would refuse a -# plain `household` key. -# -# Every file needs a fallback: a technical second, or the combined role. A -# household key alone is refused, because the sets made from it would have no -# second way in. A key with no role, a role with no key, an unknown role, a -# duplicate and a line that is not a valid recipient (the Bech32 checksum -# included, so one mistyped character is caught here and not by age halfway -# through an archive) are each refused by name: a recipients file read -# leniently is how a recovery path gets advertised that opens nothing. -# -# Usage: -# scripts/household-recipients.sh --list [--role ] keys, one per line; --role household -# or technical-second includes the combined role -# scripts/household-recipients.sh --roles " ", one per line -# scripts/household-recipients.sh --check parse, and say what the file holds -# scripts/household-recipients.sh --has-holder exit 0 iff a household key exists -# scripts/household-recipients.sh --self-test -# -# --file read another file (default stacks/sensitive/household.recipients) - -set -euo pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -FILE="${REPO_ROOT}/stacks/sensitive/household.recipients" -MODE="" -ROLE="" - -die() { printf '\033[0;31merror:\033[0m %s\n' "$*" >&2; exit 1; } -usage() { sed -n '/^# Usage:/,/^$/p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'; } - -# --------------------------------------------------------------------------- -# --self-test -# --------------------------------------------------------------------------- -if [[ "${1:-}" == "--self-test" ]]; then - T="$(mktemp -d)" - trap 'rm -rf "${T}"' EXIT - fail=0 - # Real recipients, made with age-keygen for this test; public halves only. - K1=age1mt2p3n6xqzevjyqq7qpxhwc3zk6wlc3qace6rj5qfhhkzhl3gyqsq5r349 - K2=age1vfe5xddxdzh5ggqmhhte0l78s2ktvmuzyjrfpjsemuez5q9z8u2q9cdlwz - run() { # → OUT, RC - local body="$1"; shift - printf '%s' "${body}" > "${T}/r" - set +e - OUT="$("${BASH_SOURCE[0]}" --file "${T}/r" "$@" 2>&1)" - RC=$? - set -e - } - check() { # - if [[ ${RC} == "$2" && ${OUT} == *"$3"* ]]; then - printf '\033[0;32m PASS\033[0m %s\n' "$1" - else - printf '\033[0;31m FAIL\033[0m %s\n exit %s, wanted %s; wanted output containing: %s\n' "$1" "${RC}" "$2" "$3" - printf '%s\n' "${OUT}" | sed 's/^/ | /' - fail=1 - fi - } - - both="# a comment -# role: household (someone, 2026-10-01) -${K1} - -# role: technical-second -${K2} -" - run "${both}" --list - check "both keys are listed, in file order" 0 "${K1} -${K2}" - run "${both}" --list --role household - check "--role picks one role's keys" 0 "${K1}" - [[ ${OUT} != *"${K2}"* ]] || { printf '\033[0;31m FAIL\033[0m --role leaked the other role\n'; fail=1; } - run "${both}" --roles - check "--roles pairs each key with its role" 0 "technical-second ${K2}" - run "${both}" --has-holder - check "a household key is a holder" 0 "" - - second="# role: technical-second -${K2} -" - run "${second}" --has-holder - check "the technical second alone is not a holder" 1 "" - run "${second}" --check - check "--check says so in words" 0 "no household holder" - - run "# role: household -${K1} -" --list - check "a household key with no fallback is refused" 1 "no technical-second key" - run "# role: household-and-technical-second -${K1} -" --has-holder - check "one person in both roles is a holder" 0 "" - run "# role: household-and-technical-second -${K1} -" --list --role technical-second - check "and the fallback" 0 "${K1}" - run "# role: household-and-technical-second -${K1} -" --list --role household - check "and listed as the household's too" 0 "${K1}" - run "# role: household -${K1%?}x -# role: technical-second -${K2} -" --list - check "a recipient with one character mistyped fails its checksum" 1 "checksum is wrong" - - run "${K1} -" --list - check "a key with no role is refused" 1 "has no '# role:' line above it" - run "# role: household -# role: technical-second -${K1} -" --list - check "a role with no key is refused" 1 "names no key" - run "# role: household -" --list - check "a role at the end of the file is refused" 1 "names no key" - run "# role: neighbour -${K1} -" --list - check "an unknown role is refused" 1 "unknown role 'neighbour'" - run "# role: household -${K1} -# role: technical-second -${K1} -" --list - check "a key listed twice is refused" 1 "listed twice" - run "# role: household -age1notakey -" --list - check "a line that is not a key is refused" 1 "is not an age recipient" - run $'# role: household\n'"${K1}"$' \n' --list - check "trailing whitespace is refused, not trimmed" 1 "is not an age recipient" - run "" --check - check "an empty file is refused" 1 "holds no recipients" - set +e - OUT="$("${BASH_SOURCE[0]}" --file "${T}/absent" --list 2>&1)"; RC=$? - set -e - check "a missing file is refused" 1 "no recipients file" - - exit "${fail}" -fi - -while (($#)); do - case "$1" in - --list) MODE="list"; shift ;; - --roles) MODE="roles"; shift ;; - --check) MODE="check"; shift ;; - --has-holder) MODE="has-holder"; shift ;; - --role) ROLE="${2:-}"; shift 2 ;; - --file) FILE="${2:-}"; shift 2 ;; - -h|--help) usage; exit 0 ;; - *) usage >&2; die "unknown argument: $1" ;; - esac -done -[[ -n ${MODE} ]] || { usage >&2; die "say what to do"; } -[[ -z ${ROLE} || ${ROLE} == household || ${ROLE} == technical-second ]] \ - || die "--role is household or technical-second, got '${ROLE}'" - -# An age recipient is Bech32 (BIP 173) with the human-readable part "age". The -# alphabet and the length are not enough: a single mistyped character keeps -# both and fails only the checksum, and age would then reject it after the -# library's tar had already started. -CHARSET=qpzry9x8gf2tvdw0s3jn54khce6mua7l -bech32_ok() { # - local data="${1#age1}" chk=1 v b i c - local -a gen=(0x3b6a57b2 0x26508e6d 0x1ea119fa 0x3d4233dd 0x2a1462b3) - # hrp_expand("age"): the high bits of each character, a 0, the low bits. - local -a vals=(3 3 3 0 1 7 5) - for ((i = 0; i < ${#data}; i++)); do - c="${CHARSET%%"${data:i:1}"*}" - vals+=("${#c}") - done - for v in "${vals[@]}"; do - b=$((chk >> 25)) - chk=$((((chk & 0x1ffffff) << 5) ^ v)) - for i in 0 1 2 3 4; do (((b >> i) & 1)) && chk=$((chk ^ gen[i])); done - done - ((chk == 1)) -} -is_holder() { [[ $1 == household || $1 == household-and-technical-second ]]; } -is_second() { [[ $1 == technical-second || $1 == household-and-technical-second ]]; } -[[ -r ${FILE} ]] || die "no recipients file at ${FILE}" - -# --------------------------------------------------------------------------- -# Parse. Every refusal names the line, because the file is edited by hand. -# --------------------------------------------------------------------------- -KEY_RE='^age1[02-9ac-hj-np-z]{58}$' -ROLE_RE='^#[[:space:]]*role:[[:space:]]*([A-Za-z0-9_-]+)([[:space:]].*)?$' -pending="" pending_at=0 n=0 -roles=() keys=() -declare -A seen=() -while IFS= read -r line || [[ -n ${line} ]]; do - n=$((n + 1)) - if [[ ${line} =~ ${ROLE_RE} ]]; then - [[ -z ${pending} ]] || die "${FILE}:${pending_at}: '# role: ${pending}' names no key — the next line that is not a comment must be its key" - case "${BASH_REMATCH[1]}" in - household|technical-second|household-and-technical-second) ;; - *) die "${FILE}:${n}: unknown role '${BASH_REMATCH[1]}' — the roles are household, technical-second and household-and-technical-second (ADR-0073)" ;; - esac - pending="${BASH_REMATCH[1]}" pending_at="${n}" - continue - fi - [[ -z ${line} || ${line} == \#* ]] && continue - [[ ${line} =~ ${KEY_RE} ]] || die "${FILE}:${n}: '${line}' is not an age recipient (age1 and 58 characters, nothing else on the line)" - bech32_ok "${line}" || die "${FILE}:${n}: '${line}' is not an age recipient — its checksum is wrong, so a character was mistyped; copy the age1 line again" - [[ -n ${pending} ]] || die "${FILE}:${n}: ${line} has no '# role:' line above it — say whose key it is" - [[ -z ${seen[${line}]:-} ]] || die "${FILE}:${n}: ${line} is listed twice (first at line ${seen[${line}]})" - seen[${line}]="${n}" - roles+=("${pending}") - keys+=("${line}") - pending="" -done < "${FILE}" -[[ -z ${pending} ]] || die "${FILE}:${pending_at}: '# role: ${pending}' names no key — the next line that is not a comment must be its key" -((${#keys[@]})) || die "${FILE} holds no recipients" - -holders=0 seconds=0 -for r in "${roles[@]}"; do - if is_holder "${r}"; then holders=$((holders + 1)); fi - if is_second "${r}"; then seconds=$((seconds + 1)); fi -done -((seconds)) || die "${FILE} has no technical-second key — ADR-0073 encrypts the household's copy to a fallback as well, so the sets made from this file would have no second way in" - -case "${MODE}" in - list) - for i in "${!keys[@]}"; do - if [[ -z ${ROLE} ]] || { [[ ${ROLE} == household ]] && is_holder "${roles[i]}"; } \ - || { [[ ${ROLE} == technical-second ]] && is_second "${roles[i]}"; }; then - printf '%s\n' "${keys[i]}" - fi - done - ;; - roles) - for i in "${!keys[@]}"; do printf '%s %s\n' "${roles[i]}" "${keys[i]}"; done - ;; - check) - printf '%s: %d recipient(s), %d household\n' "${FILE#"${REPO_ROOT}"/}" "${#keys[@]}" "${holders}" - ((holders)) || printf 'no household holder yet — the copy does not meet ADR-0023 until one is added (ADR-0073)\n' - ;; - has-holder) - ((holders)) - ;; -esac diff --git a/scripts/install-timers.sh b/scripts/install-timers.sh index 17f8c518..57b41d25 100755 --- a/scripts/install-timers.sh +++ b/scripts/install-timers.sh @@ -161,20 +161,17 @@ JOBS=( # sensitive tier's volumes, which also copies each set to oracle (#535), and # the nightly copy of Immich's library, which no volume set can hold # (ADR-0064). Two days each, twice the daily period, for the same reason as -# every row above. And two deadlines with no timer, for the household's copy -# (ADR-0073): household-copy, ninety days like offsite-copy, because a drive at -# the holder's address is visited, not scheduled; and household-proof, a year, -# because the holder's own proof rides ADR-0011's annual drill. Both are read -# by HouseholdCopyStale, not ScheduledJobStale. And the hourly convergence of -# the tier onto main (#533), three hours for the reason the estate's converge -# row gives. converge-sensitive, not converge: the job name is -# what keeps the alert joins one-to-one across hosts, so it must not reuse a -# name from JOBS — check 8 below asserts that. And the nightly re-verification +# every row above. And the hourly convergence of the tier onto main (#533), +# three hours for the reason the estate's converge row gives. +# converge-sensitive, not converge: the job name is what keeps the alert joins +# one-to-one across hosts, so it must not reuse a name from JOBS — check 8 +# below asserts that. And the nightly re-verification # of both kinds of set, here and on oracle (#856): verify-backups-sensitive, # two days for the same reason as the backups it re-reads. And the daily SMART # read of trinity's own disks, smart-state-sensitive, two days like the # estate's smart-state; its unit says why it is not `make smart-state`. There -# is no age-key proof row here either (ADR-0120). +# is no age-key proof row here either (ADR-0120), and no household-copy or +# household-proof row since ADR-0122 dropped the household copy. # # The units under systemd/sensitive/ carry @DEPLOY_ROOT@, @RUN_USER@, # @RUN_GROUP@ and @RUN_HOME@ rather than a name, because the build runbook @@ -187,8 +184,6 @@ SENSITIVE_JOBS=( "converge-sensitive homelab-converge-sensitive 10800 converge" "verify-backups-sensitive homelab-verify-backups-sensitive 172800 verify-backups" "smart-state-sensitive homelab-smart-state-sensitive 172800 smart-state-sensitive" - "household-copy - 7776000 household-copy" - "household-proof - 31536000 household-proof" ) die() { printf '\033[0;31merror:\033[0m %s\n' "$*" >&2; exit 1; } @@ -515,8 +510,8 @@ if [[ "${MODE}" == check ]]; then run_home="$(getent passwd "${run_user}" | cut -d: -f6)" for row in "${SENSITIVE_JOBS[@]}"; do unit="$(job_unit "${row}")" - # household-copy and household-proof are human jobs, "-" as on the - # estate's side: no timer to be enabled (ADR-0073). + # A "-" unit is a deadline declared for a human, as on the estate's + # side: no timer to be enabled. trinity has none since ADR-0122. [[ "${unit}" == "-" ]] && continue state="$(systemctl is-enabled "${unit}.timer" 2>/dev/null || true)" case "${state}" in diff --git a/scripts/medium.sh b/scripts/medium.sh index c371cf97..94d053ed 100644 --- a/scripts/medium.sh +++ b/scripts/medium.sh @@ -4,14 +4,13 @@ # refusals that keep the medium from being this host in disguise, and the # standard set's copy, proof and retention on it. # -# Two scripts source this, and their media differ. backup-offsite.sh writes the -# estate's sets to the second age recipient's medium (ADR-0048). -# carry-household-copy.sh writes the household's sets to the drive at the -# holder's address (ADR-0073). Everything here is the same for both, so it was -# moved out of backup-offsite.sh rather than copied, with only the names that -# differ between the two passed in as arguments. The offsite -# self-test still asserts every refusal and every proof through the original -# script, and it passed unedited after the move. +# backup-offsite.sh sources this, and writes the estate's sets to the second +# age recipient's medium (ADR-0048). It was moved out of that script for a +# second caller, the household copy's carry (ADR-0073), with the names that +# differed between the two passed in as arguments. ADR-0122 removed that +# caller; the arguments stay, because they cost nothing and the next medium +# would need them again. The offsite self-test asserts every refusal and every +# proof through backup-offsite.sh. # # Sourced AFTER scripts/backup-volumes.sh, which supplies is_stamp, # manifest_volumes, manifest_sha and the colours. Defines functions only, and diff --git a/stacks/observability/README.md b/stacks/observability/README.md index ebd8d959..40a594e1 100644 --- a/stacks/observability/README.md +++ b/stacks/observability/README.md @@ -53,7 +53,7 @@ prometheus/ targets/snmp.yaml SNMP targets — hot-reloaded, no restart needed targets/node.yaml node_exporter scrapes, for the host that runs no Alloy (smaug) targets/blackbox*.yaml probe targets, http, dns and latency — hot-reloaded, no restart - rules/*.rules.yaml 162 alert rules: host, network, ups, containers, blackbox, + rules/*.rules.yaml 161 alert rules: host, network, ups, containers, blackbox, dns, backup, ids, deploy, stack, internet and watchdog tests/*.test.yaml promtool unit tests — assert the rules can fire blackbox/blackbox.yaml probe modules — reachability, and what a resolver said diff --git a/stacks/observability/prometheus/rules/backup.rules.yaml b/stacks/observability/prometheus/rules/backup.rules.yaml index fafe8427..2d728748 100644 --- a/stacks/observability/prometheus/rules/backup.rules.yaml +++ b/stacks/observability/prometheus/rules/backup.rules.yaml @@ -26,15 +26,17 @@ # the one exception, and they name the jobs that are not timers: the human # proofs — verify-ca-key-backup, whose deadline is applied to the CA key's # current fingerprint (#496), offsite-copy, the newest set of each kind carried -# onto the second recipient's medium (ADR-0048), and the household's pair -# (ADR-0073). +# onto the second recipient's medium (ADR-0048). # # The age-key proof is no longer one of them. ADR-0120 dropped its deadline: # verify-key-backup and verify-key-backup-sensitive are not declared any more, # and SecretsKeyBackupUnproven and SecretsKeyRecipientsUnrecorded are gone. -# Both names stay in the exclusions below, and ScheduledJobNeverRan and -# ScheduledJobFailed skip them too, so a host whose homelab-jobs.prom was written before that change stays -# quiet until `make install-timers` rewrites it. +# Nor is the household's pair. ADR-0122 dropped the household copy: +# household-copy and household-proof are not declared any more, and +# HouseholdCopyStale is gone. All four names stay in the exclusions below, and +# ScheduledJobNeverRan and ScheduledJobFailed skip them too, so a host whose +# homelab-jobs.prom was written before those changes stays quiet until +# `make install-timers` rewrites it. # # That claim has since been tested rather than merely asserted. #99 added # `converge`, an hourly job on a different cadence to everything above, and @@ -82,10 +84,10 @@ groups: # something different about it and earns its own description, and # offsite-copy for OffsiteCopyStale. Both are human runs against a # mounted medium: "check the journal" would be wrong advice for - # either. household-copy and household-proof are the same shape, and - # HouseholdCopyStale reads them (ADR-0073). verify-key-backup and - # verify-key-backup-sensitive have no deadline since ADR-0120 and are - # excluded only for a host whose declarations predate it (header). + # either. verify-key-backup and verify-key-backup-sensitive have no + # deadline since ADR-0120, and household-copy and household-proof none + # since ADR-0122; they are excluded only for a host whose declarations + # predate those (header). expr: | (time() - homelab_job_last_success_timestamp_seconds{ homelab_job!~"verify-key-backup|verify-key-backup-sensitive|verify-ca-key-backup|offsite-copy|household-copy|household-proof"}) @@ -162,8 +164,12 @@ groups: # # The age-key check is skipped. Since ADR-0120 it is optional and run # by hand, so a failure is already on the screen of the person who ran - # it, and an alert that waits for a re-run would nag about it. - expr: homelab_job_last_exit_code{homelab_job!~"verify-key-backup|verify-key-backup-sensitive"} != 0 + # it, and an alert that waits for a re-run would nag about it. The + # household pair is skipped because ADR-0122 removed it: an exit code + # left from before that is not a job anyone will run again. + expr: | + homelab_job_last_exit_code{ + homelab_job!~"verify-key-backup|verify-key-backup-sensitive|household-copy|household-proof"} != 0 for: 10m labels: component: backup @@ -181,10 +187,11 @@ groups: # job has never run, or its .prom file was deleted. # # The age-key proof jobs are skipped: ADR-0120 removed their deadline, - # and a row left in a homelab-jobs.prom written before that is not a - # job anyone is expected to run (header). + # and ADR-0122 removed the household pair. A row left in a + # homelab-jobs.prom written before that is not a job anyone is + # expected to run (header). expr: | - homelab_job_max_age_seconds{homelab_job!~"verify-key-backup|verify-key-backup-sensitive"} + homelab_job_max_age_seconds{homelab_job!~"verify-key-backup|verify-key-backup-sensitive|household-copy|household-proof"} unless on(homelab_job) homelab_job_last_success_timestamp_seconds for: 1h labels: @@ -322,44 +329,3 @@ groups: and run `make backup-offsite DEST=`; it re-verifies what is there, copies the newest of each kind and proves the copy: docs/runbooks/copy-the-backups-offsite.md. - - - alert: HouseholdCopyStale - # The household's photographs and documents, off the estate on the - # drive the household holder keeps at their own address (ADR-0023, - # ADR-0073). Two deadlines, both human, both read here: - # - # household-copy ninety days. A visit to the drive: make - # household-copy re-verifies what it holds, carries - # the newest library set and a fresh Paperless - # export, and proves the copy. The nightly copy to - # oracle (ADR-0064) covers the disk between visits, - # but not the house. - # household-proof a year. The holder opened the copy on their own - # device, without the operator, and read back the - # code only their key opens. ADR-0023's second - # condition, on ADR-0011's annual drill. - # - # Not OffsiteCopyStale: a different medium, another host, and a - # different reader, so "mount the second recipient's medium" would be - # wrong advice. The shape is that rule's: one series per job, the - # threshold from install-timers.sh's sensitive rows, joined with - # group_left() so `instance` survives. ScheduledJobNeverRan covers the - # cold start, and it fires until there is a holder, which is the - # honest state: the copy of record refuses to run without one. - expr: | - (time() - homelab_job_last_success_timestamp_seconds{homelab_job=~"household-copy|household-proof"}) - > on(homelab_job) group_left() homelab_job_max_age_seconds - for: 1h - labels: - component: backup - severity: warning - category: correctness - annotations: - summary: "{{ $labels.homelab_job }} last succeeded {{ $value | humanizeDuration }} ago" - description: >- - The household's off-estate copy is out of date ({{ $labels.homelab_job }}). - For household-copy, bring the drive back to trinity and run `make - household-copy DEST=`: docs/runbooks/carry-the-household-copy.md. - For household-proof, the holder opens PROOF/ on their own device and - reads you the code, then `make household-proof CODE=`: - docs/runbooks/open-the-household-copy.md. diff --git a/stacks/observability/prometheus/tests/backup.test.yaml b/stacks/observability/prometheus/tests/backup.test.yaml index 0948dfde..eddf1c55 100644 --- a/stacks/observability/prometheus/tests/backup.test.yaml +++ b/stacks/observability/prometheus/tests/backup.test.yaml @@ -193,17 +193,47 @@ tests: alertname: ScheduledJobNeverRan exp_alerts: [] + # --- The household pair's leftover rows are no rule's business either ---- + # + # ADR-0122 removed household-copy and household-proof. On a trinity whose + # homelab-jobs.prom predates it, household-copy is declared and never ran, + # and household-proof has a stale success: neither is a stale-job alert, + # a page or a never-ran. + - interval: 1m + input_series: + - series: 'homelab_job_max_age_seconds{homelab_job="household-copy", instance="trinity"}' + values: "3600+0x1560" + - series: 'homelab_job_last_success_timestamp_seconds{homelab_job="household-proof", instance="trinity"}' + values: "0+0x1560" + - series: 'homelab_job_max_age_seconds{homelab_job="household-proof", instance="trinity"}' + values: "3600+0x1560" + alert_rule_test: + - eval_time: 2h30m + alertname: ScheduledJobStale + exp_alerts: [] + - eval_time: 2h30m + alertname: ScheduledJobNeverRan + exp_alerts: [] + - eval_time: 25h + alertname: ScheduledJobStaleCritical + exp_alerts: [] + # --- ScheduledJobFailed: a failed optional age-key check is not paged --- # # make secrets-verify-backup still records its exit code. A failed run, or # a failure left over from before ADR-0120, does not alert; the person who - # ran it saw the failure. + # ran it saw the failure. A failure the household pair left before + # ADR-0122 removed it does not alert either. - interval: 1m input_series: - series: 'homelab_job_last_exit_code{homelab_job="verify-key-backup", instance="prometheus"}' values: "1+0x60" - series: 'homelab_job_last_exit_code{homelab_job="verify-key-backup-sensitive", instance="trinity"}' values: "2+0x60" + - series: 'homelab_job_last_exit_code{homelab_job="household-copy", instance="trinity"}' + values: "1+0x60" + - series: 'homelab_job_last_exit_code{homelab_job="household-proof", instance="trinity"}' + values: "1+0x60" alert_rule_test: - eval_time: 30m alertname: ScheduledJobFailed @@ -329,80 +359,6 @@ tests: alertname: ScheduledJobStale exp_alerts: [] - # --- HouseholdCopyStale: two human jobs, read by one rule ----------------- - # - # household-copy is over its 1h threshold at t=2h30m and household-proof is - # not (a day). Only the first fires, it keeps `instance`, and neither - # surfaces as ScheduledJobStale. - - interval: 1m - input_series: - - series: 'homelab_job_last_success_timestamp_seconds{homelab_job="household-copy", instance="trinity"}' - values: "0+0x180" - - series: 'homelab_job_max_age_seconds{homelab_job="household-copy", instance="trinity"}' - values: "3600+0x180" - - series: 'homelab_job_last_success_timestamp_seconds{homelab_job="household-proof", instance="trinity"}' - values: "0+0x180" - - series: 'homelab_job_max_age_seconds{homelab_job="household-proof", instance="trinity"}' - values: "86400+0x180" - alert_rule_test: - - eval_time: 1h30m - alertname: HouseholdCopyStale - exp_alerts: [] - - eval_time: 2h30m - alertname: HouseholdCopyStale - exp_alerts: - - exp_labels: - alertname: HouseholdCopyStale - homelab_job: household-copy - instance: trinity - component: backup - severity: warning - category: correctness - exp_annotations: - summary: "household-copy last succeeded 2h 30m 0s ago" - description: >- - The household's off-estate copy is out of date (household-copy). - For household-copy, bring the drive back to trinity and run `make - household-copy DEST=`: docs/runbooks/carry-the-household-copy.md. - For household-proof, the holder opens PROOF/ on their own device and - reads you the code, then `make household-proof CODE=`: - docs/runbooks/open-the-household-copy.md. - - eval_time: 2h30m - alertname: ScheduledJobStale - exp_alerts: [] - - # The proof past its own threshold fires as household-proof, by the same - # join; the year is install-timers.sh's, scaled to an hour here. - - interval: 1m - input_series: - - series: 'homelab_job_last_success_timestamp_seconds{homelab_job="household-proof", instance="trinity"}' - values: "0+0x180" - - series: 'homelab_job_max_age_seconds{homelab_job="household-proof", instance="trinity"}' - values: "3600+0x180" - alert_rule_test: - - eval_time: 2h30m - alertname: HouseholdCopyStale - exp_alerts: - - exp_labels: - alertname: HouseholdCopyStale - homelab_job: household-proof - instance: trinity - component: backup - severity: warning - category: correctness - exp_annotations: - summary: "household-proof last succeeded 2h 30m 0s ago" - description: >- - The household's off-estate copy is out of date (household-proof). - For household-copy, bring the drive back to trinity and run `make - household-copy DEST=`: docs/runbooks/carry-the-household-copy.md. - For household-proof, the holder opens PROOF/ on their own device and - reads you the code, then `make household-proof CODE=`: - docs/runbooks/open-the-household-copy.md. - - eval_time: 2h30m - alertname: ScheduledJobStale - exp_alerts: [] - # --- ScheduledJobFailed: fires on non-zero, silent on zero --------------- - interval: 1m input_series: diff --git a/stacks/sensitive/README.md b/stacks/sensitive/README.md index 3e3f71b9..64067a87 100644 --- a/stacks/sensitive/README.md +++ b/stacks/sensitive/README.md @@ -30,8 +30,9 @@ under [#404]. It was authored ahead of the hardware, the way `stacks/lab` was, a the first start found five things that the file could not show; the sections below carry each of them. **It holds real data since 2026-09-28** — Immich's first 615 photographs, which arrived before the off-estate copy that #404 step -10 gates them on; [*What backs Immich up*](#what-backs-immich-up-and-what-does-not-yet) -says what that leaves exposed. +10 then gated them on. [ADR-0122] has since dropped that copy; +[*What backs Immich up*](#what-backs-immich-up-and-what-does-not-yet) says +what that leaves exposed. ```bash make up STACK=sensitive @@ -151,8 +152,6 @@ stirling-pdf/smoke.sh proves the PDF engine works, not just its status endp mosquitto/ the broker's config and ACL, mounted read-only, and a smoke.sh that signs in as both users (ADR-0104) ring-mqtt/smoke.sh proves ring-mqtt reads its config under its hardening -household.recipients the age public keys that can open the household's copies -household-age.sha256 checksums of the age release the household copy is opened with consume/ untracked: drop a scan here and Paperless-ngx imports and deletes it. Created by render-config.sh export/ untracked: where document_exporter writes. Likewise @@ -453,19 +452,15 @@ The version-portable form is the exporter — `docker compose exec paperless document_exporter ../export`, into `export/` — which writes every document with a `manifest.json` that a fresh install of the *same* version re-imports. Upstream is explicit that an export does not cross versions, so it is the -form to send off-estate rather than the form to rely on across an upgrade. +form to keep for a move between installs rather than the form to rely on +across an upgrade. One thing this does **not** do, stated rather than implied. It is scheduled: `homelab-backup-sensitive` runs it nightly on `trinity` and copies -each set to `oracle` ([#404] step 9). But **nothing here is the off-estate copy** -[ADR-0023] requires before the first real document — encrypted, keyed to a -second holder, with visible freshness. That copy is now built: `make -household-copy` runs the exporter above, archives `export/` into a standard -set encrypted to [`household.recipients`](household.recipients) as well, and -carries it to the household drive ([ADR-0073], -[`carry-the-household-copy.md`](../../docs/runbooks/carry-the-household-copy.md)). -It refuses a copy of record until there is a household holder, so the -precondition on the data arriving is still open. +each set to `oracle` ([#404] step 9). But **nothing here is a copy outside the +house**, and none is planned: [ADR-0122] dropped the household copy that +[ADR-0023] required and [ADR-0073] built. A loss of the house loses the +documents. ## Vaultwarden @@ -559,14 +554,12 @@ The household's notes, and the second *Tier extras* service — `memos_prod.db` is a 4 KB header and everything else is in the `-wal`, which a clean stop checkpoints back — and attachments are files under `./assets`. The backup names all three. -- **Durable, under [ADR-0023], and running ahead of it.** The class - requires an off-estate copy before real notes, for the same reason as - Paperless-ngx. It holds real notes since 2026-10-22 anyway, by the - operator's accepted exception: the household's shared plan, which also - lives outside the estate, so this is not its only copy. What backs it up - today is the nightly volume set on `oracle`, age ciphertext, off-host and - not off-estate. `make household-copy` does not carry `memos-data`, and - until [#455] does, the class's condition is still owed. +- **Durable, under [ADR-0023].** The class required an off-estate copy + before real notes, until [ADR-0122] dropped that requirement. It holds real + notes since 2026-10-22, the household's shared plan, which also lives + outside the estate, so this is not its only copy. What backs it up + is the nightly volume set on `oracle`, age ciphertext, off-host and not + off-estate, and [ADR-0122] says that is all there will be. - **Two admins, and the settings that came with the first real notes** (2026-10-22), all in the database and none in this file: public access off, so a signed-out visitor gets nothing; the content length limit at @@ -1313,9 +1306,9 @@ the night it was written fails the next morning, as `verify-backups-sensitive`. The units and their installer are in [`schedule-maintenance.md`](../../docs/runbooks/schedule-maintenance.md#on-trinity-the-sensitive-profile). What this does **not** give is a copy off the estate. `oracle` is in the same -room and on the same power, and [ADR-0023] requires that copy before Immich or -Paperless-ngx hold a real file. It is step 10's, and [ADR-0073]'s: -built, and waiting on a holder. +room and on the same power. [ADR-0023] required that copy before Immich or +Paperless-ngx held a real file, and [ADR-0122] dropped the requirement: there +is no copy outside the house. And the volumes are not the photographs: the library is a bind mount, and no volume set contains it. Its own sets are the next section's. @@ -1326,24 +1319,23 @@ The photographs are the household data most likely to be irreplaceable, and and an off-estate copy whose staleness is visible was to exist before the first real photo arrived. It did not; the warning below is the record. Three things hold the data. Each is copied off the host now, and none is copied -off the estate: the copy [ADR-0023] requires, the one that covers the first -two rows, still does not exist. +off the estate. [ADR-0122] dropped that copy, so none will be: a loss of the +house loses the photographs. > [!WARNING] > **The first real photographs arrived before that copy did.** Two accounts > uploaded 615 assets between 16:59 and 17:01 UTC on 2026-09-28 — the day the -> host was built, with [#455] undelivered and [ADR-0022]'s record and -> [ADR-0023]'s *Independent* test still open. For their first day the USB disk -> was the only copy of the originals anywhere. Since 2026-09-29 a nightly set -> goes to `oracle` ([ADR-0064]), so losing the disk no longer loses them. That -> copy is in the same room and on the same power. Since 2026-10-01 it is -> encrypted to [`household.recipients`](household.recipients) as well as to -> `trinity`'s key ([ADR-0073]). It does not satisfy [ADR-0023], and this -> warning stands until [#455] exists. +> host was built, with the off-estate copy undelivered and [ADR-0022]'s record +> and [ADR-0023]'s *Independent* test still open. For their first day the USB +> disk was the only copy of the originals anywhere. Since 2026-09-29 a nightly +> set goes to `oracle` ([ADR-0064]), so losing the disk no longer loses them. +> That copy is in the same room and on the same power. [ADR-0122] dropped the +> off-estate copy on 2026-11-21, so `oracle`'s is the only other copy there +> will be. | What | Where | Protected by | | --- | --- | --- | -| The originals | `IMMICH_UPLOAD_LOCATION` — the USB disk | **Off-host, interim:** `make backup-library`, nightly at 05:15 ([ADR-0064]). One encrypted archive of `upload/`, `library/`, `profile/` and `backups/`, two sets kept on `trinity`'s SSD and two on `oracle`, and `ARGS=--prove` hashes each original against `immich-db`. Each set is encrypted to the sensitive rule's recipients and to [`household.recipients`](household.recipients) ([ADR-0073]). **Off-estate: built, waiting on a holder.** `make household-copy` carries the newest set to the household drive, a WD Elements 5 TB under [#455], every ninety days ([ADR-0073], [`carry-the-household-copy.md`](../../docs/runbooks/carry-the-household-copy.md)). It refuses a copy of record until [`household.recipients`](household.recipients) has a household key | +| The originals | `IMMICH_UPLOAD_LOCATION` — the USB disk | **Off-host:** `make backup-library`, nightly at 05:15 ([ADR-0064]). One encrypted archive of `upload/`, `library/`, `profile/` and `backups/`, two sets kept on `trinity`'s SSD and two on `oracle`, and `ARGS=--prove` hashes each original against `immich-db`. Each set is encrypted to the sensitive rule's recipients. **Off-estate: none**, by [ADR-0122] | | Thumbnails and transcodes | The same disk, `thumbs/` and `encoded-video/` | Nothing, on purpose. They are derived from the originals, and a restore regenerates them from Immich's *Jobs* page. Only their `.immich` markers are archived, because the server will not start without them | | Immich's own nightly database dump | `IMMICH_UPLOAD_LOCATION/backups/`, `.sql.gz`, fourteen kept, 02:00 by default | It sits on the same disk on purpose, so a copy of the disk is also a copy of the metadata. It rides in every library set, three hours old at most, so each set is a restore unit on its own | | The live database | The `immich-db` named volume, on the SSD | `make backup STACK=sensitive`, since [#131] closed [#428]: sentinel `PG_VERSION`, owner `999`, encrypted to `trinity`'s own recipients, and copied to `oracle` by the same run. Immich's dump on the USB disk is the second route to the same metadata | @@ -1455,6 +1447,7 @@ it matters: [ADR-0104]: ../../docs/adr/0104-bring-the-ring-alarm-into-home-assistant-through-ring-mqtt.md [ADR-0064]: ../../docs/adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md [ADR-0073]: ../../docs/adr/0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md +[ADR-0122]: ../../docs/adr/0122-drop-the-household-copy.md [#129]: https://github.com/Gerrrt/HomeLab/issues/129 [#130]: https://github.com/Gerrrt/HomeLab/issues/130 [#131]: https://github.com/Gerrrt/HomeLab/issues/131 @@ -1474,7 +1467,6 @@ it matters: [ADR-0035]: ../../docs/adr/0035-scope-the-99-to-20-rule-to-the-hue-bridge.md [#404]: https://github.com/Gerrrt/HomeLab/issues/404 [#428]: https://github.com/Gerrrt/HomeLab/issues/428 -[#455]: https://github.com/Gerrrt/HomeLab/issues/455 [#533]: https://github.com/Gerrrt/HomeLab/issues/533 [#535]: https://github.com/Gerrrt/HomeLab/issues/535 [#970]: https://github.com/Gerrrt/HomeLab/issues/970 diff --git a/stacks/sensitive/household-age.sha256 b/stacks/sensitive/household-age.sha256 deleted file mode 100644 index 619debb2..00000000 --- a/stacks/sensitive/household-age.sha256 +++ /dev/null @@ -1,18 +0,0 @@ -# The age release the household drive carries, so the holder can open the copy -# without downloading anything on the day (ADR-0073). Each one is checked -# against this line before it is copied to the drive's tools/, and again on -# every visit. The binaries themselves go in backups/household/tools/ on -# trinity, downloaded once from -# https://github.com/FiloSottile/age/releases/tag/v1.3.2 -# (docs/runbooks/carry-the-household-copy.md §1). -# -# v1.3.2, released 2026-08-29. Hashed after download on 2026-10-01 and matched -# against the sha256 digest GitHub reports for each asset. -# -# -1d1e4bc66e1427edad7739ae7616157de0e79db8b6d2a1497d7d9925fb06a539 age-v1.3.2-darwin-amd64.tar.gz -e2020b073c44f692685a24d6abc378817eb81ffaaf49fd0531ef8565f767f2f5 age-v1.3.2-darwin-arm64.tar.gz -cbe24006683f8eb669266162894b9a522a1af52f2665fbc63a4bb032ed26ac10 age-v1.3.2-linux-amd64.tar.gz -6b8dc4333c53a5a57c9e5834e3a48f92605d7154014cd07269ff3327db5d37f4 age-v1.3.2-linux-arm64.tar.gz -f48d8f8f9ebe903ab5027ed067652f2cc1db94bc206976430133b905dcd8e8c7 age-v1.3.2-windows-amd64.zip -fae351336c8d5f30f93cc3ccdec16d1ed7851d68cdd6656d41955cc31a447c9d age-v1.3.2-windows-arm64.zip diff --git a/stacks/sensitive/household.recipients b/stacks/sensitive/household.recipients deleted file mode 100644 index f97d8dd7..00000000 --- a/stacks/sensitive/household.recipients +++ /dev/null @@ -1,35 +0,0 @@ -# Who can open the household's copy — ADR-0073. -# -# Every Immich library set and every Paperless-ngx document set is encrypted to -# these keys as well as to the sensitive rule's, so the copy on the household -# drive opens without the operator. These are PUBLIC keys: they can only -# encrypt. This file opens nothing in secrets/, and scripts/check_sops_rules.py -# fails if a household key ever appears in .sops.yaml. -# -# The comment directly above each key gives its role, and there are three: -# -# household the person who holds the drive at the other address and -# opens it from their own device (ADR-0023). Generated ON -# that device, by them; only the age1 line comes here. -# technical-second ADR-0024's second recipient, the fallback if the -# household key is lost. The same key as the catch-all -# rule's second recipient in .sops.yaml. -# household-and-technical-second -# one person who is both: their single key, written once. -# It stays in the catch-all rule, as the technical second. -# -# A fallback is required: a file with a household key and no technical-second -# (or combined) key is refused. -# -# There is no household key yet: the holder is not chosen (#455). Until there -# is, no copy on the drive is recorded as the household's, because a copy that -# only the operator and the technician can open is not the path ADR-0023 asks -# for. The holder generates their key on their own device and sends the age1 -# line; it goes here, above the technical second, under `# role: household`. -# -# Read with scripts/household-recipients.sh, never by eye; it refuses a key -# with no role, a role with no key and a line that is not a key. The file is -# also valid input to `age -R` as it stands. - -# role: technical-second (ADR-0024, #294) -age19mkg76v0x70wkqwuykxxqpdwrq8mhgklpjw44j6xw73psnhwyvcqa9995j diff --git a/systemd/sensitive/homelab-backup-library.service b/systemd/sensitive/homelab-backup-library.service index 3d2b45dd..285ce106 100644 --- a/systemd/sensitive/homelab-backup-library.service +++ b/systemd/sensitive/homelab-backup-library.service @@ -11,8 +11,8 @@ # # It shares the `backups` lock with backup-sensitive, so a volume backup still # running at 05:15 is waited for rather than raced — the two copies to oracle -# never share its link. The copy off the ESTATE is not this unit's: that is -# #455, and until it exists this is off-host only. +# never share its link. This copy is off-host and still in the house, and +# there is no other (ADR-0122). [Unit] Description=HomeLab: archive Immich's library and copy it to oracle Documentation=file://@DEPLOY_ROOT@/docs/adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md @@ -29,8 +29,8 @@ EnvironmentFile=-/etc/default/homelab-timers ExecStart=@DEPLOY_ROOT@/scripts/run-scheduled.sh --job backup-library --lock backups --lock-wait 900 -- /usr/bin/make -C @DEPLOY_ROOT@ backup-library # An hour, not half of one: the whole library is read, encrypted and sent # every night, and it grows. At oracle's 100 Mb/s a 20 GB set is about half -# an hour on the wire. A run that needs longer is the moment ADR-0064 names -# for #455 to have landed. +# an hour on the wire. A run that needs longer is the moment to look again at +# where the library is copied. TimeoutStartSec=3600 Restart=no Nice=10 diff --git a/systemd/sensitive/homelab-smart-state-sensitive.service b/systemd/sensitive/homelab-smart-state-sensitive.service index c147d436..1143b1c9 100644 --- a/systemd/sensitive/homelab-smart-state-sensitive.service +++ b/systemd/sensitive/homelab-smart-state-sensitive.service @@ -24,10 +24,6 @@ # any other, so its own lock file can sit in the one directory it may write; # node_exporter reads only *.prom there. Narrower than opening /run/lock, which # holds other programs' locks. -# -# THE HOUSEHOLD DRIVE IS READ WHILE IT IS PLUGGED IN, and that is fine. It is -# attached here between copies (ADR-0073) and leaves with the holder; its -# series stop when it does, and no rule reads a drive's absence. [Unit] Description=HomeLab: collect SMART health for trinity's disks Documentation=file://@DEPLOY_ROOT@/docs/runbooks/schedule-maintenance.md