Custom Configuration Patterns
This reference preserves the original codex/collab/custom-configs.md while aligning examples with the latest configuration layout in config/.
Configuration Philosophy
- Keep vendor defaults intact. Layer overrides through environment files or bind-mounted directories instead of editing upstream templates.
- Document every override in version control; prefer one configuration file per feature flag.
- Test changes with
./usenet validate --fixbefore rolling them into production deployments.
Overlay Structure
config/
├── overrides/
│ ├── plex/
│ ├── sonarr/
│ └── radarr/
├── profiles/
│ ├── gpu-accelerated.yml
│ └── low-power.yml
└── templates/
└── docker-compose.partial.ymloverrides/contains per-service config fragments that mount into the running containers via the CLI.profiles/defines hardware-specific toggles consumed by the storage and hardware commands.templates/stores Compose fragments that can be merged during deploys.
Creating a New Override
- Duplicate a template from
config/examplesintoconfig/overrides/<service>. - Document the change inside the directory using
README.override.md. - Register the override via
./usenet services enable <service> --override. - Run
./usenet deploy --validate-onlyto confirm the override merges.
Environment Variables
- Store secrets in
.envusing theusenet envhelper. Never commit the file to the repository. - Use
USENET_PROFILEto select hardware profiles dynamically. - Reference environment variables inside Compose overrides using the
${VARIABLE:?message}syntax so missing values fail fast.
Configuration Promotion Workflow
- Prototype locally and commit changes to a feature branch.
- Run targeted service tests using the scripts in
lib/test/integration. - Submit a pull request documenting the behaviour change and rollback plan.
- After merge, tag the repository so you can map deployments to commits.
Rollback Strategy
- Maintain previous overrides in
config/archive/<date>. The CLI can use archived directories as drop-in replacements if a regression appears. - Use
docker compose logs <service>to confirm the restored override resolves the issue before resuming automation.