Repository navigation
In-app updates and self-hosted image builds - #8
Merged
Merged
Conversation
Settings > Updates (admins): installed version and build sha, newer releases from GitHub with their notes, and either an "Update to x.y.z" button or the compose commands to run by hand. - src/server/updates: tiny semver, GitHub Releases client (1h cache, stale on failure, refresh at most once a minute), updater client - GET /api/updates, POST /api/updates/apply (admin), version in /api/health - deploy/updater: sidecar with the Docker socket. The app asks it to move the compose project to a version; a helper container started from the same image pins STOWAGE_VERSION in .env, pulls, recreates the running services and finally the updater itself. State lives in a shared volume so the recreated updater reports the run; a vanished helper is reported as failed. Opt-in via `--profile updater` in docker-compose.release.yml. - Release workflow: per-platform native builds (amd64 on the runner named by the CI_RUNNER variable, arm64 on ubuntu-24.04-arm), digests merged into multi-arch manifests, registry layer caches, GIT_SHA build arg, stowage-updater image. - Docs: README "Updating", RELEASING "Where builds run", env vars, changelog. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Sidecar: pass the operator's env files to compose and pin the version in them only after the pull succeeds; update every service of the project, not just running ones; stop and fail a run after 30 minutes; a failure while recreating the updater itself no longer fails the app update; constant-time token compare; 400 on bad JSON; generic 500 body; mount compose/env file directories outside the project; Mounts instead of bind strings; shorter error messages. App: 30 s timeout to start an update and a refetch after apply errors so a started run is followed; Stop following/Reload in every phase and slow copy after 10 minutes; Check now reports stale lists and recent checks honestly; zod-validated updater status; github.com-only release links; token hint on 401; links and bold rendered as text in notes. Docs and tests: STOWAGE_RELEASE_REPO, check cadence and exported STOWAGE_VERSION notes; route, view and component tests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Admins get Settings > Updates: the installed version and build, newer releases from GitHub with their notes, and a one-click Update to x.y.z when the new
updatersidecar runs. Without it the page shows the compose commands to run by hand.Release images are now built on the self-hosted runner (amd64) and GitHub's native arm runner (arm64), then merged into multi-arch manifests. No more QEMU.
How the update works
--profile updater,STOWAGE_UPDATER_TOKENshared with the app) and only reachable on the compose network../pb_dataresolve correctly because the helper mounts the project directory at the same path the host uses./api/healthand reloads when a different version answers.Release pipeline
buildmatrix:{app, pocketbase, caddy, updater} × {linux/amd64, linux/arm64}; amd64 on${{ vars.CI_RUNNER || 'ubuntu-latest' }}(set toproxmox, runnergh-runner-stowageregistered on Proxmox CT 105), arm64 onubuntu-24.04-arm.publishmerges the digests per image into the semver/latesttags.<image>:buildcache-linux-{amd64,arm64}in GHCR.GIT_SHAbuild arg →STOWAGE_BUILD_SHA, shown next to the version.Review fixes
Two independent reviews ran on the first commit; everything they found is fixed in the follow-up commit:
--env-files to compose (secrets interpolated the same way as on the host) and pins the version in each of them, after the pull succeeds. A failed pull changes nothing.Mountsso paths with:work.STOWAGE_RELEASE_REPOdocumented, the hourly-check wording corrected, a note that a shell-exportedSTOWAGE_VERSIONwins over.env.Test plan
pnpm typecheck,pnpm lintcleanpnpm test: 92 files, 428 tests;vitest --config vitest.pb.config.ts src/server/updates src/app/api/updates: 27 tests.envpinned only on success, every service recreated, relative./datamount kept its host path,--env-filepassed through, updater recreated itself last, new instance reports the result, helper cleaned upSTOWAGE_UPDATER_URLpointed at that sidecar:GET /api/updatesreturns the sidecar status,POST applywith a non-newer version is refused, anonymous gets 401🤖 Generated with Claude Code