Environment Variables
All configuration can be set via environment variables with the APOLLON_ prefix. Nested config uses __ as separator.
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 | postgres://apollon:apollon@localhost:5432/apollon | PostgreSQL connection string |
Database (TimescaleDB)
| Variable | Default | Description |
|---|---|---|
APOLLON_TIMESCALE__URL | postgres://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) |
Peplink
| 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 | /ws | WebSocket endpoint path |
APOLLON_WEBSOCKET__UPDATE_INTERVAL_MS | 1000 | Speed broadcast interval (ms) |
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 |
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 |
Authentication
| Variable | Default | Description |
|---|---|---|
APOLLON_AUTH__API_KEYS | (empty) | Comma-separated API keys. Empty = auth disabled |
Observability
| Variable | Default | Description |
|---|---|---|
APOLLON_SENTRY__DSN | (none) | Sentry DSN for error tracking |
APOLLON_LOGGING__LEVEL | info | Log level (debug, info, warn, error) |
Documentation
| 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/graphiql |
Mock Data
| Variable | Default | Description |
|---|---|---|
APOLLON_MOCK__USE_MOCK_DATA | false | Use mock GPS provider instead of Peplink |
Runtime
| Variable | Default | Description |
|---|---|---|
APP_ENV | development | Determines which config file to load (config/{APP_ENV}.toml) |
Web App (Next.js)
These environment variables are configured in platform/web/.env.local:
| Variable | Default | Description |
|---|---|---|
NODE_ENV | development | Node.js environment |
PORT | 5001 | Dev server port |
HOSTNAME | 0.0.0.0 | Bind address |
ORIGIN | http://localhost:5001 | App origin URL |
NEXT_PUBLIC_API_URL | http://localhost:3000 | Rust API base URL (used for REST proxy + WebSocket derivation) |
NEXT_PUBLIC_WS_URL | ws://localhost:3000 | WebSocket URL (optional, derived from API URL if not set) |
NEXT_PUBLIC_WS_TOKEN | (empty) | WebSocket authentication token (sent as ?token= query param) |
API_KEY | (empty) | Server-only API key for GraphQL requests (sent as X-API-Key header) |
SENTRY_DSN | (empty) | Sentry DSN for server-side error tracking |
NEXT_PUBLIC_SENTRY_DSN | (empty) | Sentry DSN for client-side error tracking |
Note: NEXT_PUBLIC_* variables are exposed to the browser. API_KEY is server-only and used in Next.js API route handlers to authenticate with the Rust GraphQL API.