9 Commits

Author SHA1 Message Date
Walusimbi Silver
3b797bb4e5 Add optional healthcheck heartbeat
The check is silent by design on a healthy host, so an absent alert is
indistinguishable from a cron that stopped running. Ping HEALTHCHECK_URL
on a clean run and the /fail endpoint when the check alerts or cannot
complete. Empty by default, which disables the pings.
2026-09-03 14:35:28 +03:00
Walusimbi Silver
4950a0e50b Check the served certificate, not just the file on disk
certbot renews the file but nginx serves the old certificate from memory
until reloaded, so a disk-only check reports healthy while browsers get an
expired certificate. Compare each lineage against what nginx serves over
SNI on the loopback listener.

The comparison is gated on the served certificate's SAN list covering the
domain: nginx finishes the handshake with a fallback vhost certificate
when SNI matches nothing, which would otherwise compare a lineage against
an unrelated certificate and warn falsely.
2026-09-03 14:34:32 +03:00
Walusimbi Silver
c16d6dcf75 Raise expiry threshold above certbot's renewal window
Certbot renews at 30 days remaining, so a healthy certificate never falls
below it and the old 14 day threshold could only fire after renewal had
been broken for 16 straight days, leaving 14 days to react. 25 days fires
about five days after the first failed renewal.
2026-09-03 14:32:02 +03:00
Walusimbi Silver
ebde01ddeb Send cert alerts to ntfy over loopback
The script posted alerts to https://ntfy.silverwal.com/certbot, which is
served by the same nginx whose certificates it monitors. A TLS failure on
this host would make curl -fsS fail verification and drop the alert
describing that failure, leaving only a line in a log nobody reads.
ntfy is already bound to 127.0.0.1:2586, so post there instead.
2026-09-03 14:31:51 +03:00
Walusimbi Silver
7f188cc12a Restore install and cron docs for the cert check
These were dropped in b1b4296 when the README was trimmed, which left no
record in the repo of how the script gets onto the server or how it is
scheduled.
2026-09-03 14:31:33 +03:00
Walusimbi Silver
a9774ae55a Normalize line endings to LF
The script had been saved with CRLF terminators, which makes the kernel
look for an interpreter named 'bash\r' and fails the script with
'bad interpreter: No such file or directory' when run on the server.
Pin LF via .gitattributes so editors on the Windows side of /mnt/d
cannot reintroduce it.
2026-09-03 14:31:17 +03:00
Walusimbi Silver
c0655293ac Use certbot ntfy topic for certificate alerts 2026-04-24 12:03:22 +03:00
Walusimbi Silver
b1b42968a1 Clarify server ops repo scope 2026-04-24 12:03:05 +03:00
Walusimbi Silver
785c13119b Add server ops certificate expiry check 2026-04-24 10:36:33 +03:00