Databases, Backups & Where Secrets Live
1. Two Completely Isolated PostgreSQL 15 Databases
| Environment | Docker Container | Named Volume | Studio UI (VPN Only) |
|---|---|---|---|
| PRODUCTION | supabase-db | supabase-db-data | https://supabase-studio.planovi.app |
| DEVELOPMENT | supabase-db-dev | supabase-db-data-dev | https://dev-supabase-studio.planovi.app |
Both databases expose PostgREST schemas: public, storage, graphql_public, website.
2. Nightly Backups & Point-in-Time Restore
Backups run automatically via /opt/vps-stack/scripts/backup_databases.sh and are stored as compressed .sql.gz dumps in /opt/vps-stack/backups/ (14-day retention).
# Trigger an immediate manual backup (both PROD & DEV)/opt/vps-stack/scripts/backup_databases.sh
# List available backupsls -lh /opt/vps-stack/backups/
# Restore a backup into DEV first to verify!gunzip -c /opt/vps-stack/backups/<BACKUP_FILE>.sql.gz | docker exec -i supabase-db-dev psql -U postgres -d postgres3. Where Secrets Live (Never in Git!)
All production credentials are stored canonically in PA Management β Module βLoginyβ and deployed onto the VPS into these exact files:
| Secret File on VPS | Used By | Security Rule |
|---|---|---|
/opt/vps-stack/.env | Docker Compose (Supabase, Edge Functions, Deployer, Converters API) | Root-only on VPS. Holds POSTGRES_PASSWORD, JWT_SECRET, STRIPE_*, GEMINI_API_KEY, RESEND_API_KEY, WEBHOOK_SECRET, DEALFLOW_API_SECRET, SCHEDULER_API_SECRET. |
/opt/vps-apps/flutter-app/prod.public.env | Flutter Web PROD (panel.planovi.app) | Public browser bundle only! vps-deployer aborts deploy if any key matches SERVICE_ROLE, SECRET, TOKEN, PRIVATE, PASSWORD, or API_KEY. |
/opt/vps-apps/flutter-app/dev.public.env | Flutter Web DEV (dev-panel.planovi.app) | Same public-only guard enforced by inject_flutter_env(). |
/opt/vps-stack/cloudflare-ssl/ | Nginx, converters-api-*, Firmware builder | Private keys for Cloudflare SSL, planovi-device-ca.key, and ECDSA P-256 ota-signing-key.pem. |
Need to check which Edge Function or Docker service consumes a specific variable name? See Environment Variables Matrix (Keys Only) β.