Environment Variables
All configuration can be set via environment variables with the APOLLON__ prefix (double underscore). Nested config uses __ as separator.
Runtime
| Variable | Default | Description |
|---|---|---|
APP_ENV | development | Config overlay: loads config/{APP_ENV}.toml |
RUST_LOG | (from config) | Override log filter (e.g. info, apollon_websocket=debug) |
Server
| Variable | Default | Description |
|---|---|---|
APOLLON__SERVER__HOST | 0.0.0.0 | Bind address |
APOLLON__SERVER__PORT | 3000 | HTTP port |
APOLLON__SERVER__TRUST_PROXY | false | Trust X-Forwarded-For headers |
Database (PostgreSQL)
| Variable | Default | Description |
|---|---|---|
APOLLON__DATABASE__URL | postgresql://apollon:apollon@localhost:5432/apollon | PostgreSQL connection string |
Database (TimescaleDB)
| Variable | Default | Description |
|---|---|---|
APOLLON__TIMESCALE__URL | postgresql://apollon:apollon@localhost:5433/apollon_tsdb | TimescaleDB connection string |
APOLLON__TIMESCALE__MAX_CONNECTIONS | 5 | Connection pool max size |
APOLLON__TIMESCALE__MIN_CONNECTIONS | 1 | Connection pool min size |
APOLLON__TIMESCALE__CONNECT_TIMEOUT | 30 | Connection timeout (seconds) |
APOLLON__TIMESCALE__IDLE_TIMEOUT | 600 | Idle connection timeout (seconds) |
APOLLON__TIMESCALE__MAX_LIFETIME | 1800 | Max connection lifetime (seconds) |
APOLLON__TIMESCALE__COMPRESSION_AFTER_HOURS | 168 | Compress 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.
| Variable | Default | Description |
|---|---|---|
APOLLON__REDIS__URL | redis://:apollon@localhost:6379 | Redis connection URL (password carried in the URL) |
APOLLON__REDIS__POOL_SIZE | 10 | Reserved; the ConnectionManager is multiplexed |
APOLLON__REDIS__TIMEOUT | 5 | Connect timeout in seconds (start does not hang on a dead Redis) |
APOLLON__REDIS__TTL_SECS | 86400 | Static-cache entry TTL in seconds (24h), refreshed on each write |
Peplink Router
| Variable | Default | Description |
|---|---|---|
APOLLON__PEPLINK__ROUTER_IP | 192.168.50.1 | Peplink router IP address |
APOLLON__PEPLINK__USERNAME | admin | Router admin username |
APOLLON__PEPLINK__PASSWORD | admin | Router admin password |
WebSocket
| Variable | Default | Description |
|---|---|---|
APOLLON__WEBSOCKET__PATH | /v1/ws | WebSocket endpoint path |
APOLLON__WEBSOCKET__UPDATE_INTERVAL_MS | 1000 | GPS/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).
| Variable | Default | Description |
|---|---|---|
APOLLON__AIS__ENABLED | false | Master switch for AIS vessel tracking |
APOLLON__AIS__LOCAL_PRIORITY_TTL_SECS | 120 | Dual 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_SECS | 1800 | Seconds without any AIS message before a vessel is considered out of range and removed from the map (both sources) |
APOLLON__AIS__AISSTREAM__ENABLED | false | Enable 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_KM | 10 | aisstream subscription bounding-box radius in km around GPS position |
APOLLON__AIS__LOCAL__ENABLED | false | Enable the local NMEA/AIS receiver source |
APOLLON__AIS__LOCAL__HOST | 192.168.1.69 | Local NMEA/AIS receiver host (required when the local source is enabled) |
APOLLON__AIS__LOCAL__PORT | 2000 | Local 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__ENABLED | false | Forward 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
| Variable | Default | Description |
|---|---|---|
APOLLON__PEGELONLINE__ENABLED | false | Enable Pegelonline water level polling |
APOLLON__PEGELONLINE__BASE_URL | https://pegelonline.wsv.de/webservices/rest-api/v2 | Pegelonline API base URL |
APOLLON__PEGELONLINE__RADIUS_KM | 30 | Search radius in km around GPS position |
Storage (File Uploads)
| Variable | Default | Description |
|---|---|---|
APOLLON__STORAGE__PATH | ./data/storage | Root directory for uploaded files |
APOLLON__STORAGE__MAX_FILE_SIZE_MB | 10 | Max upload file size in MB |
Watchlist (AIS Proximity Alerts)
| Variable | Default | Description |
|---|---|---|
APOLLON__WATCHLIST__ENABLED | false | Enable AIS watchlist matching (requires [ais] enabled = true) |
GPS Forwarding
| Variable | Default | Description |
|---|---|---|
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_SIZE | 100 | Max queued GPS points before dropping |
APOLLON__FORWARDING__MAX_RETRIES | 3 | Retry attempts per failed forward |
APOLLON__FORWARDING__RETRY_DELAY_MS | 5000 | Delay between retries (ms) |
APOLLON__FORWARDING__TIMEOUT_MS | 10000 | HTTP timeout per forward request (ms) |
CORS
| Variable | Default | Description |
|---|---|---|
APOLLON__CORS__ALLOWED_ORIGINS | * | Allowed CORS origins (comma-separated) |
Authentication
| Variable | Default | Description |
|---|---|---|
APOLLON__AUTH__API_KEYS | (empty) | API keys (comma-separated). Empty = auth disabled |
Rate Limiting
| Variable | Default | Description |
|---|---|---|
APOLLON__RATE_LIMIT__WINDOW_MS | (disabled) | Rate limit window (ms) |
APOLLON__RATE_LIMIT__MAX_REQUESTS | (disabled) | Max requests per window per IP |
Logging
| Variable | Default | Description |
|---|---|---|
APOLLON__LOGGING__LEVEL | info | Log level: trace, debug, info, warn, error |
APOLLON__LOGGING__FORMAT | pretty | Log format: pretty (colorful) or json (structured) |
Sentry
| Variable | Default | Description |
|---|---|---|
APOLLON__SENTRY__DSN | (none) | Sentry DSN for error tracking |
Developer Tools
| Variable | Default | Description |
|---|---|---|
APOLLON__DOCS__SWAGGER_UI | true | Enable Swagger UI at /v1/swagger-ui/ |
APOLLON__DOCS__OPENAPI_JSON | true | Serve OpenAPI spec at /v1/openapi.json |
APOLLON__DOCS__GRAPHIQL | true | Enable GraphiQL IDE at /v1/gql |
GPS Cleanup
| Variable | Default | Description |
|---|---|---|
APOLLON__CLEANUP__ENABLED | true | Enable periodic cleanup of orphaned GPS data |
APOLLON__CLEANUP__RETENTION_DAYS | 30 | Delete orphaned locations older than N days |
APOLLON__CLEANUP__INTERVAL_HOURS | 24 | Cleanup check interval in hours |
Mock Mode
| Variable | Default | Description |
|---|---|---|
APOLLON__MOCK__USE_MOCK_DATA | false | Use simulated GPS data instead of Peplink |
Web App (Next.js)
Runtime environment variables (read at server render time, Docker-friendly):
| Variable | Default | Description |
|---|---|---|
NODE_ENV | development | Node.js environment |
PORT | 5001 | Dev server port |
APOLLON_API_URL | http://localhost:3000 | Rust 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.