Support combining config sources (e.g. YAML and env vars)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start in ImmichFrame.WebApi/Helpers/Config/ConfigLoader.cs, which currently tries JSON, then YAML, then environment variables and stops at the first source found. Trace how each source is bound to the settings classes before changing the order. The issue leaves open whether to merge all sources per setting or only the secrets, and how Accounts entries should be matched, so get a maintainer decision first. Done means the agreed merge rules are implemented and covered by config tests.
Written by the indexing model from the issue text.
Description
Description
The ConfigLoader attempts to load from JSON format first, then YAML, and finally environment variables, meaning that environment config is ignored if a config file is present.
This isn't ideal for admins who usually want to use the preferred config format (YAML) but don't want secrets like ApiKey in the same Git-tracked config file, especially when environment secrets are quite well supported by Docker and container tools in general.
IMHO, a better approach would be to read all config sources and override the lower-priority ones on a per-setting basis, with an option to dump the final effective config to the log to help with troubleshooting.
If this is too complex, a stopgap solution only for secrets (AuthenticationSecret, WeatherApiKey, per-account ApiKey) would already go a long way.
Use Case
This would allow storing secrets like ApiKey in a separate git-ignored .env file, or other secrets manager, or passing them interactively on the command-line, while keeping the main config in Settings.yml.
Details
This would involve loading the env config first, then attempt to load the JSON (overriding any existing keys), then with YAML. Arrays like Albums, People, WebCalendars would combine (union), while Accounts elements would probably need a Name or other identifier, so that accounts with the same name can be combined.
Pre-Submission Checklist
-
This is a feature request and not a bug report
-
I have checked for related issues and checked the documentation
- Dominant language
- C#
- Stars
- 2.4k
- Forks
- 121
- Avg merge
- 18d 20h
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from immichFrame/ImmichFrame
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
immichFrame/ImmichFrame#735 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 56/100
immichFrame/ImmichFrame#733 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
immichFrame/ImmichFrame#732 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 22/100
immichFrame/ImmichFrame#731 · 1 reaction ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
immichFrame/ImmichFrame#729 ·
All issues in immichFrame/ImmichFrame
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 74/100
dotnet/EntityFramework.Docs#5521 ·
Maintainers usually reply within 1 day
-
Feature needs response
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Adyen/adyen-dotnet-api-library#1907 ·
Maintainers usually reply within 5 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dimitar-radenkov/Pointframe#318 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DotHarness/dotcraft#546 ·
Maintainers usually reply within 1 day
-
a-corriger bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
christian-raj/S-Aloha#303 · 1 comment ·