Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow use of env placeholder in tls certificates #5962

Closed
acuteaura opened this issue Dec 4, 2023 · 1 comment · Fixed by #5963
Closed

allow use of env placeholder in tls certificates #5962

acuteaura opened this issue Dec 4, 2023 · 1 comment · Fixed by #5963
Labels
feature ⚙️ New feature or request

Comments

@acuteaura
Copy link

I'm using this directive to load certificates through systemd's LoadCredential= (reference here).

        tls "{env.CREDENTIALS_DIRECTORY}/cert.pem" "{env.CREDENTIALS_DIRECTORY}/cert.key"

Unfortunately, the placeholder does not seem to get resolved.

Dec 04 10:49:00 caddy[1517810]: Error: loading http app module: provision http: getting tls app: loading tls app module: provision tls: loading certificates: open {env.CREDENTIALS_DIRECTORY}/cert.pem: no such file or directory
@francislavoie
Copy link
Member

francislavoie commented Dec 4, 2023

FYI you can use {$ENV} syntax instead for now, since that's replaces at config-adapt time instead of at runtime, so no special support is needed for that to work. https://caddyserver.com/docs/caddyfile/concepts#environment-variables

But either way, no harm in adding this, and @mohammed90 already got to it quickly 😊 #5963

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ⚙️ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants