Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,26 @@ docstring gives: it is a record, not a claim about now.
ten minutes, and prometheus's brief peaks came within 13. Other chips are left
out, because smaug's DIMM sensors report a critical point of 0 °C.

- **`mjolnir`'s card serves a leaf from the estate CA, and its probe verifies
it.** `mjolnir.matrix.elysium` with `10.0.99.10`, until 2029-02-26, signed
from a request the card made, so its key never left it. The first attempt
used the card's factory ECDSA P-256 key. The card imported that leaf, then
dropped every TLS handshake for about 25 minutes, through one reboot, until
it was given an RSA 2048 key and a leaf for that. SNMP, NUT and the shutdown
path were unaffected, and the card and NUT alerts were silenced throughout.
Its `scp` writes uploads to its root whatever path is named, which is what
the first `E100` on import was. The `ups-ui` probe moves to
`http_2xx_lab_ca`, and `generate-certificates.md` records the steps that
worked. This was audit item 11.
- **A re-check of `mjolnir` found three stale documents.** The UPS dashboard's
text panel said runtime still sat on the fabricated `63`, but it moved
between 29 and 45 minutes over the past week. It also said nothing watched
the self-test schedule, but `UpsSelfTestScheduleOff`, `UpsSelfTestStale`
and `UpsSelfTestFailed` do; the last test, on 2026-11-18, passed.
`fit-the-ups-battery.md` still listed a screenshot and the shelf as to-do,
and both were done in October. `schedule-maintenance.md` gains the card
leaf's renewal date, 2029-02-26.

## 2026-11-23

- **NUT's driver on `morpheus` retries for 14 seconds, not 6.** The *data
Expand Down
8 changes: 6 additions & 2 deletions docs/hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ batteries and its replace-battery indicator (09.9), and add a setting that
locks firmware updates to chosen ports (15.0). This model can't update the UPS
with its output on. [`update-the-ups-firmware.md`](runbooks/update-the-ups-firmware.md)
is the procedure for both, tracked in
[#1698](https://github.com/Gerrrt/HomeLab/issues/1698). The card answers HTTPS and SSH; its HTTP port is closed.
[#1698](https://github.com/Gerrrt/HomeLab/issues/1698). The card answers HTTPS and SSH; its HTTP port is closed. Since 2026-11-24
its HTTPS serves a leaf from the estate CA, for an RSA key made on the card,
and the `ups-ui` probe verifies it ([`generate-certificates.md`](runbooks/generate-certificates.md), *The APC card's leaf*).
SSH stays on by the owner's decision of 2026-11-23. **Input sensitivity is
medium**, lowered from high by 2026-11-24, and `UpsInputSensitivityChanged`
warns if a card reset or anyone else moves it. The card's event log gives the
Expand All @@ -392,7 +394,9 @@ gave the same cause for all three: distorted input, not a cut. They lasted
2026-11-01 its log read an hour ahead of local time. The owner corrected it on
2026-11-24. **Its local users are `apc`, the administrator, `prometheus`, the
SNMPv3 user, and the factory `device` and `readonly` accounts.** Both
factory accounts are disabled, read by the owner on 2026-11-24. The
factory accounts are disabled, read by the owner on 2026-11-24.
`prometheus` is the one enabled read-only local user, which the card's login
banner counts, and stays enabled by the owner's decision of 2026-11-24. The
`prometheus` SNMPv3 user is allowed from two addresses only: `10.0.99.20`, `prometheus`, and `10.0.99.1`, NUT on
`morpheus`.

Expand Down
2 changes: 1 addition & 1 deletion docs/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ argument and for what to do when it exits 1.
| `containers.rules.yaml` | Restart loops, OOM kills, memory, throttling |
| `stack.rules.yaml` | The stack watching itself: config reloads, rule evaluation, notification delivery, log ingestion, and the two cases `up == 0` structurally cannot see — a remote-writing agent that stops pushing, and a scraped target that stops being a target at all. The second is `ScrapeTargetDisappeared`, added with the first scraped host ([#256](https://github.com/Gerrrt/HomeLab/issues/256)): an emptied or unparseable `targets/node.yaml` makes the series vanish rather than fall to 0, so `InstanceDown` stays silent and `RemoteWriteJobStale` excludes scraped jobs by design. `AlloyDown` (2026-10-07) is the one alert per host for the agent itself stopping. It keys on the `<host>-alloy` self-scrape and fires five minutes before `RemoteWriteJobStale` would, and an inhibit rule in `alertmanager.yaml` then holds back that host's per-job alerts. The target for `smaug` was written into `targets/node.yaml` disabled on 2026-09-17 and enabled on 2026-09-19, once the exporter answered from the pool. Split off `containers.rules.yaml` onto `component: stack` in [#81](https://github.com/Gerrrt/HomeLab/issues/81) so a Prometheus that cannot reload its config stops being filed as a container fault. Since [#575](https://github.com/Gerrrt/HomeLab/issues/575) also whether an Alertmanager silence is about to lapse or names no owning issue, read from the per-silence series `scripts/collect_silences.py` writes every fifteen minutes — `alertmanager_silences` is a count per state and cannot say which alert, when, or whose |
| `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)) |
| `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 verified against the same CA since 2026-11-24, 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)), 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)) |
Expand Down
17 changes: 4 additions & 13 deletions docs/runbooks/fit-the-ups-battery.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,19 +405,10 @@ unwatched*: the schedule is set, no rule can see it, and the proof is
`upsAdvTestLastDiagnosticsDate` advancing on its own around 2026-09-11. #93
moved into Done in the same pass, because its third step is now satisfied.

**Still to do:**

| File | What changes |
| --- | --- |
| `docs/images/ups-power.png` | Re-capture the set with `make screenshots`. The committed image is from 2026-08-22 and shows the original no-battery banner; it needs the decrypted Grafana password, so it is a human step |

And when the shelf is racked, which is a separate visit and separate issue:

| File | What changes |
| --- | --- |
| `docs/hardware.md` | The 1U shelf into the rack table at U4, and into Accessories |
| `docs/network.md` | The TP-Link note — now racked and on UPS power |
| `docs/roadmap.md` | The #110 entry leaves; the fit goes to `docs/changelog.md` under the date |
**Since done:** `docs/images/ups-power.png` was re-captured on 2026-10-10
(#1117) and no longer shows the no-battery banner. The shelf switch was racked
and #110 closed, and the 32U move then replaced that layout
([`hardware.md`](../hardware.md)). Nothing from this runbook is left to do.

One coupling to know about before you start editing: **deleting the banner panel
changes the dashboard's panel count**, and `scripts/check_docs.py` asserts every
Expand Down
117 changes: 81 additions & 36 deletions docs/runbooks/generate-certificates.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ against `ca.pem`, and reads the expiry off the handshake — so what is watched
is the certificate actually being served, not a file on disk.
`TlsCertificateExpiringSoon` fires at 30 days and `TlsCertificateExpiryImminent`
at 7, one alert per certificate however many URLs serve it
([#91](https://github.com/Gerrrt/HomeLab/issues/91)). The same two rules read
the APC card's self-signed certificate, which is not trusted but does expire.
([#91](https://github.com/Gerrrt/HomeLab/issues/91)). The APC card's leaf
is read and verified the same way since 2026-11-24 (*The APC card's leaf*
below); it can't be renewed with the `make certs` line that follows.

```bash
make certs ARGS="--host grafana.matrix.elysium --ip 10.0.99.20 --dns grafana --force"
Expand Down Expand Up @@ -333,71 +334,115 @@ Certificate**.

### The APC card's leaf

`mjolnir`'s AP9641 card makes its own key and a certificate signing request,
and imports a signed certificate, all from its command line. Its key never
leaves the card: `gen-certs.sh --csr` signs the request and writes only the
certificate. The card's key is ECDSA P-256, made on the card. The leaf is
`mjolnir.matrix.elysium` with an IP SAN for `10.0.99.10`. The name doesn't
resolve, so the address is what the probe and a browser use.
`mjolnir`'s AP9641 card serves `mjolnir.matrix.elysium`, with an IP SAN for
`10.0.99.10`, since 2026-11-24. The name doesn't resolve, so the address is
what the probe and a browser use. The card makes its own key and a
certificate signing request, and imports a signed certificate, all from its
command line. Its key never leaves the card: `gen-certs.sh --csr` signs the
request and writes only the certificate. The leaf is good for 825 days, until
2029-02-26. The `ups-ui` probe verifies it against `ca.pem`, and
`TlsCertificateExpiringSoon` and `TlsCertificateExpiryImminent` read its
expiry.

**The card's key must be RSA.** The card's factory key is ECDSA P-256, and the
first leaf, on 2026-11-24, was signed for it. The card imported that leaf and
then dropped every TLS handshake at the point where it signs, on TLS 1.3 and
1.2 alike, before and after a reboot. Its TLS code appears to choose how to
sign from the certificate's signature algorithm, here this CA's
`sha256WithRSA`, not from its own key. An RSA 2048 key made on the card, under
the same CA, works. An ECDSA key would need an ECDSA-signed certificate, which
this CA can't issue.

Everything below runs from the main checkout on the monitoring host, as the
card's super user `apc`, whose password you type. The card offers no
curve25519, which `prometheus`'s SSH client is limited to, so each command
names the card's key exchange and host key:
names the card's key exchange and host key. Silence the card and NUT first,
as in
[`update-the-ups-firmware.md`](update-the-ups-firmware.md) A.2: step 4
restarts the card.

```bash
cd ~/code/Gerrrt/HomeLab
O=(-o KexAlgorithms=ecdh-sha2-nistp256 -o HostKeyAlgorithms=ecdsa-sha2-nistp256)
```

1. **Make the request on the card, and copy it off.** `-q` builds it from the
card's current key and settings. Its subject and SANs don't matter, because
the CA sets its own:
1. **Make the request on the card, and copy it off.** For a renewal, skip
`ssl key -d` and `ssl key -rsa 2048` and keep the key the card already has;
`ssl cert -s` shows whether it's RSA. Otherwise, in one session at the
card's prompt (`ssh "${O[@]}" apc@10.0.99.10`):

```text
ssl key -d
ssl key -rsa 2048
ssl csr -q
exit
```

`-q` builds the request from the card's key and settings. Its subject and
SANs don't matter, because the CA sets its own. Then:

```bash
ssh "${O[@]}" apc@10.0.99.10 ssl csr -q
scp -O "${O[@]}" apc@10.0.99.10:ssl/nmc.csr ./certificates/mjolnir-nmc.csr
openssl req -in certificates/mjolnir-nmc.csr -noout -text | grep 'Public Key Algorithm'
```

2. **Sign it.** `--force` only when reissuing:
You want `rsaEncryption`.

2. **Sign it.** `--force` when a leaf already exists:

```bash
make certs ARGS="--host mjolnir.matrix.elysium --ip 10.0.99.10 --csr certificates/mjolnir-nmc.csr"
make certs ARGS="--host mjolnir.matrix.elysium --ip 10.0.99.10 --csr certificates/mjolnir-nmc.csr --force"
```

3. **Copy the certificate to the card and import it.** The card serves it at
once; nothing restarts:
3. **Copy the certificate to the card and import it.** The card's `scp`
writes an upload to its root directory whatever path you give, so name it
there, and import it from there. An import of a path that holds nothing
answers only `E100: Command Failed`:

```bash
scp -O "${O[@]}" certificates/mjolnir.matrix.elysium.pem apc@10.0.99.10:ssl/nmc.crt
ssh "${O[@]}" apc@10.0.99.10 ssl cert -i ssl/nmc.crt
scp -O "${O[@]}" certificates/mjolnir.matrix.elysium.pem apc@10.0.99.10:nmc.crt
```

The card refuses a certificate that doesn't match the key its request came
from. If the import fails, it keeps serving the certificate it had.
Then at the card's prompt:

4. **Check what it serves**, against the CA rather than by eye:
```text
ssl cert -i nmc.crt
ssl cert -s
```

```bash
echo | openssl s_client -connect 10.0.99.10:443 -CAfile certificates/ca.pem \
-verify_return_error -verify_ip 10.0.99.10 2>&1 | grep -E 'Verify return code|subject=|issuer='
The card refuses a certificate that doesn't match its key, and then keeps
serving the one it had. `ssl cert -s` should show the CA as issuer and
`RSA (2048 bit)`.

4. **Restart the card's management interface**, at the same prompt. This
restarts the network card only, not the UPS or its outlets, and SNMP is
gone for about a minute. Until it's done, the card may serve the new
certificate and still fail every handshake:

```text
reboot -Y
```

You want `Verify return code: 0 (ok)`.
5. **Check what it serves**, against the CA rather than by eye:

```bash
curl -sSL --cacert certificates/ca.pem -o /dev/null -w '%{http_code}\n' https://10.0.99.10/
```

5. **Make the probe verify it.** In
[`targets/blackbox.yaml`](../../stacks/observability/prometheus/targets/blackbox.yaml),
change the `ups-ui` target's module from `http_2xx_self_signed` to
`http_2xx_lab_ca`, so a lapsed or factory-reset certificate fails the probe
rather than passing it. `TlsCertificateExpiringSoon` and
`TlsCertificateExpiryImminent` read its expiry either way.
You want `200`, after `-L` follows the card's redirect from `/` to
`/home.htm`, as the probe does. `openssl s_client -verify_return_error` alone isn't enough:
it reports `Verify return code: 0 (ok)` from the certificate even when the
handshake then fails.

Delete `certificates/mjolnir-nmc.csr` afterwards. It isn't secret, but
`certificates/` is for what this CA issues.
Delete `certificates/mjolnir-nmc.csr` and the silences afterwards. The request
isn't secret, but `certificates/` is for what this CA issues.

A factory reset of the card, or a downgrade below 2.4, which formats it,
brings back a self-signed certificate. Once step 5 is done, that fails the
probe and `EndpointUnreachable` fires. Re-run steps 1 to 4 to recover.
brings back a self-signed certificate. That fails the `ups-ui` probe, and
`EndpointUnreachable` fires. Re-run steps 1 to 5 to recover. To go back to a
self-signed certificate on purpose: `ssl key -d`, then `reboot -Y`, and the
card makes a new key and certificate for itself. Set the probe's module back to
`http_2xx_self_signed` in the same change.

## If something goes wrong

Expand Down
Loading