Skip to main content

Environment Variables

All Tracera configuration is done through environment variables. Copy .env.example to .env and customize.

Server

VariableDefaultDescription
SERVER_HOST0.0.0.0Bind address for the HTTP server
SERVER_PORT8080Port for the HTTP server
BASE_URLhttp://localhost:8080Public-facing URL (used for OAuth callbacks, magic links)
FRONTEND_URL{BASE_URL}Frontend URL for post-login redirects
BASE_URL must be set correctly in production — it’s used for OAuth redirect URIs and magic link URLs.

Database (TimescaleDB)

VariableDefaultDescription
DB_HOSTlocalhostTimescaleDB hostname
DB_PORT5432PostgreSQL port
DB_USERskinvestmentDatabase user
DB_PASSWORDskinvestmentDatabase password
DB_NAMEskinvestmentDatabase name
DB_SSLMODEdisableSSL mode (disable, require, verify-full)
Use DB_SSLMODE=require or verify-full in production.

Redis

VariableDefaultDescription
REDIS_HOSTlocalhostRedis hostname
REDIS_PORT6379Redis port
REDIS_PASSWORD(empty)Redis password (optional)
REDIS_DB0Redis database index (0-15)

Session

VariableDefaultDescription
SESSION_SECRETrequiredSigning key for session cookies (min 32 bytes)
SESSION_LIFETIME_HOURS72Session duration in hours
SESSION_COOKIE_SECUREAutoSecure cookie flag. Auto-derived from BASE_URL scheme.
Generate a session secret:
openssl rand -base64 32

OAuth Providers

Google

VariableDefaultDescription
GOOGLE_CLIENT_ID(empty)Google OAuth client ID
GOOGLE_CLIENT_SECRET(empty)Google OAuth client secret
Google OAuth is disabled if either variable is empty.

GitHub

VariableDefaultDescription
GITHUB_CLIENT_ID(empty)GitHub OAuth client ID
GITHUB_CLIENT_SECRET(empty)GitHub OAuth client secret
GitHub OAuth is disabled if either variable is empty.

Steam

VariableDefaultDescription
STEAM_API_KEY(empty)Steam Web API key (for fetching profiles)
STEAM_OPENID_ENABLEDtrueEnable/disable Steam OpenID

Email

VariableDefaultDescription
RESEND_API_KEY(empty)Resend API key. If unset, emails are logged to stdout.
RESEND_FROM_EMAILonboarding@resend.devSender email address
MAGIC_LINK_EXPIRY_MINUTES10Magic link token expiry in minutes

Frontend

VariableDefaultDescription
BACKEND_BASE_URLhttp://app:8080Backend URL for server-side requests (Docker internal)
BACKEND_PUBLIC_URLhttp://localhost:8080Backend URL for client-side requests (browser)

Price Ingestion

VariableDefaultDescription
PRICEMPIRE_API_KEY(empty)PriceEmpire API key. Source disabled if unset.

Validation

The server validates all configuration at startup and will fail to start if:
  • SESSION_SECRET is missing or too short (< 32 bytes)
  • Port numbers are invalid
  • REDIS_DB is outside the 0-15 range
  • Timing values (intervals, lifetimes) are non-positive