Skip to main content

Environment Variables

All configuration can be set via environment variables with the APOLLON__ prefix (double underscore). Nested config uses __ as separator.

Runtime

VariableDefaultDescription
APP_ENVdevelopmentConfig overlay: loads config/{APP_ENV}.toml
RUST_LOG(from config)Override log filter (e.g. info, apollon_websocket=debug)

Server

VariableDefaultDescription
APOLLON__SERVER__HOST0.0.0.0Bind address
APOLLON__SERVER__PORT3000HTTP port
APOLLON__SERVER__TRUST_PROXYfalseTrust X-Forwarded-For headers

Database (PostgreSQL)

VariableDefaultDescription
APOLLON__DATABASE__URLpostgresql://apollon:apollon@localhost:5432/apollonPostgreSQL connection string

Database (TimescaleDB)

VariableDefaultDescription
APOLLON__TIMESCALE__URLpostgresql://apollon:apollon@localhost:5433/apollon_tsdbTimescaleDB connection string
APOLLON__TIMESCALE__MAX_CONNECTIONS5Connection pool max size
APOLLON__TIMESCALE__MIN_CONNECTIONS1Connection pool min size
APOLLON__TIMESCALE__CONNECT_TIMEOUT30Connection timeout (seconds)
APOLLON__TIMESCALE__IDLE_TIMEOUT600Idle connection timeout (seconds)
APOLLON__TIMESCALE__MAX_LIFETIME1800Max connection lifetime (seconds)
APOLLON__TIMESCALE__COMPRESSION_AFTER_HOURS168Compress data older than N hours (7 days)

Redis (AIS Enrichment Cache)

Optional read-through/write-through cache in front of the Postgres vessels registry. If Redis is unreachable at startup the API degrades to Postgres-only enrichment.

VariableDefaultDescription
APOLLON__REDIS__URLredis://:apollon@localhost:6379Redis connection URL (password carried in the URL)
APOLLON__REDIS__POOL_SIZE10Reserved; the ConnectionManager is multiplexed
APOLLON__REDIS__TIMEOUT5Connect timeout in seconds (start does not hang on a dead Redis)
APOLLON__REDIS__TTL_SECS86400Static-cache entry TTL in seconds (24h), refreshed on each write
VariableDefaultDescription
APOLLON__PEPLINK__ROUTER_IP192.168.50.1Peplink router IP address
APOLLON__PEPLINK__USERNAMEadminRouter admin username
APOLLON__PEPLINK__PASSWORDadminRouter admin password

WebSocket

VariableDefaultDescription
APOLLON__WEBSOCKET__PATH/v1/wsWebSocket endpoint path
APOLLON__WEBSOCKET__UPDATE_INTERVAL_MS1000GPS/Speed broadcast interval (ms)
APOLLON__WEBSOCKET__TOKENS(empty)Auth tokens (comma-separated). Empty = no auth

AIS Vessel Tracking

[ais] enabled is the master switch; each source (aisstream, local) is toggled independently. Enabling both runs dual mode (local priority for in-range vessels, aisstream secondary — see Configuration).

VariableDefaultDescription
APOLLON__AIS__ENABLEDfalseMaster switch for AIS vessel tracking
APOLLON__AIS__LOCAL_PRIORITY_TTL_SECS120Dual mode: seconds an MMSI stays local-tracked after its last local message before aisstream may resume it (handoff when out of antenna range)
APOLLON__AIS__IGNORE_MMSI(empty)MMSI numbers to exclude (comma-separated), applies to both sources
APOLLON__AIS__STALE_TIMEOUT_SECS1800Seconds without any AIS message before a vessel is considered out of range and removed from the map (both sources)
APOLLON__AIS__AISSTREAM__ENABLEDfalseEnable the AISstream.io source
APOLLON__AIS__AISSTREAM__API_KEY(empty)AISstream.io API key (required when the aisstream source is enabled)
APOLLON__AIS__AISSTREAM__RADIUS_KM10aisstream subscription bounding-box radius in km around GPS position
APOLLON__AIS__LOCAL__ENABLEDfalseEnable the local NMEA/AIS receiver source
APOLLON__AIS__LOCAL__HOST192.168.1.69Local NMEA/AIS receiver host (required when the local source is enabled)
APOLLON__AIS__LOCAL__PORT2000Local NMEA/AIS receiver TCP port
APOLLON__AIS__LOCAL__RECEPTION_RANGE_KM(unset)Optional; map bbox circle radius for the local source only. Unset = no bbox, no vessel filtering
APOLLON__AIS__FORWARD__ENABLEDfalseForward local-source vessels to Heimdall over a WebSocket client connection (AIS forwarding)
APOLLON__AIS__FORWARD__URL(none)Heimdall forward-AIS WebSocket endpoint, e.g. wss://<heimdall>/v1/ws
APOLLON__AIS__FORWARD__TOKEN(none)Bearer token sent as Authorization: Bearer on the upgrade request
APOLLON__AIS__FORWARD__DEVICE_ID(none)Optional device ID sent as the X-Device-ID header

Pegelonline Water Level

VariableDefaultDescription
APOLLON__PEGELONLINE__ENABLEDfalseEnable Pegelonline water level polling
APOLLON__PEGELONLINE__BASE_URLhttps://pegelonline.wsv.de/webservices/rest-api/v2Pegelonline API base URL
APOLLON__PEGELONLINE__RADIUS_KM30Search radius in km around GPS position

Storage (File Uploads)

VariableDefaultDescription
APOLLON__STORAGE__PATH./data/storageRoot directory for uploaded files
APOLLON__STORAGE__MAX_FILE_SIZE_MB10Max upload file size in MB

Watchlist (AIS Proximity Alerts)

VariableDefaultDescription
APOLLON__WATCHLIST__ENABLEDfalseEnable AIS watchlist matching (requires [ais] enabled = true)

GPS Forwarding

VariableDefaultDescription
APOLLON__FORWARDING__URL(none)External forwarding endpoint URL
APOLLON__FORWARDING__TOKEN(none)Authorization token for forwarding
APOLLON__FORWARDING__HEALTH_URL(none)Forwarding service health check URL
APOLLON__FORWARDING__MAX_QUEUE_SIZE100Max queued GPS points before dropping
APOLLON__FORWARDING__MAX_RETRIES3Retry attempts per failed forward
APOLLON__FORWARDING__RETRY_DELAY_MS5000Delay between retries (ms)
APOLLON__FORWARDING__TIMEOUT_MS10000HTTP timeout per forward request (ms)

CORS

VariableDefaultDescription
APOLLON__CORS__ALLOWED_ORIGINS*Allowed CORS origins (comma-separated)

Authentication

VariableDefaultDescription
APOLLON__AUTH__API_KEYS(empty)API keys (comma-separated). Empty = auth disabled

Rate Limiting

VariableDefaultDescription
APOLLON__RATE_LIMIT__WINDOW_MS(disabled)Rate limit window (ms)
APOLLON__RATE_LIMIT__MAX_REQUESTS(disabled)Max requests per window per IP

Logging

VariableDefaultDescription
APOLLON__LOGGING__LEVELinfoLog level: trace, debug, info, warn, error
APOLLON__LOGGING__FORMATprettyLog format: pretty (colorful) or json (structured)

Sentry

VariableDefaultDescription
APOLLON__SENTRY__DSN(none)Sentry DSN for error tracking

Developer Tools

VariableDefaultDescription
APOLLON__DOCS__SWAGGER_UItrueEnable Swagger UI at /v1/swagger-ui/
APOLLON__DOCS__OPENAPI_JSONtrueServe OpenAPI spec at /v1/openapi.json
APOLLON__DOCS__GRAPHIQLtrueEnable GraphiQL IDE at /v1/gql

GPS Cleanup

VariableDefaultDescription
APOLLON__CLEANUP__ENABLEDtrueEnable periodic cleanup of orphaned GPS data
APOLLON__CLEANUP__RETENTION_DAYS30Delete orphaned locations older than N days
APOLLON__CLEANUP__INTERVAL_HOURS24Cleanup check interval in hours

Mock Mode

VariableDefaultDescription
APOLLON__MOCK__USE_MOCK_DATAfalseUse simulated GPS data instead of Peplink

Web App (Next.js)

Runtime environment variables (read at server render time, Docker-friendly):

VariableDefaultDescription
NODE_ENVdevelopmentNode.js environment
PORT5001Dev server port
APOLLON_API_URLhttp://localhost:3000Rust API base URL (runtime)
APOLLON_WS_URL(derived from API URL)WebSocket URL (runtime)
APOLLON_WS_TOKEN(empty)WebSocket auth token (runtime)
APOLLON_API_KEY(empty)Server-only API key for GraphQL
SENTRY_DSN(empty)Sentry DSN (server-side)
NEXT_PUBLIC_SENTRY_DSN(empty)Sentry DSN (client-side, embedded at build time)

Legacy NEXT_PUBLIC_API_URL, NEXT_PUBLIC_WS_URL, NEXT_PUBLIC_WS_TOKEN, API_KEY are supported as fallbacks.