Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1.7 KiB
Development
Running the tests and a local server.
make test # unit + integration tests (stdlib unittest)
make lint # shellcheck, if available
Gitea Actions (.gitea/workflows/ci.yml) runs both on every push to main
and every pull request: the tests on Python 3.10–3.13 (the versions on the
supported Ubuntu and Debian releases) and shellcheck on the shell scripts.
The tests run a real server on an ephemeral port. They also run the real agent
script against stubbed dpkg-query/apt-get/needrestart/uname and a fake
filesystem root (KERNELWATCH_ROOT), including one end-to-end agent → server
report.
Both installers (agent/install.sh, server/install.sh) run for real in the tests
against a fake root: KERNELWATCH_ROOT prefixes every path they write and skips
their root check, and systemctl, apt-get, useradd and the like are stubs that
log their arguments. Don't set it on a real host.
tests/test_docs.py checks that every relative link and #anchor in the README
and docs/ resolves, so move or rename a heading and it tells you what broke.
Run a local server against a scratch database:
printf 'db_path = "/tmp/kw.db"\nsecure_cookies = false\n' > /tmp/kw.toml
export KERNELWATCH_CONFIG=/tmp/kw.toml
./server/kernelwatch-server set-password admin
./server/kernelwatch-server serve # http://127.0.0.1:8080
Ideas for later
- Additional notification channels
- An HTTP endpoint for
kernelwatch status, behind a hashed API token and your proxy's IP allow-list, if something has to poll remotely (the CLI already covers scripting on the dashboard host) - Grouping or tagging hosts (prod/staging, location)