Skip to content

docs: document remaining undocumented [global] config keys#645

Merged
CybotTM merged 2 commits into
mainfrom
fix/issue-635
May 14, 2026
Merged

docs: document remaining undocumented [global] config keys#645
CybotTM merged 2 commits into
mainfrom
fix/issue-635

Conversation

@CybotTM

@CybotTM CybotTM commented May 13, 2026

Copy link
Copy Markdown
Member

Summary

Documents five gcfg/mapstructure-tagged keys on Config.Global that were either entirely undocumented or only mentioned obliquely in passing, even though the parser has accepted them for several releases. Closes the docs side of the drift class flagged by TestConfigGlobalKeysAreDocumented (added in #621).

Keys covered:

Key Source Doc destination
notification-cooldown cli/config.go:72 docs/CONFIGURATION.md [global] reference
smtp-tls-skip-verify middlewares/mail.go:27 docs/CONFIGURATION.md [global] + dedicated trade-off section in docs/TROUBLESHOOTING.md
webhook-webhooks middlewares/webhook_config.go:72 docs/webhooks.md Global Settings
webhook-trusted-preset-sources middlewares/webhook_config.go:79 docs/webhooks.md Global Settings
webhook-preset-cache-dir middlewares/webhook_config.go:85 docs/webhooks.md Global Settings

Also adds an explicit INI-vs-Docker-labels callout in docs/webhooks.md reiterating that only webhook-webhooks is exposed via labels (as ofelia.webhook-webhooks); the SSRF-sensitive globals are INI-only per #486 / #620.

The smtp-tls-skip-verify entry in docs/TROUBLESHOOTING.md spells out exactly what InsecureSkipVerify = true does to the dialer, when it is acceptable (test environments, internal CAs that cannot be installed system-wide, legacy mail servers as a temporary workaround) and when it is not (public relays like Gmail/SendGrid/SES, credentials that grant write access to mailboxes other systems trust), with recommended alternatives in preference order.

Closes #635. Refs #621, #604.

Test plan

  • go test ./cli/ -run TestConfigGlobalKeysAreDocumented -count=1 -v — passes (the test only walks anonymous/embedded structs today; the direct notification-cooldown field is covered by the prose addition rather than the reflection sweep, per the existing TODO(#635) in the test).
  • go test ./cli/ -count=1 — entire cli/ suite passes.
  • go build ./... — clean.
  • golangci-lint run ./... — 0 issues.
  • All five keys are now substring-matched by the docs aggregate scanned by loadDocs(...) in cli/config_drift_test.go.

Five `gcfg`/`mapstructure`-tagged keys on `Config.Global` either had no
operator-facing documentation at all or were only referenced obliquely in
passing prose, even though the parser has accepted them for several
releases. Closes the docs side of the drift class flagged by
TestConfigGlobalKeysAreDocumented.

- docs/CONFIGURATION.md: add `notification-cooldown` (notification
  deduplication window, default 0 = disabled) and `smtp-tls-skip-verify`
  (default false) to the [global] reference, both with the security
  framing inline so operators don't have to cross-reference the source.
- docs/webhooks.md: expand the "Global Settings" code block to cover
  `webhook-webhooks`, `webhook-trusted-preset-sources`,
  `webhook-preset-cache-dir`, and `webhook-allowed-hosts` with their
  defaults, and add an explicit INI-vs-Docker-labels callout — only
  `webhook-webhooks` is exposed via labels, the SSRF-sensitive globals
  are INI-only per #486 / #620.
- docs/TROUBLESHOOTING.md: add a dedicated "SMTP TLS verification
  trade-off" section that spells out exactly what
  `smtp-tls-skip-verify = true` does to the dialer, when it's appropriate
  (test environments, internal CAs) and when it isn't (public relays,
  credentials shared with downstream systems), with recommended
  alternatives in preference order.

Refs #635, #621, #604.

Signed-off-by: Sebastian Mendel <[email protected]>
Copilot AI review requested due to automatic review settings May 13, 2026 21:50
@github-actions

github-actions Bot commented May 13, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request documents several previously undocumented global configuration keys, including notification-cooldown, smtp-tls-skip-verify, and various webhook settings, while adding a security-focused troubleshooting section for SMTP TLS verification. Feedback from the review identifies technical inaccuracies regarding which notification types support cooldowns and which webhook settings are compatible with Docker labels. Additionally, the reviewer suggested using more consistent allow-list terminology and corrected the recommended file path for mounting CA certificates when using update-ca-certificates.

Comment thread docs/CONFIGURATION.md
Comment thread docs/webhooks.md
Comment thread docs/webhooks.md
Comment thread docs/TROUBLESHOOTING.md
github-actions[bot]
github-actions Bot previously approved these changes May 13, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval for maintainer PR

All automated quality gates passed. See SECURITY_CONTROLS.md for compensating controls.

@codecov

codecov Bot commented May 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.86%. Comparing base (c60cd65) to head (6aa2156).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #645   +/-   ##
=======================================
  Coverage   87.86%   87.86%           
=======================================
  Files          88       88           
  Lines       10898    10898           
=======================================
  Hits         9576     9576           
  Misses       1081     1081           
  Partials      241      241           
Flag Coverage Δ
integration 87.85% <ø> (-0.02%) ⬇️
unittests 84.88% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Ofelia’s operator documentation to cover several [global] configuration keys that are accepted by the parser but were previously undocumented or only mentioned indirectly, addressing docs-vs-code drift flagged by TestConfigGlobalKeysAreDocumented.

Changes:

  • Document notification-cooldown and smtp-tls-skip-verify in docs/CONFIGURATION.md, including a security warning for SMTP TLS verification skipping.
  • Expand docs/webhooks.md with additional webhook global settings and an explicit INI-vs-Docker-labels callout for SSRF-sensitive keys.
  • Add a dedicated troubleshooting section explaining the security trade-offs of smtp-tls-skip-verify, and record the docs updates in CHANGELOG.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
docs/webhooks.md Documents additional webhook global keys and clarifies INI vs Docker-label availability.
docs/TROUBLESHOOTING.md Adds an in-depth section on smtp-tls-skip-verify risks and safer alternatives.
docs/CONFIGURATION.md Adds [global] reference entries for notification-cooldown and smtp-tls-skip-verify.
CHANGELOG.md Notes the documentation drift fixes and newly documented keys.

Comment thread docs/webhooks.md
Comment thread docs/webhooks.md
Comment thread docs/CONFIGURATION.md
Comment thread docs/TROUBLESHOOTING.md
Security review of #645 flagged three docs gaps:

- webhook-trusted-preset-sources lacked explicit SSRF allow-list
  framing — operators could read the example as a generic glob list
  and miss the implication that bare `*` patterns enable Ofelia to
  reach cloud-metadata endpoints / internal services on behalf of the
  preset string source.
- webhook-preset-cache-dir documented the malicious-container threat
  but not the symmetric host-side threat: a world-writable or shared
  cache directory lets anyone with write access plant preset files
  that Ofelia will load and execute as middleware config.
- TROUBLESHOOTING.md's smtp-tls-skip-verify example trailed the
  warning section by ~50 lines and used `${SMTP_PASSWORD}` without
  a final reminder that the credential is exposed to any MITM on
  every send. Skim-readers who jumped to the example missed the
  trade-off discussion.

All three are docs-only.

Refs #635.

Signed-off-by: Sebastian Mendel <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval for maintainer PR

All automated quality gates passed. See SECURITY_CONTROLS.md for compensating controls.

@CybotTM CybotTM added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit f9b4f2f May 14, 2026
26 checks passed
@CybotTM CybotTM deleted the fix/issue-635 branch May 14, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker SDK: document remaining undocumented config keys (notification-cooldown, smtp-tls-skip-verify, webhook-*)

2 participants