W Watchflare docs
Cette page n'est pas encore disponible en français. Vous lisez la version anglaise.

Hub environment variables

Complete reference of all environment variables accepted by the Watchflare Hub.

All Hub configuration is done through environment variables. When using Docker Compose, place them in a .env file next to docker-compose.yml.

For full explanations and usage guidance, see Configuration.


Required

VariableMin lengthDescription
JWT_SECRET32 charsSigns user session cookies. Hub exits at startup if missing or too short.
SMTP_ENCRYPTION_KEY32 charsEncrypts SMTP passwords at rest. Optional for the Hub binary — if not set, SMTP password storage is disabled. Required by the Docker Compose file (set via :? syntax) so it is always generated upfront, even if you don’t plan to use email notifications. If set, must be at least 32 characters (Hub exits otherwise).

Database

VariableDefaultDescription
POSTGRES_HOSTlocalhostPostgreSQL hostname. Docker Compose sets this to postgres.
POSTGRES_PORT5432PostgreSQL port
POSTGRES_USERwatchflareDatabase user
POSTGRES_PASSWORDwatchflare_devDatabase password
POSTGRES_DBwatchflareDatabase name
POSTGRES_SSLMODEdisablePostgreSQL SSL mode

Ports

VariableDefaultDescription
HUB_PORT8080Docker only. External port for the HTTP server. The internal container port is always 8080.
GRPC_PORT50051gRPC port for agent connections

TLS

VariableDefaultDescription
TLS_MODEautoauto — Hub generates its own CA and server certificate. custom — provide your own files.
TLS_PKI_DIR/var/lib/watchflare/pkiDirectory for auto-generated certificates (auto mode only)
TLS_CERT_FILEServer certificate path (custom mode only)
TLS_KEY_FILEServer private key path (custom mode only)
TLS_CA_FILECA certificate path, sent to agents at registration (custom mode only)

VariableDefaultDescription
COOKIE_SECURE(auto)Force Secure flag: true or false. Omit to use auto-detection (recommended).
COOKIE_DOMAIN(empty)Cookie domain — set to your domain when using a reverse proxy
TRUSTED_PROXIES127.0.0.1,::1Comma-separated IPs allowed to set X-Forwarded-Proto

gRPC security

VariableDefaultDescription
GRPC_TIMESTAMP_WINDOW300HMAC timestamp window in seconds (±window). Requests outside this range are rejected.

Environment

VariableDefaultDescription
ENVdevelopmentSet to production in deployed instances. Switches Gin to release mode. Docker Compose sets this automatically.
CORS_ORIGINShttp://localhost:5173Comma-separated allowed CORS origins. Not needed for Docker or binary installs.

Quick-start .env

.env bash
POSTGRES_PASSWORD=$(openssl rand -hex 32)
JWT_SECRET=$(openssl rand -hex 32)
SMTP_ENCRYPTION_KEY=$(openssl rand -hex 32)

All other variables have sensible defaults for a standard Docker Compose deployment.