Caddy TLS plugins ignore ENV variables

I’ve tried using both DigitalOcean and Vultr end neither seems to work. Even if I pass in the tokens like this

DO_AUTH_TOKEN="[TOKEN]" sudo caddy

Caddy always responds with

DigitalOcean credentials missing

I’ve also tried exporting the ENV variables and checking my environment with the env command to be sure they’re there.

Has anyone here encountered this problem?

Sudo doesn’t carry the environment variables over (for security reasons, apparently); you’ll have to configure your system differently to allow that or set root’s env variables instead.

Of course, what am I thinking! Thank you so much for getting back so quickly and thanks for creating my absolute favorite server!

1 Like

You might try DO_AUTH_TOKEN="[TOKEN]" sudo -E caddy - the -E flag sets preservation of env variables. I don’t know if this will carry through one-time variables or if you’d have to export them first, so whether it’s useful for you…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.