Skip to main content

⚑ Server

FastAPI REST API based on a Pydantic model to auto-generate server endpoints for the UI.

Environment Variables​

The server requires various environment variables for configuration. Copy server/.env.example to server/.env and configure the values.

Timezone​

  • TZ - Container timezone (default: Etc/UTC)

API Configuration​

  • API_BASE_URL - Base URL for the API used by the UI (e.g., https://your-domain.azurefd.net)
info

This generates /config.json at container startup for runtime UI configuration.

Uvicorn Server Configuration​

VariableDefaultDescription
UVICORN_HOST0.0.0.0Server bind address
UVICORN_PORT8050Server port
UVICORN_WORKERS4Number of worker processes
UVICORN_TIMEOUT_KEEP_ALIVE120Keep-alive timeout in seconds
UVICORN_LOG_LEVELinfoLogging level: debug, info, warning, error, critical

Azure Storage​

  • AZURE_STORAGE_ACCOUNT_URL - Azure Storage account URL (e.g., https://youraccount.blob.core.windows.net/)
  • AZURE_STORAGE_CONTAINER - Container name for image storage (default: output)
  • AZURE_URL_EXPIRES_SECS - SAS token expiration in seconds (default: 3600)

PostgreSQL Database​

VariableDefaultDescription
POSTGRES_HOSTdbPostgreSQL server host
POSTGRES_PORT5432PostgreSQL server port
POSTGRES_NAMEcalfireDatabase name
POSTGRES_USERβ€”Database user
POSTGRES_PASSWORDβ€”Database password
POSTGRES_AUTOCREATEtrueAuto-create database if not exists

Redis Database​

VariableDefaultDescription
REDIS_URLredis://redis:6379/0Redis connection URL
REDIS_PASSWORDβ€”Redis password (optional)
REDIS_SOCKET_TIMEOUT10Socket timeout in seconds
REDIS_SOCKET_CONNECT_TIMEOUT5Connection timeout in seconds
REDIS_COLLECT_WINDOW_DAYS7Time window for data collection in days
REDIS_TS_UTC_WINDOW_SECONDS600UTC time window in seconds
REDIS_COLLECT_SECONDS15Collection interval in seconds
REDIS_PURGE_SECONDS3600Purge interval in seconds

Configuration Notes​

  • All environment variables are defined in server/.env file
  • Changing environment variables requires container restart (not image rebuild)
  • The config.json file is automatically regenerated on each container startup with the current API_BASE_URL