Operating › Configuration

Configuration

One YAML file, every key overridable by an environment variable.

Uptimer reads a YAML config (--cfg, default configs/default.yml). Every key can be overridden by an environment variable using the UPTIMER__ prefix with __ between levels. Env wins over YAML; built-in defaults fill the rest.

# equivalent
echo 'server: { ui: { port: 8080 } }' > my.yml && uptimer --cfg my.yml server
UPTIMER__SERVER__UI__PORT=8080 uptimer server

Common keys

KeyEnvDefaultPurpose
server.ui.portUPTIMER__SERVER__UI__PORT2517Web UI and REST API (served under /api).
server.db.dsnUPTIMER__SERVER__DB__DSNsqlite3:///data/server_db.sqliteControl-plane database (see below).
server.db.boot_migrateUPTIMER__SERVER__DB__BOOT_MIGRATEtrueMigrate at boot; set false when a dedicated migrate job runs migrations.
server.sqids_saltUPTIMER__SERVER__SQIDS_SALT(change me)Salt for public IDs — set a unique value in production.
server.auth.devUPTIMER__SERVER__AUTH__DEVfalseFake auth — any visitor is admin. Dev only.
server.auth.oidc.*UPTIMER__SERVER__AUTH__OIDC__*Real login via OIDC — see Authentication.
grpc.portUPTIMER__GRPC__PORTWorker gRPC channel (reference deploys use 50051).
worker.grpc_serverUPTIMER__WORKER__GRPC_SERVERWhere a worker dials the server.
general.data_dirUPTIMER__GENERAL__DATA_DIR/data/Keys, IDs and SQLite live here — persist it.
general.site_urlUPTIMER__GENERAL__SITE_URLBase URL used in alert links.
general.logging.levelUPTIMER__GENERAL__LOGGING__LEVELDEVDEV or PROD.
general.metrics_portUPTIMER__GENERAL__METRICS_PORTPrometheus port when --metrics is set — see Metrics.

Choosing a database

The DSN scheme selects the backend:

DSNBackendUse for
sqlite3://…SQLiteLocal dev and throwaway instances (schema via GORM auto-migrate).
postgres://…PostgreSQLAnything you keep (versioned migrations + data backfills; upgrade-safe).

SQLite is zero-setup and perfect for trying Uptimer, but its schema is auto-migrated and not guaranteed safe across upgrades. For production, use PostgreSQL — its migrations are versioned and applied by the migrate command, so an upgrade is brought to head atomically instead of half-applying under a booting replica. Switching backend is a fresh database, not a data migration.