Configuration
The API uses a layered TOML configuration system. Settings are loaded in this order (later values override earlier):
config/default.toml— base configurationconfig/{APP_ENV}.toml— environment-specific overrides (optional)config/local.toml— local overrides, gitignored (optional)- Environment variables with
APOLLON_prefix
Config File Structure
[server]
host = "0.0.0.0"
port = 3000
trust_proxy = false
[database]
url = "postgres://apollon:apollon@localhost:5432/apollon"
[timescale]
url = "postgres://apollon:apollon@localhost:5433/apollon_tsdb"
max_connections = 5
min_connections = 1
connect_timeout = 30
idle_timeout = 600
max_lifetime = 1800
compression_after_hours = 168
[peplink]
router_ip = "192.168.50.1"
username = "admin"
password = "admin"
[websocket]
path = "/ws"
update_interval_ms = 1000
[forwarding]
# url = "https://external-service.example.com/gps"
# token = "bearer-token"
# health_url = "https://external-service.example.com/health"
max_queue_size = 100
max_retries = 3
retry_delay_ms = 5000
timeout_ms = 10000
[cors]
allowed_origins = ["*"]
# [rate_limit]
# window_ms = 60000
# max_requests = 100
[logging]
level = "info"
[auth]
api_keys = []
[docs]
swagger_ui = true
openapi_json = true
graphiql = true
[mock]
use_mock_data = false
Local Overrides
Create config/local.toml for machine-specific settings (this file is gitignored):
[peplink]
router_ip = "10.0.0.1"
username = "myuser"
password = "mypassword"
[mock]
use_mock_data = true
Environment-Specific Config
Set APP_ENV to load an additional config file:
APP_ENV=production # loads config/production.toml
APP_ENV=staging # loads config/staging.toml