Reverse proxy
Set trusted proxy IPs, overwrite X-Forwarded-For, use an HTTPS base URL.
One Go binary, one PostgreSQL database.
| Setting | Purpose |
|---|---|
| SUPERMETRY_DATABASE_URL | PostgreSQL URL. |
| SUPERMETRY_SECRET_KEY | Base64 of 32+ random bytes. Lose it and stored TOTP and alert secrets break. |
| SUPERMETRY_BASE_URL | Public URL, HTTPS in production. |
cp .env.example .env
# Set the three required values in .env
cd deploy
docker compose up -d --build# Leave SUPERMETRY_DATABASE_URL unset
docker compose --profile bundled-db up -d --buildConfig comes from ./.env or SUPERMETRY_ENV_FILE. Real environment variables win.
Needs Go and Bun. Migrations run at startup.
make build
export SUPERMETRY_DATABASE_URL='postgres://…'
export SUPERMETRY_SECRET_KEY="$(openssl rand -base64 32)"
export SUPERMETRY_BASE_URL='https://analytics.example.com'
bin/supermetrySet trusted proxy IPs, overwrite X-Forwarded-For, use an HTTPS base URL.
/healthz, /readyz, /metrics. Guard metrics with SUPERMETRY_METRICS_TOKEN or loopback.
| Task | How |
|---|---|
| Backup | supermetry backup --out FILE writes a mode-0600 archive (PostgreSQL dump plus manifest). Needs PostgreSQL client tools. |
| Restore | Stop the app, run supermetry restore FILE --yes, restart. Newer-schema archives are refused. |
| Upgrade | Replace the binary or image and restart. Migrations run; rollups rebuild in the background. |
| Replay | Enable per instance and per project. Files go in the data directory or S3. |