Skip to content

Environment variables ​

The backend reads its configuration from environment variables. Compose supplies them through .env; native Linux uses /etc/usage-dashboard/backend.env; a standalone container receives them from its container manager. Values with a default are optional.

Core ​

VariableDescription
DATABASE_URLAsync SQLAlchemy URL. Compose derives a PostgreSQL URL when this is blank. Native and standalone deployments must set a postgresql+asyncpg:// URL. The application default SQLite URL is for development only.
ENCRYPTION_KEYRequired Fernet key used to encrypt API credentials at rest. Generate with python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())".

Database (Compose) ​

VariableDescription
POSTGRES_DBPostgreSQL database name. Defaults to usage_dashboard.
POSTGRES_USERPostgreSQL user. Defaults to usage_dashboard.
POSTGRES_PASSWORDPostgreSQL password. Defaults to change-me (change it).
POSTGRES_IMAGEPostgreSQL image used by Compose. Defaults to postgres:18-alpine. Opt in to postgres:19-alpine only for a fresh cluster or after the database upgrade. Keep the existing major for application-only updates. Both use the /var/lib/postgresql mount.

Authentication ​

VariableDescription
ADMIN_SESSION_EXPIRE_HOURSHours before password-login session tokens expire. Defaults to 24.
ADMIN_RECOVERY_CODE_EXPIRE_MINUTESMinutes before setup/reset codes printed in backend logs expire. Defaults to 30.

API access ​

VariableDescription
BACKEND_CORS_ORIGINSComma-separated allowed origins for the FastAPI API.
HOMEPAGE_ALLOWED_HOSTSComma-separated hostnames that may access GET /api/v1/homepage without a bearer token; ports are ignored. All other API routes still require a valid admin session or scoped API token.
CUSTOM_HTTP_ALLOWED_HOSTSComma-separated hostnames the Custom HTTP provider is allowed to reach. Blank allows any host.

Images and networking ​

VariableDescription
IMAGE_TAGTag for both default GHCR application images. Defaults to the recommended stable latest (stable is equivalent); main is development, vX.Y.Z is immutable, and vX.Y/vX are moving stable aliases. Pulls and deployments are always operator-initiated.
BACKEND_IMAGEOptional full backend image override. Defaults to ghcr.io/skulldorom/usage-dashboard-backend:${IMAGE_TAG}.
FRONTEND_IMAGEOptional full frontend image override. Defaults to ghcr.io/skulldorom/usage-dashboard-frontend:${IMAGE_TAG}.
NGINX_HTTP_PORTHost port published by the frontend/proxy container. Defaults to 3000.
VITE_API_BASE_URLFrontend build-time API base path. Published images use /api; this is not a runtime container or Compose override.

Polling and retention ​

VariableDescription
AUTO_POLL_ENABLEDEnables background provider polling. Defaults to true.
AUTO_POLL_INTERVAL_MINUTESMinutes between automatic provider polls. Defaults to 60.
SNAPSHOT_RETENTION_DAYSDays of raw usage snapshots to retain. Defaults to 180.
ANALYTICS_HOURLY_RETENTION_DAYSDays of normalized hourly analytics observations to retain. Defaults to 365. Daily aggregates are kept indefinitely once materialized.
REQUEST_TIMEOUT_SECONDSSeconds before an upstream provider request times out. Defaults to 20.

Application version metadata ​

VariableDescription
APP_VERSIONActual backend build version, exposed through auth-status metadata. Official images embed it during the build; native builds load generated deploy/version.env. Defaults to unknown. Do not override it to imitate a release.
VITE_APP_VERSIONFrontend build-time version embedded in the JS bundle. Must match the running backend before a notification can appear. Official/native release builds set it automatically.

Release checking has no backend configuration or GitHub token. The former UPDATE_CACHE_SECONDS and UPDATE_REQUEST_TIMEOUT_SECONDS settings are removed.

When upgrading from a release that used backend release checking, remove these obsolete variables from Compose .env and any backend environment overrides, /etc/usage-dashboard/backend.env on native Linux, or the backend container's environment in Portainer or another container manager. For Compose, inspect only the relevant variables with docker compose exec backend printenv UPDATE_CACHE_SECONDS UPDATE_REQUEST_TIMEOUT_SECONDS (the command may exit nonzero when a variable is absent). Recreate the backend container or restart the native backend service after updating its configuration. These variables no longer affect update notifications; do not replace an old six-hour value with a five-minute override. After upgrading both application artifacts, verify update checks in the authenticated dashboard's browser network panel: on load or tab visibility, an uncached check requests GitHub directly, not the removed /api/v1/updates endpoint. A valid cached result can suppress a new request until its 15-minute lifetime expires.

Browser cache (15 minutes), failure backoff (one minute), and timeout (five seconds) are defined in the frontend service. See update notifications.

Browser extension targets ​

VariableDescription
EXTENSION_TARGET_CHROME_IDOptional runtime Chrome extension ID used by one-click setup.
EXTENSION_TARGET_EDGE_IDOptional runtime Edge extension ID.
EXTENSION_TARGET_OPERA_IDOptional runtime Opera extension ID.
EXTENSION_TARGET_FIREFOX_IDOptional runtime Firefox extension ID.
EXTENSION_TARGET_SAFARI_IDOptional runtime Safari extension ID.

These override the published extension IDs at runtime (loaded through /runtime-config.js), which is useful for testing unpacked/dev builds without rebuilding the GHCR image. See Browser Extension for details.

Self-hosted API usage dashboard.