spin-archive.org is an internet archive project dedicated to preserving the history of pen spinning.
The app runs as a single Fly Machine with its SQLite database on a volume
mounted at /data (see fly.toml). The Machine stops when idle and starts on
the next request.
fly volumes create spin_archive_data --region sjc --size 1 # once
fly secrets set ROCKET_SECRET_KEY=$(openssl rand -base64 32) \
AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... COCONUT_API_KEY=... \
DISCORD_WEBHOOK_URL=... DISCORD_CONTRIBUTOR_WEBHOOK_URL=...
fly deployROCKET_SECRET_KEY must stay stable, or every login is invalidated whenever
the Machine restarts. Migrations run automatically on startup.
scripts/pg_to_sqlite.py copies the old Postgres database into a new SQLite
file using the schema in migrations/. It needs Python 3 and psql.
echo 'PG_URL=postgresql://user:pass@host:25060/db?sslmode=require' > .env.migrate
python scripts/pg_to_sqlite.py --out spin-archive.db --keep-csv exports/It checks foreign keys and integrity, compares row counts with Postgres, and exits non-zero if anything doesn't match. To upload the result:
fly ssh sftp shell # put spin-archive.db /data/spin-archive.db
fly machine restart