diff --git a/scripts/cutover-db.sh b/scripts/cutover-db.sh index c24d25a..1082056 100755 --- a/scripts/cutover-db.sh +++ b/scripts/cutover-db.sh @@ -30,6 +30,12 @@ "${ARGS[@]}" +if [ -n "${GNEXUS_BOOK_OWNER_JSON:-}" ]; then + echo "==> Assigning current data to the owner from $GNEXUS_BOOK_OWNER_JSON" + (cd "$SERVER_DIR" && .venv/bin/python -m app.storage.cli assign-owner \ + --user-json "$GNEXUS_BOOK_OWNER_JSON") +fi + "$REPO_ROOT/scripts/backup-db.sh" echo diff --git a/server/.env.example b/server/.env.example index 4e08fe2..9cb6c6c 100644 --- a/server/.env.example +++ b/server/.env.example @@ -23,6 +23,9 @@ # GNEXUS_BOOK_INTERNAL_ALLOWLIST=127.0.0.1,::1 # GNEXUS_BOOK_INTERNAL_RATE_LIMIT=60 +# Owner JSON used by cutover-db.sh to assign imported data to the first admin. +# GNEXUS_BOOK_OWNER_JSON=/path/to/owner.json + # Operations: off-host backups, health probes and Synapse alerts. # GNEXUS_BOOK_BACKUP_DIR=/mnt/backups/gnexus-book/db # GNEXUS_BOOK_BACKUP_KEEP=14