Skip to content

feat(config): support file-backed weather API keys - #685

Open
skrobul wants to merge 1 commit into
immichFrame:mainfrom
skrobul:weather-apikey-file
Open

feat(config): support file-backed weather API keys#685
skrobul wants to merge 1 commit into
immichFrame:mainfrom
skrobul:weather-apikey-file

Conversation

@skrobul

@skrobul skrobul commented Jul 25, 2026

Copy link
Copy Markdown

Weather API keys are secrets and should not need to be hardcoded directly into Settings.json or Settings.yml, where they can be accidentally committed, copied, or exposed during configuration management.

This change adds General.WeatherApiKeyFile, allowing deployments to mount the key through a secret-management system and point ImmichFrame at the file instead. The key is read once during startup, trimmed, and passed through the existing weather configuration path.

Inline WeatherApiKey remains supported for compatibility. Configurations cannot specify both sources, and leaving both empty continues to disable weather.

Summary by CodeRabbit

  • New Features
    • Weather API keys can now be loaded securely from a file.
    • Weather configuration supports either an inline API key or a file-based key.
  • Bug Fixes
    • Added validation to prevent configuring both API key options simultaneously.
    • File-based keys are trimmed before use.
  • Documentation
    • Updated JSON and YAML examples with the new weather API key file option.
    • Clarified how to enable or disable weather functionality.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: badb1f05-f9cb-40c5-88d2-65336513dea3

📥 Commits

Reviewing files that changed from the base of the PR and between 319affe and d272b94.

📒 Files selected for processing (5)
  • ImmichFrame.WebApi.Tests/Helpers/Config/ConfigLoaderTest.cs
  • ImmichFrame.WebApi/Models/ServerSettings.cs
  • docker/Settings.example.json
  • docker/Settings.example.yml
  • docs/docs/getting-started/configuration.md

📝 Walkthrough

Walkthrough

Changes

Weather API key file support

Layer / File(s) Summary
File-backed key loading and validation
ImmichFrame.WebApi/Models/ServerSettings.cs, ImmichFrame.WebApi.Tests/Helpers/Config/ConfigLoaderTest.cs
GeneralSettings loads and trims WeatherApiKeyFile, rejects simultaneous inline and file-based keys, and adds coverage for both behaviors.
Configuration examples and reference
docker/Settings.example.*, docs/docs/getting-started/configuration.md
Examples and documentation describe WeatherApiKeyFile and its relationship with WeatherApiKey.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ConfigLoader
  participant GeneralSettings
  participant WeatherApiKeyFile
  ConfigLoader->>GeneralSettings: Load settings and call Validate()
  GeneralSettings->>WeatherApiKeyFile: Read key file contents
  WeatherApiKeyFile-->>GeneralSettings: Return key contents
  GeneralSettings->>GeneralSettings: Trim and assign WeatherApiKey
Loading

Suggested labels: enhancement

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding file-backed weather API key support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant