Repository navigation
Operations and Backups
npm run backupThe command writes backups/<timestamp>/ with a consistent flights.db and
a copy of flight_plans/, then reopens the database to verify it. An optional
destination may be supplied:
npm run backup /path/to/destinationDo not copy an open flights.db alone. SQLite uses WAL mode, so recent commits
may still be in flights.db-wal; the result may be stale or inconsistent.
The supported command uses SQLite's online backup API.
A copy after a clean shutdown is safe because the server checkpoints on SIGINT or SIGTERM.
- Stop the server cleanly.
- Preserve the current data if needed.
- Copy the backed-up
flights.dbandflight_plans/into the project root. - Start the service and verify the flight list and attachments.
Deployments from before authentication/TLS enforcement may refuse to start until three requirements are satisfied in sequence:
- TLS is configured, or plaintext LAN use is explicitly allowed.
-
INGEST_TOKENis configured, or unauthenticated ingest is explicitly allowed. - An operator account exists.
A minimal trusted-LAN migration is:
npm run build
npm run set-password
export INGEST_TOKEN="$(openssl rand -hex 24)"
export ALLOW_PLAINTEXT_HTTP=1
npm startPrefer TLS, update the agent with the same ingest token and new https://
URL, and configure its certificate trust. Startup validation checks the token
before opening the database, so a refusal does not modify flight data.
# Safe online backup
npm run backup
# Fill missing departure/arrival ICAO codes
npm run backfill-icao
# Preview duration corrections, then apply explicitly
npm run backfill-durations
npm run backfill-durations -- --applyBack up before applying data-changing maintenance.