Add federated update script: one-command, roll-backable core updates
release gate / check (push) Failing after 6m16s

Other cores had an installer but no updater — updates meant re-running the
workstation tar-sync by hand. deploy/federated/update.sh ships inside the
app dir (the installer stages deploy/), so every installed core already
has its updater:

  sudo bash /federated/apps/superbrain/deploy/federated/update.sh [git-ref]

Flow, in house-safety order: re-exec from /tmp (the sync overwrites the
running script), clone the repo at REF (default main; sha refs fall back
to full-clone+checkout), record current image ids, compressed pre-update
pg_dump (last 5 retained, emptiness-checked), sync source (.env/data
untouched, .git kept out of the app dir/build context), refresh
lib+service suite files (parse-checked before replacing, backed up),
rebuild, force-recreate (migrate one-shot applies new migrations),
health-probe app+web for up to 3 minutes — and on ANY failure retag the
previous images and recreate, pointing at the dump.

Deliberate non-goal: an in-app update button. The scratch containers have
no docker socket and must never get one (read_only + cap_drop ALL is the
hardening model); host-level operator action is the trust boundary until
CI publishes registry images, at which point the generic house upgrade
flow and the panel button supersede this script (IMAGE_VERSION_HOLD comes
out of .env).

Also: .dockerignore gains .update-backups (dumps live under the app dir,
which is the build context); README/STRATEGY/install.sh document the
update path. shellcheck clean; tested live on the production core.
This commit is contained in:
Andrew S Erwin
2026-10-28 20:05:10 -05:00
parent 0848453732
commit e0d922547b
5 changed files with 173 additions and 7 deletions
+4 -3
View File
@@ -189,7 +189,8 @@ $(say "Superbrain installed")
Other users are provisioned upstream (Superpanel -> LDAP -> Authelia) and
appear in Superbrain on their first SSO login.
Upgrades: the interim source-build mode is pinned (IMAGE_VERSION_HOLD=1);
update by re-staging the source and rebuilding — see
deploy/federated/STRATEGY.md and the lib-superbrain.sh header.
Upgrades (interim source-build mode): one command on the host —
sudo bash /federated/apps/superbrain/deploy/federated/update.sh [git-ref]
(clone -> pg_dump -> rebuild -> recreate -> health probe -> auto-rollback
on failure). See deploy/federated/STRATEGY.md.
EOF