Builds on #132 (signing) and #133 (agent images) and contains their commits; merge those first, then this diff shrinks to the launcher.
Image variantuptimesebi-checker:<tag>-autoupdate / uptimesebi-statuspage:<tag>-autoupdate: the plain image plus one layer with /usr/local/bin/launcher as entrypoint (UPTIME_LAUNCHER_AGENT baked in). Chosen by image, not by an environment variable; the plain image has no update code.
APIGET /agent/v1/update (agent token): {"version": "<API release>", "image": "<UPTIME_AGENT_IMAGE>-<kind>:<tag>"}; no image for unreleased builds (dev). The call does not register an instance or count as a sign of life. New setting UPTIME_AGENT_IMAGE (default git.zb-server.de/zb-server/uptimesebi) for mirrors.
Launcher (internal/launcher, cmd/launcher):
runs the agent as a child, forwards shutdown; checks every 15 min (±10 %, first check after 30 s);
downloads the agent binary for its own platform (GOARM read from build info) from the image, after verifying the index signature: minisign over uptimesebi-<agent>@<digest> with the release version as trusted comment, from sha256-<hex>.minisig next to the image — keys from internal/signing/release.pub. An old release cannot be passed off as a new one, a moved tag or a foreign key is rejected, blobs are read by digest;
checks the downloaded binary reports the expected release (<agent> version), keeps it on the data volume, swaps gracefully (SIGTERM, shutdown timeout + 10 s), waits up to 2 min for /readyz, otherwise rolls back and skips that release for 6 h; a remembered release that crashes right after a restart falls back to the bundled one;
keeps only the current and the previous download.
agentimage (moved from tools/image): Build (optional launcher layer), ChannelTags (the first tag is the exact version the API names), Publish, Sign, Fetch, ReadFile. CI builds tools/image once and pushes plain + autoupdate for both agents, signed when RELEASE_SIGNING_KEY is set. The kaniko job now needs: build and uses its version (commit date + sha), so the API's release and the agent tags match on edge too.
Verified end to end with Docker against the dev API on :8080 (temporarily rebuilt as v0.0.2-test2 with a local registry, then restored): an edge-autoupdate container on v0.0.1-test1 found v0.0.2, verified it with the real release key, switched (release switched), stayed healthy; after docker restart it started v0.0.2 straight from the volume. Unit tests cover update, restart, rollback, crash fallback, bad/unsigned/foreign-signed downloads, invalid release names (-race -count=10). ARM binaries not executed (no QEMU here).
Not done: reporting launcher failures to the API (logged only); the console's outdated badge comes with #131.
> Builds on #132 (signing) and #133 (agent images) and contains their commits; merge those first, then this diff shrinks to the launcher.
**Image variant** `uptimesebi-checker:<tag>-autoupdate` / `uptimesebi-statuspage:<tag>-autoupdate`: the plain image plus one layer with `/usr/local/bin/launcher` as entrypoint (`UPTIME_LAUNCHER_AGENT` baked in). Chosen by image, not by an environment variable; the plain image has no update code.
**API** `GET /agent/v1/update` (agent token): `{"version": "<API release>", "image": "<UPTIME_AGENT_IMAGE>-<kind>:<tag>"}`; no image for unreleased builds (`dev`). The call does not register an instance or count as a sign of life. New setting `UPTIME_AGENT_IMAGE` (default `git.zb-server.de/zb-server/uptimesebi`) for mirrors.
**Launcher** (`internal/launcher`, `cmd/launcher`):
- runs the agent as a child, forwards shutdown; checks every 15 min (±10 %, first check after 30 s);
- downloads the agent binary for its own platform (GOARM read from build info) from the image, after verifying the index signature: minisign over `uptimesebi-<agent>@<digest>` with the release version as trusted comment, from `sha256-<hex>.minisig` next to the image — keys from `internal/signing/release.pub`. An old release cannot be passed off as a new one, a moved tag or a foreign key is rejected, blobs are read by digest;
- checks the downloaded binary reports the expected release (`<agent> version`), keeps it on the data volume, swaps gracefully (SIGTERM, shutdown timeout + 10 s), waits up to 2 min for `/readyz`, otherwise rolls back and skips that release for 6 h; a remembered release that crashes right after a restart falls back to the bundled one;
- keeps only the current and the previous download.
**agentimage** (moved from tools/image): `Build` (optional launcher layer), `ChannelTags` (the first tag is the exact version the API names), `Publish`, `Sign`, `Fetch`, `ReadFile`. CI builds `tools/image` once and pushes plain + autoupdate for both agents, signed when `RELEASE_SIGNING_KEY` is set. The kaniko job now `needs: build` and uses its version (commit date + sha), so the API's release and the agent tags match on edge too.
**Verified end to end** with Docker against the dev API on :8080 (temporarily rebuilt as `v0.0.2-test2` with a local registry, then restored): an `edge-autoupdate` container on `v0.0.1-test1` found v0.0.2, verified it with the real release key, switched (`release switched`), stayed `healthy`; after `docker restart` it started v0.0.2 straight from the volume. Unit tests cover update, restart, rollback, crash fallback, bad/unsigned/foreign-signed downloads, invalid release names (`-race -count=10`). ARM binaries not executed (no QEMU here).
Not done: reporting launcher failures to the API (logged only); the console's outdated badge comes with #131.
Closes #129
Closes #128
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Releases carry SHA256SUMS signed in the minisign format (prehashed
Ed25519, the release tag as trusted comment) and an SPDX SBOM of the Go
modules and the npm packages the frontend build bundles. internal/signing
signs and verifies; the release keys are committed in release.pub and
compiled in, so the self-updating agents can check their downloads.
Without the RELEASE_SIGNING_KEY secret a release is published unsigned
with a warning.
Closes#34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
uptimesebi-checker and uptimesebi-statuspage for linux/amd64, arm64,
arm/v7 and arm/v6, from a Raspberry Pi Zero to servers. tools/image
assembles them from the cross-compiled binaries without Docker or
emulation: one layer on an empty base with the binary, a data volume
owned by the unprivileged user and a HEALTHCHECK running the new
`checker health` / `statuspage health` commands. The binaries embed time
zone data and fallback CA roots, so no base image ever needs updating.
CI pushes them with the same channel tags as the main image; releases
carry tarballs for all four platforms.
Refs #128
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
The -autoupdate variant of the checker and status page images adds a
launcher layer. The launcher runs the agent as a child process and keeps
it on the platform's release: GET /agent/v1/update names the API's own
release and the agent image for it, the launcher downloads the binary
for its platform from the registry, accepts it only when the index is
signed with a release key for exactly that version, swaps the agent
gracefully and rolls back when the new release does not become ready or
crashes right after starting. Agents never get ahead of the API, and
installations on unreleased builds are not followed.
CI pushes both variants and signs each index with RELEASE_SIGNING_KEY
(minisign signature in a sha256-<digest>.minisig image next to it). The
image builder moves to internal/agentimage; the API image job takes the
build job's version so the API reports the release its agents are tagged
with. Agents gain a version command.
Closes#129Closes#128
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Image variant
uptimesebi-checker:<tag>-autoupdate/uptimesebi-statuspage:<tag>-autoupdate: the plain image plus one layer with/usr/local/bin/launcheras entrypoint (UPTIME_LAUNCHER_AGENTbaked in). Chosen by image, not by an environment variable; the plain image has no update code.API
GET /agent/v1/update(agent token):{"version": "<API release>", "image": "<UPTIME_AGENT_IMAGE>-<kind>:<tag>"}; no image for unreleased builds (dev). The call does not register an instance or count as a sign of life. New settingUPTIME_AGENT_IMAGE(defaultgit.zb-server.de/zb-server/uptimesebi) for mirrors.Launcher (
internal/launcher,cmd/launcher):uptimesebi-<agent>@<digest>with the release version as trusted comment, fromsha256-<hex>.minisignext to the image — keys frominternal/signing/release.pub. An old release cannot be passed off as a new one, a moved tag or a foreign key is rejected, blobs are read by digest;<agent> version), keeps it on the data volume, swaps gracefully (SIGTERM, shutdown timeout + 10 s), waits up to 2 min for/readyz, otherwise rolls back and skips that release for 6 h; a remembered release that crashes right after a restart falls back to the bundled one;agentimage (moved from tools/image):
Build(optional launcher layer),ChannelTags(the first tag is the exact version the API names),Publish,Sign,Fetch,ReadFile. CI buildstools/imageonce and pushes plain + autoupdate for both agents, signed whenRELEASE_SIGNING_KEYis set. The kaniko job nowneeds: buildand uses its version (commit date + sha), so the API's release and the agent tags match on edge too.Verified end to end with Docker against the dev API on :8080 (temporarily rebuilt as
v0.0.2-test2with a local registry, then restored): anedge-autoupdatecontainer onv0.0.1-test1found v0.0.2, verified it with the real release key, switched (release switched), stayedhealthy; afterdocker restartit started v0.0.2 straight from the volume. Unit tests cover update, restart, rollback, crash fallback, bad/unsigned/foreign-signed downloads, invalid release names (-race -count=10). ARM binaries not executed (no QEMU here).Not done: reporting launcher failures to the API (logged only); the console's outdated badge comes with #131.
Closes #129
Closes #128
🤖 Generated with Claude Code
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3