Skip to content

Environment Variables

All configuration is via environment variables (or appsettings.json for local dev). Variables use __ as the section separator (ASP.NET Core convention).


Required

Variable Example Description
ConnectionStrings__Postgres Host=...;Database=apexlab;... Postgres connection string
ConnectionStrings__Redis localhost:6379 Redis connection string
Jwt__SecretKey 40+ random chars HMACSHA256 signing key for JWTs
Jwt__Issuer apexlab-api JWT issuer claim — must match client
Jwt__Audience apexlab-client JWT audience claim — must match client
OAuth__Google__ClientId ...apps.googleusercontent.com Google OAuth client ID
OAuth__Google__ClientSecret GOCSPX-... Google OAuth client secret
OAuth__Discord__ClientId 123456789 Discord application ID
OAuth__Discord__ClientSecret ... Discord application secret

Optional

Variable Default Description
Jwt__ExpiryMinutes 60 Access token lifetime in minutes
Anthropic__ApiKey (empty) Claude API key — required for AI coach endpoints
Sentry__Dsn (empty) Sentry DSN — leave empty to disable
RUN_MIGRATIONS false Set to true to auto-apply EF Core migrations at startup
ASPNETCORE_ENVIRONMENT Production Development enables Swagger UI
ASPNETCORE_URLS http://+:8080 Bind address
Serilog__MinimumLevel Information Log level: Verbose/Debug/Information/Warning/Error

SafeWatch

Variable / Config key Description
SafeWatch:Accounts[n]:Username Admin account username
SafeWatch:Accounts[n]:PasswordHash BCrypt hash of the password
SafeWatch:Accounts[n]:Role sys_admin / product / support / ceo

These are set in appsettings.json (not env vars) since they contain structured arrays. See Adding an Account for how to generate a BCrypt hash.


Local Dev

Copy SimCopilot.Api/.env.example to SimCopilot.Api/.env and fill in values. The docker-compose.yml mounts this file automatically.

For the WPF client, set ApiBaseUrl in %LocalAppData%\ApexLab\settings.json:

{ "ApiBaseUrl": "http://localhost:5000" }