Commit Graph
93 Commits
Author SHA1 Message Date
patrickandClaude Opus 5.5 7090038626 Document automatic reboots with unattended-upgrades
CI / tests (Python 3.10) (pull_request) Successful in 39s
CI / tests (Python 3.11) (pull_request) Successful in 38s
CI / tests (Python 3.12) (pull_request) Successful in 39s
CI / tests (Python 3.13) (pull_request) Successful in 38s
CI / lint (pull_request) Successful in 3s
kernelwatch flags pending reboots but never reboots anything. For hosts
without Livepatch, add "Rebooting automatically" to the agents guide:
enabling unattended-upgrades on Debian (its kernel hook is what creates
/run/reboot-required there), a drop-in for Automatic-Reboot and
Automatic-Reboot-Time, picking times before 05:00 so the reboot lands
inside the 24h reboot alert window (apt-daily-upgrade runs 06:00-07:00),
staggering dependent hosts and the dashboard host, and how each outcome
shows up in kernelwatch: back to ok minutes after boot, stale if it
doesn't come back, a reboot alert if it never happens. Also why to leave
it off on Livepatch hosts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 15:50:31 -05:00
patrick 8710584446 Merge pull request 'Report failing helper units, held packages and unloaded microcode' (#31) from feat/helper-unit-health into main
CI / tests (Python 3.11) (push) Successful in 38s
CI / tests (Python 3.10) (push) Successful in 39s
CI / tests (Python 3.12) (push) Successful in 38s
CI / tests (Python 3.13) (push) Successful in 39s
CI / lint (push) Successful in 3s
Reviewed-on: #31
2026-11-01 20:33:32 +00:00
patrickandClaude Opus 5.5 1b6cfce18b Fix shellcheck SC1007 in helper_units
CI / tests (Python 3.11) (pull_request) Successful in 39s
CI / tests (Python 3.10) (pull_request) Successful in 39s
CI / tests (Python 3.12) (pull_request) Successful in 40s
CI / tests (Python 3.13) (pull_request) Successful in 39s
CI / lint (pull_request) Successful in 3s
`local x=` reads to shellcheck like a mistyped assignment; spell the empty
values as ''.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 15:31:10 -05:00
patrickandClaude Opus 5.5 8174f1df81 Put hosts with unloaded CPU microcode updates in reboot
CI / tests (Python 3.11) (pull_request) Successful in 39s
CI / tests (Python 3.12) (pull_request) Successful in 38s
CI / tests (Python 3.13) (pull_request) Successful in 38s
CI / lint (pull_request) Failing after 3s
CI / tests (Python 3.10) (pull_request) Successful in 40s
On bare metal, needrestart -b reports NEEDRESTART-UCSTA: 2 when the
installed intel-microcode/amd64-microcode is newer than what the CPU
loaded at boot, which only a reboot fixes. The agent dropped those
lines. It now reports needrestart_ucsta, _uccur and _ucexp, and the
server puts the host in reboot with both revisions. Livepatch doesn't
cover it. needrestart skips the check in VMs, so only physical hosts
(debian-homelab today) report it; the host page gets a "CPU microcode"
row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 15:25:57 -05:00
patrickandClaude Opus 5.5 4676942108 Report packages on hold, and flag held kernel packages
A held package never upgrades, and apt's simulation leaves it out, so
its updates (security ones included) appear nowhere. A leftover hold on
linux-image-amd64 or linux-generic keeps a host on its kernel while it
looks current.

The agent reports installed held packages (dpkg's "hi") as
held_packages. A held linux-* package puts the host in update with the
apt-mark unhold hint; other holds, usually deliberate, get a note. The
host page lists them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 15:24:27 -05:00
patrickandClaude Opus 5.5 f88261d2f5 Report when kernelwatch's own helper units keep failing
kernelwatch-apt-update.service failed hourly on most hosts for weeks
without anything showing it. The agent only Wants= its helper units, so
the report goes out regardless, with stale lists or (for needrestart)
results that quietly turn "unknown".

Each helper (apt-update, needrestart) now runs kernelwatch-unit-result
as its ExecStopPost=, which systemd runs after failed runs too. It
writes "RESULT EXIT_CODE EXIT_STATUS FAILURES" to
/run/kernelwatch/<name>.result, FAILURES counting failed runs in a row.
The agent (0.10.0) reports results from the last two hours as
helper_units. On the server, one or two failures are a note (an admin's
apt can hold the lock now and then); three in a row put the host in
update, naming the unit and its exit status and pointing at journalctl.
The host page gets a "kernelwatch helpers" row.

The Livepatch unit isn't tracked: it fails by design where the snap is
installed but Livepatch isn't enabled, and Livepatch has its own check.

The apt-update unit now has RuntimeDirectory=kernelwatch (preserved,
like the others) for its result file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 15:23:05 -05:00
patrick ad310a4948 Merge pull request 'Fix apt refresh on apt 2.7+ and check the security repository' (#30) from feat/security-repo-check into main
CI / tests (Python 3.10) (push) Successful in 36s
CI / tests (Python 3.11) (push) Successful in 37s
CI / tests (Python 3.12) (push) Successful in 35s
CI / tests (Python 3.13) (push) Successful in 35s
CI / lint (push) Successful in 3s
Reviewed-on: #30
2026-11-01 20:08:36 +00:00
patrickandClaude Opus 5.5 c9912d5fbc Check that the release's security repository is configured and fresh
CI / tests (Python 3.10) (pull_request) Successful in 36s
CI / tests (Python 3.11) (pull_request) Successful in 36s
CI / tests (Python 3.12) (pull_request) Successful in 37s
CI / tests (Python 3.13) (pull_request) Successful in 37s
CI / lint (pull_request) Successful in 4s
security_count is only meaningful if apt has the release's security
suite. A host missing it from its sources shows 0 security updates
forever, and one whose apt can't fetch it (expired key, wrong URL after
a release upgrade, a mirror that fell behind) keeps the last copy while
the update stamps and other lists move on, so neither the simulation nor
the package list age notices.

The agent (0.9.0) now finds apt's list for <codename>-security by its
Suite: (Ubuntu) or Codename: (Debian) field, since file names depend on
the mirror (mirror+file: sources, several mirrors), and reports
security_repo_suite and security_repo_age_seconds from its Date:, the
newest copy winning. The server puts the host in update when there's no
such list, or when it's older than security_repo_stale_after_days
(default 7) while the package lists are otherwise fresh; if all of
them are old, the existing "package lists N days old" reason covers
it. Releases past the end of support are skipped: their suite has
stopped publishing, and support.check already says so. ESM suites
publish too rarely to judge by date and aren't checked.

The host page gets a "Security repository" row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 14:58:10 -05:00
patrickandClaude Opus 5.5 fa6cca4f64 Don't let failed apt updates make package lists look fresh
apt touches /var/lib/apt/lists/partial on every update attempt,
including ones that fail, and the agent took the newest of it and the
two success stamps. So a host whose apt update failed hourly reported
lists an hour old. Use the success stamps (update-success-stamp,
update-stamp) and fall back to lists/partial only when neither exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 14:53:19 -05:00
patrickandClaude Opus 5.5 195fd035e0 Fix kernelwatch-apt-update failing on apt 2.7+
With User=root, NoNewPrivileges=yes and any seccomp-based sandbox option
together, apt 2.7+ (Ubuntu 24.04+, Debian 13) can't drop to _apt:

  E: seteuid 42 failed - seteuid (1: Operation not permitted)
  E: Method http has died unexpectedly!

so apt-get update exited 100 on every run on 10 of 13 hosts. The '-'
prefix hid it, and apt touches lists/partial even when it fails, so the
agent's list age looked fresh. Only hosts with older apt (22.04, Debian
12) refreshed. On Ubuntu apt-daily kept the lists fresh regardless; a
Debian 13 host relying on this unit alone had lists three days old.

Root is the default, so drop User=root. Let a failed update fail the
unit (the agent only Wants= it, so the report still goes), and touch
/var/lib/apt/periodic/update-success-stamp, the stamp Ubuntu writes after
each successful apt update, only when it succeeds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 14:52:36 -05:00
patrick 233645c738 Merge pull request 'Document setting up Ubuntu Livepatch for a host' (#29) from docs/livepatch-setup into main
CI / tests (Python 3.11) (push) Successful in 34s
CI / tests (Python 3.10) (push) Successful in 34s
CI / tests (Python 3.12) (push) Successful in 33s
CI / tests (Python 3.13) (push) Successful in 33s
CI / lint (push) Successful in 3s
Reviewed-on: #29
2026-11-01 00:55:40 +00:00
patrickandClaude Opus 5.5 b6fc7fc05e Document setting up Ubuntu Livepatch for a host
CI / tests (Python 3.10) (pull_request) Successful in 34s
CI / tests (Python 3.11) (pull_request) Successful in 34s
CI / tests (Python 3.12) (pull_request) Successful in 34s
CI / tests (Python 3.13) (pull_request) Successful in 34s
CI / lint (pull_request) Successful in 2s
docs/agents.md had nothing on Livepatch, though it's where you look when
adding a host. New section: attaching Ubuntu Pro and enabling Livepatch,
checking kernelwatch picks it up, what changes on the dashboard (reboot
cover, its 14-day margin, alerts), that attaching also enables the ESM the
end-of-support check counts, and the caveats (supported kernels only,
turning it off sends one alert, nothing for Debian).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 20:52:42 -04:00
patrick 249e8c2b2a Merge pull request 'Stop deploy.sh running under sudo or from an outdated checkout' (#28) from feat/deploy-safety-checks into main
CI / tests (Python 3.11) (push) Successful in 35s
CI / tests (Python 3.10) (push) Successful in 35s
CI / tests (Python 3.12) (push) Successful in 34s
CI / tests (Python 3.13) (push) Successful in 34s
CI / lint (push) Successful in 3s
Reviewed-on: #28
2026-11-01 00:49:45 +00:00
patrickandClaude Opus 5.5 253ccb02f6 Document deploy.sh's sudo and outdated-checkout checks
CI / tests (Python 3.11) (pull_request) Successful in 34s
CI / tests (Python 3.10) (pull_request) Successful in 35s
CI / tests (Python 3.12) (pull_request) Successful in 33s
CI / tests (Python 3.13) (pull_request) Successful in 34s
CI / lint (pull_request) Successful in 2s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 20:46:32 -04:00
patrickandClaude Opus 5.5 c3ed3c026b Stop deploy.sh running under sudo or from an outdated checkout
Under sudo, ssh reads root's config and keys, so a custom Port silently
disappears and the deploy fails with "connect to host ... port 22:
Connection refused". deploy.sh needs no root locally (install.sh runs
under sudo on each host), so it now refuses when run as root via sudo,
naming the user to run it as. A real root login is still allowed.

Deploying from a checkout behind its upstream ships an older agent than
the server expects, and the dashboard keeps saying "agent is older" after
a deploy that looked fine. deploy.sh now fetches the upstream (20s limit)
and, if the checkout is behind, asks on a terminal or refuses otherwise;
--allow-outdated deploys anyway and --dry-run only warns. A failed fetch
warns and carries on; no checkout or no upstream skips the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 20:46:32 -04:00
patrick 4f45187ca0 Merge pull request 'Flag hosts where unattended-upgrades has stopped succeeding' (#27) from feat/unattended-upgrades into main
CI / tests (Python 3.10) (push) Successful in 31s
CI / tests (Python 3.11) (push) Successful in 31s
CI / tests (Python 3.12) (push) Successful in 31s
CI / tests (Python 3.13) (push) Successful in 31s
CI / lint (push) Successful in 3s
Reviewed-on: #27
2026-11-01 00:28:50 +00:00
patrickandClaude Opus 5.5 da84ec1625 Document the unattended-upgrades check
CI / tests (Python 3.11) (pull_request) Successful in 31s
CI / tests (Python 3.10) (pull_request) Successful in 31s
CI / tests (Python 3.12) (pull_request) Successful in 31s
CI / tests (Python 3.13) (pull_request) Successful in 31s
CI / lint (pull_request) Successful in 3s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 20:19:09 -04:00
patrickandClaude Opus 5.5 bfac723850 Flag hosts where unattended-upgrades has stopped succeeding
On a host with unattended-upgrades enabled, no successful run in
unattended_upgrades_stale_after_days (default 3, 0 disables) puts it in
update. The reason says which way it broke: still running but failing
("last succeeded 5d ago and is failing (last ran 6h ago); check
/var/log/unattended-upgrades/"), not running at all ("is
apt-daily-upgrade.timer enabled?"), or never succeeded. A host where it
hasn't completed its first run yet gets a note, and packages it keeps back
are noted. Hosts with it disabled or not installed, and agents before
0.8.0, are judged as before. The host page shows the state, both stamp
ages and the kept-back packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 20:18:41 -04:00
patrickandClaude Opus 5.5 df097c9da3 Report unattended-upgrades state from the agent
The agent now sends whether unattended-upgrades is enabled (package
installed, not just its leftover config, and APT::Periodic::Unattended-
Upgrade set and non-zero), the age of apt.systemd.daily's upgrade-stamp
(touched only when unattended-upgrade exits 0), the age of
unattended-upgrade's own stamp (written whenever a run gets far enough,
even if it then fails) and the packages it keeps back. Nothing reads them
yet. Agent 0.8.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 20:17:13 -04:00
patrick 6cbc9665d8 Merge pull request 'Flag hosts whose OS release no longer gets security updates' (#26) from feat/os-end-of-support into main
CI / tests (Python 3.10) (push) Successful in 29s
CI / tests (Python 3.11) (push) Successful in 29s
CI / tests (Python 3.12) (push) Successful in 29s
CI / tests (Python 3.13) (push) Successful in 29s
CI / lint (push) Successful in 4s
Reviewed-on: #26
2026-10-31 23:53:27 +00:00
patrickandClaude Opus 5.5 bc46c55298 Flag hosts whose OS release no longer gets security updates
CI / tests (Python 3.10) (pull_request) Successful in 30s
CI / tests (Python 3.11) (pull_request) Successful in 30s
CI / tests (Python 3.12) (pull_request) Successful in 28s
CI / tests (Python 3.13) (pull_request) Successful in 28s
CI / lint (pull_request) Successful in 3s
Past its end of support a release gets no more security updates, so apt
offers nothing and the host showed ok indefinitely. The server now has a
table of when free security support ends for each release the agent
installs on (support.py): Debian's LTS end, and Ubuntu's end of standard
support plus end of ESM. Dates from Debian LTS and Ubuntu's release cycle
via endoflife.date; a test checks the table covers every release
agent/install.sh accepts.

The agent reports whether Ubuntu Pro is attached and esm-infra's status,
read from the pro client's world-readable status.json. A host past its
date goes to update; within os_eol_warn_days (default 90) of it, the row
gets a note. An Ubuntu host with ESM enabled isn't warned when standard
support ends, only before ESM does. The host page shows the dates.
Agent 0.7.0; older agents don't report ESM and count as having none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 19:50:44 -04:00
patrick 5a11d31e66 Merge pull request 'Flag a /boot too full for the next kernel and packages dpkg left unfinished' (#25) from feat/boot-space-dpkg-audit into main
CI / tests (Python 3.10) (push) Successful in 27s
CI / tests (Python 3.11) (push) Successful in 27s
CI / tests (Python 3.12) (push) Successful in 27s
CI / tests (Python 3.13) (push) Successful in 28s
CI / lint (push) Successful in 4s
Reviewed-on: #25
2026-10-31 23:26:41 +00:00
patrickandClaude Opus 5.5 70272efed5 Flag a /boot too full for the next kernel and packages dpkg left unfinished
CI / tests (Python 3.10) (pull_request) Successful in 29s
CI / tests (Python 3.11) (pull_request) Successful in 30s
CI / tests (Python 3.12) (pull_request) Successful in 29s
CI / tests (Python 3.13) (pull_request) Successful in 28s
CI / lint (pull_request) Successful in 4s
A full /boot makes the next kernel's postinst fail: apt is left half-done
and the host quietly stays on its old kernel, which kernelwatch only
noticed indirectly, if at all. The agent now reports the size and free
space of the filesystem holding /boot (df) and the packages dpkg didn't
finish installing (half-installed, unpacked, half-configured, trigger
states or reinst-required, as dpkg --audit counts them).

The server puts a host in update when /boot has less than
boot_min_free_mb (default 200, 0 disables) free, or any package is
unfinished, with the fix in the reason ("run dpkg --configure -a"). The
host page shows both. Agents before 0.6.0 send neither field and are
judged as before. Agent 0.6.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 18:54:47 -04:00
patrick 3e2f550414 Merge pull request 'Give the backup unit network access so its heartbeat ping can leave' (#24) from fix/backup-heartbeat-network into main
CI / tests (Python 3.10) (push) Successful in 27s
CI / tests (Python 3.11) (push) Successful in 27s
CI / tests (Python 3.12) (push) Successful in 27s
CI / tests (Python 3.13) (push) Successful in 26s
CI / lint (push) Successful in 3s
Reviewed-on: #24
2026-10-31 19:04:20 +00:00
patrickandClaude Opus 5.5 f9d9660f71 Give the backup unit network access so its heartbeat ping can leave
CI / tests (Python 3.11) (pull_request) Successful in 28s
CI / tests (Python 3.10) (pull_request) Successful in 29s
CI / tests (Python 3.12) (pull_request) Successful in 25s
CI / tests (Python 3.13) (pull_request) Successful in 26s
CI / lint (pull_request) Successful in 2s
kernelwatch-backup.service still had PrivateNetwork=yes and
RestrictAddressFamilies=AF_UNIX from before scheduled-backup pinged
backup_heartbeat_url. Every nightly ping failed DNS inside the sandbox
("heartbeat request failed (URLError)"); the backup itself succeeded, so
the only symptom was the heartbeat monitor going down after a day.

Allow AF_INET/AF_INET6 like the alerts unit, and add a test that every
unit running a command that sends requests (check-alerts,
scheduled-backup, notify-backup-failure) keeps network access.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 14:58:51 -04:00
patrick 669f1dc545 Merge pull request 'Report a failed apt simulation instead of reading it as "no updates"' (#23) from fix/apt-simulation-failure into main
CI / tests (Python 3.12) (push) Successful in 26s
CI / tests (Python 3.13) (push) Successful in 26s
CI / tests (Python 3.10) (push) Successful in 25s
CI / tests (Python 3.11) (push) Successful in 25s
CI / lint (push) Successful in 3s
Reviewed-on: #23
2026-10-31 03:28:45 +00:00
patrickandClaude Opus 5.5 fc6ee03ae5 Quote an empty local in the agent for shellcheck (SC1007)
CI / tests (Python 3.10) (pull_request) Successful in 26s
CI / tests (Python 3.11) (pull_request) Successful in 25s
CI / tests (Python 3.12) (pull_request) Successful in 26s
CI / tests (Python 3.13) (pull_request) Successful in 25s
CI / lint (pull_request) Successful in 3s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 23:25:50 -04:00
patrickandClaude Opus 5.5 6d29197cfc Report a failed apt simulation instead of reading it as "no updates"
CI / tests (Python 3.10) (pull_request) Successful in 26s
CI / tests (Python 3.11) (pull_request) Successful in 25s
CI / tests (Python 3.12) (pull_request) Successful in 25s
CI / tests (Python 3.13) (pull_request) Successful in 25s
CI / lint (pull_request) Failing after 3s
The agent ran `apt-get -s dist-upgrade 2>/dev/null || true`, so when apt
failed (unmet dependencies, a broken sources entry, a damaged package cache)
the empty output counted as zero updates and the host could show ok while
nothing could be installed. The agent now keeps apt's exit status and stderr,
reports apt_simulation_ok and the first "E:" line as apt_simulation_error,
and sends the update counts as null. The server puts such a host in update
with "apt can't work out pending updates: ...", and the host page shows the
result. Agents before 0.5.0 don't send the field and are judged as before.

Also show "–" rather than "None" for an unknown count in a host's history,
and stop hard-coding the agent version in the status CLI tests. Agent 0.5.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 23:22:24 -04:00
patrick 1350c78676 Merge pull request 'Alert when Livepatch is broken or has stopped reporting' (#22) from feat/livepatch-alert into main
CI / tests (Python 3.10) (push) Successful in 28s
CI / tests (Python 3.11) (push) Successful in 25s
CI / tests (Python 3.12) (push) Successful in 24s
CI / tests (Python 3.13) (push) Successful in 24s
CI / lint (push) Successful in 3s
Reviewed-on: #22
2026-10-30 16:22:05 +00:00
patrickandClaude Sonnet 5.5 83d5e58ea5 Document Livepatch alerts
CI / tests (Python 3.10) (pull_request) Successful in 27s
CI / tests (Python 3.11) (pull_request) Successful in 26s
CI / tests (Python 3.12) (pull_request) Successful in 26s
CI / tests (Python 3.13) (pull_request) Successful in 27s
CI / lint (pull_request) Successful in 5s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 12:18:40 -04:00
patrickandClaude Sonnet 5.5 650806bfce Alert when Livepatch is broken or has stopped reporting
The alert check now also notifies, once per problem, when a host's Livepatch has
been unhealthy for livepatch_alert_after_hours (default 6), or when a host that
used to report Livepatch no longer does (a dead daemon leaves the agent with
nothing to send). A livepatch_alerts table records which hosts have reported
Livepatch, when the current problem began and whether it was notified, so hosts
without Livepatch never alert and restarts do not repeat messages. Stale hosts
are skipped.

livepatch_problem() is now the single test for unhealthy, shared with the cover
rule for pending reboots, and names the check state when that is the problem.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 12:18:39 -04:00
patrick 203c729e14 Merge pull request 'Split the README into an overview and docs/ pages' (#21) from docs/split-readme into main
CI / tests (Python 3.10) (push) Successful in 25s
CI / tests (Python 3.11) (push) Successful in 25s
CI / tests (Python 3.12) (push) Successful in 24s
CI / tests (Python 3.13) (push) Successful in 25s
CI / lint (push) Successful in 3s
Reviewed-on: #21
2026-10-30 16:13:33 +00:00
patrickandClaude Sonnet 5.5 4b5dcae2ad Add a one-line summary to each docs page and tidy the development page
CI / tests (Python 3.10) (pull_request) Successful in 25s
CI / tests (Python 3.11) (pull_request) Successful in 25s
CI / tests (Python 3.12) (pull_request) Successful in 24s
CI / tests (Python 3.13) (pull_request) Successful in 24s
CI / lint (pull_request) Successful in 3s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 12:10:45 -04:00
patrickandClaude Sonnet 5.5 e8c996965d Test that README and docs links resolve
Every relative link must point at an existing file and, when it has a #anchor,
at a real heading (slugged the way Gitea does); every docs page must be linked
from the README and link back to it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 12:10:13 -04:00
patrickandClaude Sonnet 5.5 404086ded1 Fix references that moved with the text
'above', 'below' and 'as above' pointed at sections that are now on other
pages, so they become links; server/install.sh's pointer to the README now
names docs/reverse-proxy.md; server.md gains the next steps that used to be
the following README sections.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 12:10:13 -04:00
patrickandClaude Sonnet 5.5 84c9952dd2 Slim the README to an overview and quick start
The README keeps the intro, diagram, status table, a three-step quick start and
an index of the docs/ pages; everything else lives in docs/.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 12:08:10 -04:00
patrickandClaude Sonnet 5.5 77a880880a Move README sections into docs/ pages
Content is moved verbatim (checked line by line against the old README). Each
page gets a title and a link back to the README; H3 sections that become pages
of their own are promoted to H2. The README itself is trimmed next.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 12:07:31 -04:00
patrick e7a9a49438 Merge pull request 'Add kernelwatch status [--json]' (#20) from feat/status-cli into main
CI / tests (Python 3.10) (push) Successful in 25s
CI / tests (Python 3.11) (push) Successful in 25s
CI / tests (Python 3.12) (push) Successful in 25s
CI / tests (Python 3.13) (push) Successful in 24s
CI / lint (push) Successful in 3s
Reviewed-on: #20
2026-10-30 15:46:32 +00:00
patrickandClaude Sonnet 5.5 63b9151b09 Add kernelwatch status [--json]
CI / tests (Python 3.10) (pull_request) Successful in 25s
CI / tests (Python 3.11) (pull_request) Successful in 24s
CI / tests (Python 3.12) (pull_request) Successful in 24s
CI / tests (Python 3.13) (pull_request) Successful in 25s
CI / lint (pull_request) Successful in 4s
Prints the fleet like the dashboard, worst hosts first, from the same
evaluate() call, so the CLI and the dashboard cannot disagree. --json gives
generated_at, whole-fleet counts and a stable per-host object with no secrets;
--host and --level (repeatable) trim the host list. No network surface.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 11:42:59 -04:00
patrick 9d80d3ea4c Merge pull request 'Add heartbeat pings for the alert check and the nightly backup' (#19) from feat/heartbeat into main
CI / tests (Python 3.10) (push) Successful in 25s
CI / tests (Python 3.11) (push) Successful in 25s
CI / tests (Python 3.12) (push) Successful in 25s
CI / tests (Python 3.13) (push) Successful in 24s
CI / lint (push) Successful in 3s
Reviewed-on: #19
2026-10-30 15:35:17 +00:00
patrickandClaude Sonnet 5.5 55a9766418 Document the heartbeat monitor setup
CI / tests (Python 3.10) (pull_request) Successful in 24s
CI / tests (Python 3.11) (pull_request) Successful in 24s
CI / tests (Python 3.12) (pull_request) Successful in 24s
CI / tests (Python 3.13) (pull_request) Successful in 24s
CI / lint (pull_request) Successful in 4s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 11:32:15 -04:00
patrickandClaude Sonnet 5.5 60b8c6bff7 Add heartbeat pings for the alert check and the nightly backup
heartbeat_url is pinged after every alert check that sent its notifications
without failures, and backup_heartbeat_url after every successful nightly
backup, so an external monitor (healthchecks.io, Uptime Kuma) notices when the
alert timer or the backup stops running. A failing heartbeat is logged without
the URL and never fails the work it reports on. kernelwatch test-heartbeat
pings each configured URL once.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 11:31:32 -04:00
patrick e3013921d1 Merge pull request 'Notify via ntfy when the nightly backup fails' (#18) from feat/backup-failure-alert into main
CI / tests (Python 3.10) (push) Successful in 24s
CI / tests (Python 3.11) (push) Successful in 24s
CI / tests (Python 3.12) (push) Successful in 24s
CI / tests (Python 3.13) (push) Successful in 24s
CI / lint (push) Successful in 3s
Reviewed-on: #18
2026-10-30 15:16:58 +00:00
patrickandClaude Sonnet 5.5 48960e6faf Notify via ntfy when the nightly backup fails
CI / tests (Python 3.10) (pull_request) Successful in 25s
CI / tests (Python 3.11) (pull_request) Successful in 24s
CI / tests (Python 3.12) (pull_request) Successful in 24s
CI / tests (Python 3.13) (pull_request) Successful in 25s
CI / lint (pull_request) Successful in 3s
kernelwatch-backup.service gets OnFailure=kernelwatch-backup-failed.service,
which runs notify-backup-failure, so timeouts, OOM kills and crashes are
reported as well as handled errors. The installer ships the new unit, and tests
check that every OnFailure= target is a real unit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 11:13:33 -04:00
patrickandClaude Sonnet 5.5 8a9a3ca56d Add notify-backup-failure command
Sends a high-priority ntfy message that the nightly backup failed, naming the
newest backup still on disk. It exits 1 if the message can't be delivered and 0
(with a note on stderr) when ntfy isn't configured.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 11:12:22 -04:00
patrick 6652a4d795 Merge pull request 'Back up the database nightly with a timer' (#17) from feat/backup-timer into main
CI / tests (Python 3.10) (push) Successful in 26s
CI / tests (Python 3.11) (push) Successful in 24s
CI / tests (Python 3.12) (push) Successful in 24s
CI / tests (Python 3.13) (push) Successful in 24s
CI / lint (push) Successful in 3s
Reviewed-on: #17
2026-10-30 15:06:01 +00:00
patrickandClaude Sonnet 5.5 4a9bc77a08 Back up the database nightly with a timer
CI / tests (Python 3.10) (pull_request) Successful in 23s
CI / tests (Python 3.11) (pull_request) Successful in 25s
CI / tests (Python 3.12) (pull_request) Successful in 24s
CI / tests (Python 3.13) (pull_request) Successful in 24s
CI / lint (pull_request) Successful in 3s
kernelwatch scheduled-backup writes kernelwatch-YYYY-MM-DD.db into backup_dir
and prunes dated copies backup_keep_days or older, only after the new backup
succeeded and only files with exactly that name. kernelwatch-backup.timer runs
it at about 03:30 as the unprivileged service user with no network, and
server/install.sh enables it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:23:45 -04:00
patrick e3010321d7 Merge pull request 'Test both installers against a fake root' (#16) from test/installers into main
CI / tests (Python 3.11) (push) Successful in 24s
CI / tests (Python 3.12) (push) Successful in 23s
CI / tests (Python 3.13) (push) Successful in 23s
CI / lint (push) Successful in 6s
CI / tests (Python 3.10) (push) Successful in 25s
Reviewed-on: #16
2026-10-30 14:22:01 +00:00
patrickandClaude Sonnet 5.5 3624f0e5d9 Test both installers against a fake root
CI / tests (Python 3.10) (pull_request) Successful in 25s
CI / tests (Python 3.11) (pull_request) Successful in 25s
CI / tests (Python 3.12) (pull_request) Successful in 24s
CI / tests (Python 3.13) (pull_request) Successful in 24s
CI / lint (pull_request) Successful in 4s
27 tests run the real scripts with systemctl, apt-get, useradd and friends
stubbed: fresh installs, upgrades keeping config and token, token sources,
REPORT_HOSTNAME handling, apt-update marker, private CA, needrestart, failed
first report, OS warnings, argument errors, and the server's user creation,
config preservation and interrupted-upgrade recovery. Guards that every unit
and script is installed and that deploy.sh ships every file the agent
installer uses.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 09:51:36 -04:00
patrickandClaude Sonnet 5.5 70e5807f59 Let the installers run under a fake root
KERNELWATCH_ROOT prefixes every path agent/install.sh and server/install.sh
read or write and skips their root check. Unset (as in production) every path
is unchanged; the only edits are quoting and mkdir -p for system directories
that already exist.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 09:51:36 -04:00