Upgrade & rollback
wattcloud-update is installed alongside the relay and follows the same
trust chain as install.sh: cosign verification against
TRUSTED_SIGNER_IDENTITY, then atomic symlink swap, then health check, then
auto-rollback on failure.
Routine upgrade
Section titled “Routine upgrade”sudo wattcloud-update # latest stableLatest stable means the newest tag without a prerelease suffix
(v1.0.0-rc.1 is skipped, v1.0.0 is not). The current symlink points at
the new release once /health comes back green.
Pinning to a specific version
Section titled “Pinning to a specific version”sudo wattcloud-update vX.Y.ZUseful for staged rollouts across multiple hosts, or for deferring a release while a regression is investigated.
Rollback
Section titled “Rollback”sudo wattcloud-update --rollback--rollback swaps current back to the previously running release directory
and restarts the unit. Past releases stay on disk for this exact reason, so
the rollback is a symlink flip — no download, no verify step.
The number of releases retained is governed by WC_KEEP_RELEASES in
/etc/wattcloud/wattcloud.env (default: 3). Older releases past that limit
are pruned at the end of each successful update.
What an update actually does
Section titled “What an update actually does”flockthe update lock so two concurrent invocations cannot race.- Resolve the target tag via the GitHub API (stable only by default; skipped for prereleases unless the tag is explicit).
- Download the per-arch tarball,
.sig, and.cert. cosign verify-blobagainstTRUSTED_SIGNER_IDENTITY. Failure aborts here — no extraction.- Extract to
/opt/wattcloud/releases/vX.Y.Z/. - Diff
.env.exampleagainst the live/etc/wattcloud/wattcloud.env. If the new release introduces required keys that are missing, abort with a human-readable list. No rollback is needed because the symlink was not touched. - Reinstall the systemd unit only if the unit file content changed
compared to the running unit.
daemon-reloadif so. - Atomic symlink swap of
/opt/wattcloud/current. systemctl reload-or-restart wattcloud, then poll/healthfor up to 30 seconds.- Auto-revert on health failure: if
/healthdoes not come back, the symlink and unit are rolled back and the service is restarted on the previous release. Broken deploys never persist ascurrent. - Prune all but the last
WC_KEEP_RELEASESrelease directories.
Verifying the update yourself
Section titled “Verifying the update yourself”If you want to inspect a release before letting wattcloud-update install
it:
TAG=vX.Y.Zgh release download "$TAG" --repo wattzupbyte/wattcloudmake verify-tarball \ TARBALL=wattcloud-${TAG}-x86_64-unknown-linux-gnu.tar.gz \ SIG=…sig CERT=…certmake verify-tarball runs the same cosign verify-blob invocation that
install.sh uses, so a green local verify means the release will pass on
the VPS too.
When the update aborts before flipping current
Section titled “When the update aborts before flipping current”Common causes:
- Cosign verification failure. Either the release was tampered with, or
TRUSTED_SIGNER_IDENTITYdoes not match the source repo.journalctl -u wattcloudfor the live release; the new release directory will have been removed. - Missing required env keys. The release diff prints the list of keys
the new version expects but cannot find in
/etc/wattcloud/wattcloud.env. Add the keys, then re-runwattcloud-update. /healthdoes not come back. Auto-rollback fires; the previous release is restored.journalctl -u wattcloud --since "5 min ago"is the first place to look for the cause. If the new release made it to the symlink-swap step at all, the new directory stays on disk under/opt/wattcloud/releases/for forensics.
Adjacent docs
Section titled “Adjacent docs”- The first-time install → One-command install.
- Locking the instance down → Access control.
- Auto-rollback didn’t help and you need to investigate → Troubleshooting.