# 0004. Configuration Management Strategy Date: 2024-11-20 ## Status Accepted ## Context We need a consistent approach to configuration management that is simple, clear, and follows industry standards. The system requires configuration for database, email, secrets, and various runtime parameters. ## Decision We will use environment variables with the `GONDULF_` prefix for all configuration: - All environment variables must start with `GONDULF_` to avoid namespace collisions - Use uppercase with underscores for word separation - Follow standard naming patterns (e.g., `_URL` for connection strings, `_KEY` for secrets) - Provide sensible defaults where possible - Use a single `.env.example` file to document all available configuration Standard variables: ``` GONDULF_SECRET_KEY= GONDULF_DATABASE_URL=sqlite:///./data/gondulf.db GONDULF_SMTP_HOST=localhost GONDULF_SMTP_PORT=587 GONDULF_SMTP_USERNAME= GONDULF_SMTP_PASSWORD= GONDULF_SMTP_FROM=noreply@example.com GONDULF_SMTP_USE_TLS=true GONDULF_TOKEN_EXPIRY=3600 GONDULF_LOG_LEVEL=INFO GONDULF_DEBUG=false ``` ## Consequences ### Positive - Clear namespace prevents collision with other applications - Standard environment variable pattern familiar to developers - Easy to configure in various deployment scenarios (Docker, systemd, etc.) - `.env.example` provides self-documentation ### Negative - Slightly longer variable names - Must maintain `.env.example` alongside actual configuration