Environment Configuration
Configuration Priority
Priority order (highest to lowest):
- Shell environment variables
- CLI flags (
--port,--host,--verbose) config.json(optional user overrides)config.default.json(shipped defaults).envfile (auto-loaded at startup)
Environment Variables Reference
| Variable | Default | Description |
|---|---|---|
ROTIFEX_PORT | 3000 | TCP port |
ROTIFEX_HOST | 0.0.0.0 | Bind address |
ROTIFEX_CORS_ORIGIN | * | Allowed CORS origin |
ROTIFEX_RATE_LIMIT_MAX | 100 | Max requests per rate-limit window |
ROTIFEX_LOG_LEVEL | info | Log level (info, debug, warn, error) |
ROTIFEX_STORAGE_MAX_FILE_SIZE_MB | 10 | Max upload size in MB |
ROTIFEX_STORAGE_SIGNED_URL_SECRET | auto | HMAC secret for signed file URLs |
JWT_SECRET | auto | Access token signing secret |
JWT_REFRESH_SECRET | auto | Refresh token signing secret |
JWT_SECRET,JWT_REFRESH_SECRET, andROTIFEX_STORAGE_SIGNED_URL_SECRETare 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