- docker-compose with Postgres 16 + slim Python API image - FastAPI app with session middleware, health endpoint, static login page - Google OAuth (Authlib) with email invite-list whitelist; admin role support - User + OAuthToken models; refresh tokens encrypted at rest (Fernet) - Alembic migrations, run automatically on container startup - Postgres backup/restore scripts for portability between machines
11 lines
517 B
Bash
11 lines
517 B
Bash
#!/bin/sh
|
|
# Restores a Subfeed Postgres dump created by backup.sh into the running db container.
|
|
# Usage: ./scripts/restore.sh backups/subfeed-YYYYMMDD-HHMMSS.dump
|
|
set -e
|
|
FILE="$1"
|
|
if [ -z "$FILE" ]; then echo "Usage: restore.sh <dumpfile>"; exit 1; fi
|
|
if [ ! -f "$FILE" ]; then echo "Dump file not found: $FILE"; exit 1; fi
|
|
USER_NAME="${POSTGRES_USER:-subfeed}"
|
|
DB_NAME="${POSTGRES_DB:-subfeed}"
|
|
docker compose exec -T db pg_restore -U "$USER_NAME" -d "$DB_NAME" --clean --if-exists < "$FILE"
|
|
echo "Restored $FILE"
|