Skip to main content

Configuration

Warnly is configured using environment variables.

Core Server Setup

Server

Server configuration controls how Warnly listens for and serves HTTP and HTTPS connections.
PropertyDescriptionDefaultRequired
SERVER_HOSTThe host address on which to serve the Warnly applicationlocalhostNo
SERVER_PORTThe HTTP port on which to serve the Warnly REST API and UI8080No
SCHEMEThe protocol to use (http or https)httpNo
CERT_FILEPath to the certificate file (required if SCHEME is https)No
CERT_KEYPath to the certificate key file (required if SCHEME is https)No
CLOSE_TIMEOUTTimeout for graceful shutdown5sNo
PUBLIC_INGEST_URLPublic URL for ingest endpoints (used for generating DSNs)No

Database

Database configuration defines how Warnly connects to MySQL for primary data storage.
PropertyDescriptionDefaultRequired
MYSQL_DSNMySQL connection string with credentials and database nameYes
Example DSN: warnly:root@tcp(localhost:3306)/warnly?interpolateParams=true&parseTime=true&timeout=2s&loc=UTC

Admin

Initial administrator account configuration.
PropertyDescriptionDefaultRequired
ADMIN_EMAILEmail address for the initial admin userYes
ADMIN_PASSWORDPassword for the initial admin userYes

Authentication

OIDC

OpenID Connect authentication provider configuration.
PropertyDescriptionDefaultRequired
OIDC_PROVIDER_NAMEName of the OIDC provider (e.g., ‘google’, ‘keycloak’)No
OIDC_ISSUER_URLOIDC issuer URLNo
OIDC_CLIENT_IDOIDC client IDNo
OIDC_CLIENT_SECRETOIDC client secretNo
OIDC_REDIRECT_ADDRESSPublic URL on which Warnly instance is reachableNo
OIDC_SCOPESSpace-separated list of OIDC scopesNo
OIDC_EMAIL_MATCHESSpace-separated list of email regex patterns for user filteringNo
OIDC_USE_PKCEEnable PKCE for OIDC authentication flowtrueNo

Sessions

Session management configuration.
PropertyDescriptionDefaultRequired
SESSION_KEYSecret key for signing session cookies (32 bytes)Yes
REMEMBER_SESSION_DAYSNumber of days to remember user sessions30No

Observability

Logging

Logging configuration controls the format and destination of Warnly’s application logs.
PropertyDescriptionDefaultRequired
LOG_OUTPUTWhere to output logs (stderr, stdout, or file path)stderrNo
LOG_TEXTUse text format instead of JSONfalseNo

Tracing

OpenTelemetry tracing configuration.
PropertyDescriptionDefaultRequired
TRACING_REPORTER_URIOTLP gRPC endpoint for sending tracesNo
TRACING_SERVICE_NAMEService name for traceswarnlyNo
TRACING_PROBABILITYSampling probability for traces (0.0 to 1.0)1.0No

Metrics

Prometheus metrics configuration.
PropertyDescriptionDefaultRequired
METRICS_ENABLEDEnable Prometheus metrics endpointfalseNo
METRICS_PORTPort for metrics server8081No
METRICS_PATHPath for metrics endpoint/metricsNo

Analytics

ClickHouse

ClickHouse configuration for analytics and event storage.
PropertyDescriptionDefaultRequired
CLICKHOUSE_DSNClickHouse connection string with credentials and database nameYes
Example DSN: clickhouse://root:root@clickhouse:9000/warnly?dial_timeout=900ms&connection_open_strategy=in_order&compress=true&max_open_conns=55&max_idle_conns=50&conn_max_lifetime=5m&max_execution_time=10

Additional Settings

Migration

Database migration settings.
PropertyDescriptionDefaultRequired
FORCE_MIGRATEForce database migrations to run on startupfalseNo

Environment Variable Override

All configuration options can be overridden using environment variables. The naming convention follows the struct tags in the source code (uppercase with underscores replacing camelCase). For example, to override the server port:
export SERVER_PORT=9090

Configuration Validation

Warnly validates configuration at startup. Required fields will cause the application to exit with an error if not provided. Optional fields use sensible defaults.