Skip to main content

Environment Configuration

Configuration Priority

Priority order (highest to lowest):

  1. Shell environment variables
  2. CLI flags (--port, --host, --verbose)
  3. config.json (optional user overrides)
  4. config.default.json (shipped defaults)
  5. .env file (auto-loaded at startup)

Environment Variables Reference

VariableDefaultDescription
ROTIFEX_PORT3000TCP port
ROTIFEX_HOST0.0.0.0Bind address
ROTIFEX_CORS_ORIGIN*Allowed CORS origin
ROTIFEX_RATE_LIMIT_MAX100Max requests per rate-limit window
ROTIFEX_LOG_LEVELinfoLog level (info, debug, warn, error)
ROTIFEX_STORAGE_MAX_FILE_SIZE_MB10Max upload size in MB
ROTIFEX_STORAGE_SIGNED_URL_SECRETautoHMAC secret for signed file URLs
JWT_SECRETautoAccess token signing secret
JWT_REFRESH_SECRETautoRefresh token signing secret

JWT_SECRET, JWT_REFRESH_SECRET, and ROTIFEX_STORAGE_SIGNED_URL_SECRET are auto-generated on first startup if absent and saved to .env.

Example .env

ROTIFEX_PORT=3000
ROTIFEX_HOST=0.0.0.0
ROTIFEX_CORS_ORIGIN=https://myapp.com
ROTIFEX_RATE_LIMIT_MAX=200
ROTIFEX_LOG_LEVEL=info
ROTIFEX_STORAGE_MAX_FILE_SIZE_MB=25
JWT_SECRET=replace-with-a-long-random-string
JWT_REFRESH_SECRET=replace-with-another-long-random-string
ROTIFEX_STORAGE_SIGNED_URL_SECRET=replace-with-yet-another-secret