Updates
Production, Development, or Manual, chosen under Admin → System health and carried out by a host updater that backs up first, rolls back on failure, and never runs as root.
Trove KB can keep itself up to date. An administrator picks how under Admin → System health, and a small host updater on the server does the work. The app itself never updates itself: it has no Docker, git, or systemd access, and the updater, not the app, is what touches the server.
Channels
| Channel | What it installs |
|---|---|
| Production | Each new tagged release (v1.2.3) at the update hour |
| Development | The newest build of the dev branch (dev-<commit>) at the update hour. For test and staging servers |
| Manual | Nothing on its own. The default. System health still shows what is available on the running build’s own track |
The Update hour is server time, and a short restart happens during the update. Update now asks for the update straight away; the updater checks every 10 minutes, so it is picked up within that.
The updater never installs an older build: the target must descend from the commit that is running, because migrations only go forward. A server moved from Development to Production therefore waits until a release includes the dev build it is running. Right after a change of channel, System health says the host has yet to check the new channel rather than showing the old one’s build.
System health
Admin → System health shows, refreshing every 30 seconds:
- Build info: the version, commit, and build time that are running. A Production server runs a release tag such as
v0.2.1; a Development server runsdev-<sha7>. The footer names the same build. - Updates: the channel and update hour, what is running against what is latest available, and what the host said on its last check. If the updater is not installed, or has stopped checking in, this says so and gives the command to run on the server.
- Coming in the next version: the changes the next update brings, before it installs. Only administrators see this preview.
- Recent updates: each update, rollback, and failure, with its message.
- What’s new history: what each update brought, as people saw it in the pop-up.
- Counts for the instance: companies, documents, knowledge base articles, users, webhook retries waiting, and database size.
Every change of channel, and every update, rollback, and failure, is also in the audit log.
What’s new
After an update, everyone gets a What’s new window once, listing what changed: new features, improvements, and bug fixes, each marked by color. Administrators see every entry; everyone else sees only the entries written for people who read and edit documentation, and no window at all when there are none. Someone who missed several updates sees them together.
The entries ship with each build, one short note per user-visible change, written for the people using Trove KB rather than for developers.
Installing the host updater
The updater is in updater/ in the checkout, run by a systemd timer every 10 minutes. It reads the administrator’s choice from the app, does the update, and reports back. The installer needs .env filled in first, and the checkout must belong to the user the updater runs as, because the updater checks out new versions there.
Docker
The updater runs as an ordinary user in the docker group, never as root, and the containers never get Docker access.
sudo updater/install-updater.sh # as the checkout's owner, or --user <name>
It first checks that the image for TROVE_IMAGE_TAG can be pulled, and changes nothing if it can’t. Then it adds TROVE_UPDATER_TOKEN to .env, starts the stack on the published image, and enables the timer. Re-running it is safe and keeps the token.
Extra compose files go in .env as COMPOSE_FILE, which the updater’s docker compose reads too:
COMPOSE_FILE=docker-compose.yml:docker-compose.nfs.yml
The optional sidecars (--profile vault for Bitwarden, --profile onepassword for 1Password Connect) stay on across updates: before each deploy the updater turns on every profile that has a service running, so the new build’s sidecar definitions apply too, and a rollback puts the old ones back. A sidecar you stopped stays stopped. To fix the list instead, set it in .env:
COMPOSE_PROFILES=vault
The updater runs from the checkout, so a fix to it takes effect from the update after the one that brings it.
Bare metal
No Docker: Node 22, npm, git, PostgreSQL, and pg_dump for the backups.
git clone https://github.com/joshhearne/trove-kb.git /opt/trove-kb # owned by the app's user
cp /opt/trove-kb/.env.example /opt/trove-kb/.env
# DATABASE_URL at your Postgres (not db:5432), AUTH_SECRET, APP_URL, APP_PORT,
# and STORAGE_PATH somewhere that user can write
sudo /opt/trove-kb/updater/install-updater.sh --mode bare-metal --user trove
That installs trove-kb.service, which runs the app as that user from releases/<version> through a current link, builds the first release from the checkout, and enables the timer. Each update is built beside the running release and switched in one step, so a failed build changes nothing and a rollback is instant. The one privileged thing the updater does is systemctl restart trove-kb.service, allowed by a single sudoers line.
What an update does
- Dumps the database into
backups/, gzipped. The newest seven pre-update dumps are kept. - Deploys the target: on Docker it pins
TROVE_IMAGE_TAGand restarts the stack; on bare metal it builds the release and switchescurrent. - Waits for the app to answer as the new build, five minutes by default.
- If it doesn’t, puts the previous build back and records Rolled back with the reason; the pre-update dump stays in
backups/. A build that failed is not retried every 10 minutes for the rest of the hour: it is skipped until a newer build arrives or someone presses Update now. - Reports the outcome to System health.
The updater refuses to run on a checkout with local changes to tracked files, and says so on System health: commit or discard them first. Host-specific files, such as a compose override, are ignored by git and are fine.
By hand
On a Manual server, or to install a particular build now whatever the channel:
updater/trove-kb-update.sh --install v0.2.1
It takes the same backup and rolls back the same way. Logs are in journalctl -u trove-kb-update.
Images
Every build is published to the GitHub Container Registry:
| Tag | What it is |
|---|---|
ghcr.io/joshhearne/trove-kb:stable | The newest release |
:vX.Y.Z | One release, such as :v0.2.1 |
:dev-<sha7> | One build of the dev branch |
:dev | The newest build of the dev branch |
docker-compose.yml runs ${TROVE_IMAGE_TAG}, stable unless .env says otherwise; the updater sets it once installed. A release is a vX.Y.Z tag on a tested dev commit, so a Development server has already run every commit a release contains.
Building from source
To run your own changes, build from the checkout with the build override instead of pulling:
docker compose -f docker-compose.yml -f docker-compose.build.yml up -d --build
Put COMPOSE_FILE=docker-compose.yml:docker-compose.build.yml in .env to make that the default. The image is tagged trove-kb:local, so it never collides with, or gets replaced by, a published one. The host updater manages the published images only.