NoteDiscovery supports environment variables to override configuration settings, allowing different behavior in different deployment environments (local, staging, production).
| Variable | Type | Default | Description |
|---|---|---|---|
PORT |
integer | 8000 |
HTTP port for the application (Docker, run.py) |
Note: Advanced server settings (CORS origins, debug mode) are configured via
config.yamlonly, not via environment variables. See config.yaml for details.
| Variable | Type | Default | Description |
|---|---|---|---|
AUTHENTICATION_ENABLED |
boolean | config.yaml |
Enable/disable authentication |
AUTHENTICATION_PASSWORD_HASH |
string | config.yaml |
Bcrypt password hash |
AUTHENTICATION_SECRET_KEY |
string | config.yaml |
Session secret key (for session security) |
| Variable | Type | Default | Description |
|---|---|---|---|
DEMO_MODE |
boolean | false |
Enable demo mode (enables rate limiting and other demo restrictions) |
Configuration is loaded in this order (later overrides earlier):
config.yaml- Default configuration file- Environment Variables - Runtime overrides
- Command Line - Highest priority (if applicable)
The following settings are available in config.yaml only (not via environment variables):
server:
# List of allowed origins for CORS
# Default: ["*"] allows all origins (fine for self-hosted)
# Production: specify your domains
allowed_origins: ["*"]
# Examples for production:
# allowed_origins: ["http://localhost:8000", "https://yourdomain.com"]
# allowed_origins: ["https://*.yourdomain.com"] # Wildcard subdomainSecurity Note:
["*"]is safe for self-hosted deployments on private networks- For public deployments, specify exact origins to prevent unauthorized API access
- This prevents CSRF attacks when authentication is enabled
server:
# Enable detailed error messages in API responses
# Default: false (production-safe)
# Set to true for development/troubleshooting
debug: falsedebug: true in production!
When debug: true:
- Full error stack traces are returned to users
- Internal paths and system details are exposed
- Security vulnerabilities may be revealed
When debug: false (recommended):
- Generic error messages are returned
- Full error details are logged server-side only
- Production-safe error handling
- Authentication: AUTHENTICATION.md
- API Rate Limiting: API.md
Pro Tip: Use environment variables for deployment-specific settings, and config.yaml for application defaults. This keeps your configuration flexible and maintainable! 🎯