Skip to main content

Environment Variables

All configuration can be set via environment variables with the APOLLON_ prefix. Nested config uses __ as separator.

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__URLpostgres://apollon:apollon@localhost:5432/apollonPostgreSQL connection string

Database (TimescaleDB)

VariableDefaultDescription
APOLLON_TIMESCALE__URLpostgres://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)
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/wsWebSocket endpoint path
APOLLON_WEBSOCKET__UPDATE_INTERVAL_MS1000Speed broadcast interval (ms)

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

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

Authentication

VariableDefaultDescription
APOLLON_AUTH__API_KEYS(empty)Comma-separated API keys. Empty = auth disabled

Observability

VariableDefaultDescription
APOLLON_SENTRY__DSN(none)Sentry DSN for error tracking
APOLLON_LOGGING__LEVELinfoLog level (debug, info, warn, error)

Documentation

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/graphiql

Mock Data

VariableDefaultDescription
APOLLON_MOCK__USE_MOCK_DATAfalseUse mock GPS provider instead of Peplink

Runtime

VariableDefaultDescription
APP_ENVdevelopmentDetermines which config file to load (config/{APP_ENV}.toml)

Web App (Next.js)

These environment variables are configured in platform/web/.env.local:

VariableDefaultDescription
NODE_ENVdevelopmentNode.js environment
PORT5001Dev server port
HOSTNAME0.0.0.0Bind address
ORIGINhttp://localhost:5001App origin URL
NEXT_PUBLIC_API_URLhttp://localhost:3000Rust API base URL (used for REST proxy + WebSocket derivation)
NEXT_PUBLIC_WS_URLws://localhost:3000WebSocket 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.