diff --git a/deploy/federated/update.sh b/deploy/federated/update.sh index 05305c9..5808556 100755 --- a/deploy/federated/update.sh +++ b/deploy/federated/update.sh @@ -89,8 +89,21 @@ rollback() { } # --- 4. Sync, refresh suite files, build, recreate -------------------------------- -say "Syncing source into $APP_DIR (.env and data untouched)" -cp -a "$STAGE/." "$APP_DIR/" +# Payload-sync ONLY the tracked source paths (same list as the installer's +# staging). Never `cp -a` the whole clone over the app dir: the app dir's +# docker-compose.yml is GENERATED by config_superbrain (fixed IPs, core +# network, env_file) and the repo's dev compose would clobber it — hit in +# production 2026-10-29, caught by the rollback. .env, .update-backups and +# the generated compose are untouchable here. +say "Syncing source into $APP_DIR (generated compose/.env/data untouched)" +(cd "$STAGE" && tar cf - --exclude=node_modules --exclude=.next \ + main.go go.mod go.sum Dockerfile .dockerignore internal db web deploy) \ + | tar xf - -C "$APP_DIR" + +# Sanity: the app dir must still hold the GENERATED federated compose +# (config_superbrain's), not the repo's dev stack. +grep -q "container_name: superbrain-app" "$APP_DIR/docker-compose.yml" \ + || die "$APP_DIR/docker-compose.yml is not the generated federated compose — refusing to build against it" # Keep the house integration in step with the repo (both are backed up by # install.sh conventions; a failing lib parse aborts BEFORE anything else).