ngcad
(ng)
March 31, 2023, 1:52am
21
After reviewing further, decided to create /etc/caddy/envfile, added all the configurable variables there and referenced in Caddyfile as {$VAR}
caddy.service
EnvironmentFile=-/etc/caddy/envfile
Your thoughts?
Also looks like you can’t use {env.VAR} when using EnvironmentFile which means those values still will be in generated json?
No, you definitely should be able to. That’s a systemd thing, not a Caddy thing.
ngcad
(ng)
March 31, 2023, 6:44am
23
That’s what I thought, found out what the problem was. I was doing
sudo systemctl reload caddy
and it didn’t get picked up,
when restarted it works
sudo systemctl restart caddy
Thanks for the help
Yeah, any change to the systemd config requires a service restart. Changes only to your Caddy config can simply be a zero-downtime reload.
ngcad
(ng)
March 31, 2023, 5:39pm
25
francislavoie:
One reason to use {env.*} is that by default your config gets autosaved to Caddy’s config storage location and if you used the {$ENV} style, the actual value would appear in the autosaved JSON config, but that doesn’t happen with {env.*} because it’s replaced at runtime.
I’ve configured S3 as storage, just went through the bucket and I don’t see any json stored there, all i see is a acme folder with certificates, you mean json generated/stored in the filesystem?
The data storage is different from the config storage. See that link which explains the difference.