Skip to content

feat: double-underscore env var convention for hyphenated config keys#402

Merged
coopernetes merged 1 commit into
mainfrom
feat/env-var-hyphen-fix
Jul 9, 2026
Merged

feat: double-underscore env var convention for hyphenated config keys#402
coopernetes merged 1 commit into
mainfrom
feat/env-var-hyphen-fix

Conversation

@coopernetes

Copy link
Copy Markdown
Member

Summary

  • Adds a double-underscore convention for FOGWALL_ env var overrides so hyphenated config keys can be targeted
  • Within the path portion (after FOGWALL_), __ maps to . and _ maps to -; activated only when __ appears in the name
  • All existing single-underscore vars are unchanged (non-breaking)

Examples

FOGWALL_PROVIDERS__GITEA_SSH__API_TOKEN → providers.gitea-ssh.api-token
FOGWALL_SECRET_SCAN__ENABLED            → secret-scan.enabled
FOGWALL_SERVER_PORT (legacy)            → server.port  ← unchanged

Test plan

  • Unit tests for envVarToConfigPath() cover both conventions and hyphenated top-level keys
  • ./gradlew :fogwall-server:test :fogwall-server:jacocoTestCoverageVerification --rerun passes

closes #386

@coopernetes coopernetes enabled auto-merge July 8, 2026 19:54
The legacy FOGWALL_ env var mapping (single _ → .) cannot represent
hyphenated config keys such as providers.gitea-ssh.api-token, because
env var names cannot contain hyphens.

Adopt the double-underscore convention used by systemd/Docker/k8s:
within the path portion (after the FOGWALL_ prefix), __ maps to .
and _ maps to -. This is activated only when __ appears in the name,
so all existing single-underscore vars continue to work unchanged.

  FOGWALL_PROVIDERS__GITEA_SSH__API_TOKEN → providers.gitea-ssh.api-token
  FOGWALL_SECRET_SCAN__ENABLED            → secret-scan.enabled
  FOGWALL_SERVER_PORT (legacy)            → server.port (unchanged)

Adds unit tests for envVarToConfigPath() covering both conventions.

closes #386

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coopernetes coopernetes force-pushed the feat/env-var-hyphen-fix branch from 44243bb to 2e1cc75 Compare July 9, 2026 00:44
@coopernetes coopernetes merged commit f0eb01a into main Jul 9, 2026
18 checks passed
@coopernetes coopernetes deleted the feat/env-var-hyphen-fix branch July 9, 2026 00:48
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.

Config env var overrides cannot target hyphenated keys or provider names

1 participant