Skip to content

fix: read Caddy's X-Api-Key from IGNIS_API_KEY instead of hardcoding it#11

Merged
jravani merged 1 commit into
mainfrom
fix/dynamic-caddy-api-key
Jul 24, 2026
Merged

fix: read Caddy's X-Api-Key from IGNIS_API_KEY instead of hardcoding it#11
jravani merged 1 commit into
mainfrom
fix/dynamic-caddy-api-key

Conversation

@jravani

@jravani jravani commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

  • The reverse proxy's X-Api-Key value was hardcoded directly in the committed Caddyfile ("supersecret123"). Nothing in CI or elsewhere depends on that literal value — checked, no references outside the Caddyfile itself — so there was no reason it couldn't be an env var, same as ALLOWED_ORIGINS already is.
  • Now read from IGNIS_API_KEY (see docker.env) at container start. Default value is unchanged, so local dev behaves identically; a real deployment now only needs to override docker.env instead of editing source.

Test plan

  • caddy validate against the updated Caddyfile
  • Rebuilt and ran the full ignis-db / ignis-app / ignis-reverse-proxy stack locally
  • Confirmed 403 with no API key and with a wrong key, 200 with the configured key

The key was hardcoded directly in the committed Caddyfile. Nothing in CI
or elsewhere actually depends on that literal value (checked — no
references outside the Caddyfile itself), so there was no reason it
couldn't be an env var like ALLOWED_ORIGINS already is. Default value in
docker.env is unchanged (supersecret123), so local dev behaves identically;
a real deployment now only needs to override docker.env, not edit source.

Verified live: rebuilt and ran the full ignis-db/ignis-app/ignis-reverse-proxy
stack, confirmed 403 with no/wrong key and 200 with the configured key.
@jravani
jravani merged commit cba711e into main Jul 24, 2026
4 checks passed
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jravani
jravani deleted the fix/dynamic-caddy-api-key branch July 24, 2026 01:58
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.

2 participants