First off… Merry Christmas everyone!!
After a fair amount of pain and suffering I have figured out the challenge I am having with my wildcard certificates using AWS/Route53 and I think it will be simple for a Caddy/Linux expert to help me with.
When I run Caddy as a root user:
sudo /usr/bin/caddy run --environ --config /home/deploy/caddy.json
It can find the AWS credentials.
When I run it as a service, like this:
sudo systemctl start caddy-api.service
…it cannot find the credentials and always throws a NoCredentialProviders error.
The reason this was hard to find is if I run:
caddy environ
It appears that Caddy can see the environment variables (AWS_SECRET_KEY_ID etc)
So the question: How do I make sure Caddy can see my AWS configuration when running it as a service??
I’d love to get this sorted out as I have been having to return to using Nginx so my core site [1] works but I lose the awesome secure subdomain solution Caddy provides.
Thanks for any tips and again… Happy holidays!!
–Harris