Configuration

License server environment options

This page lists every supported environment variable, what it controls, and its default value. DATABASE_URL and one of MANAGEMENT_API_KEYS or MANAGEMENT_API_KEY are required to start the server.

Minimal startup example

bash
# Required
DATABASE_URL=postgres://postgres:postgres@postgres:5432/simple_license_server?sslmode=disable
MANAGEMENT_API_KEYS=management_key_prod_please_make_this_long_and_random

# Optional
PORT=8080
REQUEST_TIMEOUT=15s

Environment variables

VariableRequiredDefaultWhat it does
DATABASE_URLYesNonePostgres connection string used by the API at startup.
MANAGEMENT_API_KEYSYes*NoneComma-separated management bootstrap keys for /management/* endpoints (each key must be 16+ chars).
MANAGEMENT_API_KEYYes*NoneSingle-key fallback used only when MANAGEMENT_API_KEYS is not set.
PORTNo8080HTTP listen port for the API server.
REQUEST_TIMEOUTNo15sPer-request timeout applied by middleware.
SHUTDOWN_TIMEOUTNo10sGraceful shutdown timeout when the process receives a stop signal.
HTTP_READ_TIMEOUTNo15sMaximum time for reading request headers/body.
HTTP_WRITE_TIMEOUTNo30sMaximum time before timing out writes of the response.
HTTP_IDLE_TIMEOUTNo60sMaximum keep-alive idle time for client connections.
RATE_LIMIT_ENABLEDNotrueEnables global + per-IP rate limiting middleware.
RATE_LIMIT_GLOBAL_RPSNo100Global requests-per-second allowance when rate limiting is enabled.
RATE_LIMIT_GLOBAL_BURSTNo200Global burst capacity when rate limiting is enabled.
RATE_LIMIT_PER_IP_RPSNo20Per-client-IP requests-per-second allowance.
RATE_LIMIT_PER_IP_BURSTNo40Per-client-IP burst capacity.
RATE_LIMIT_IP_TTLNo10mTTL for per-IP limiter entries before cleanup.
RATE_LIMIT_MAX_IP_ENTRIESNo10000Maximum number of tracked IP limiter entries.
TRUST_PROXY_HEADERSNofalseTrust X-Forwarded-For/X-Real-IP when running behind a trusted proxy.

Validation notes

  • * One of MANAGEMENT_API_KEYS or MANAGEMENT_API_KEY must be set.
  • All API keys must be at least 16 characters.
  • Use POST /management/api-keys to create generated server API keys for /generate and /revoke.
  • All timeout values must be valid Go durations (for example 15s, 10m).
  • When RATE_LIMIT_ENABLED=true, all rate-limit numeric values must be greater than zero.
  • Booleans accept values like true/false, 1/0, yes/no.