dehydrated-io / dehydrated-io/dehydrated

Doesn't pass environment variables when run via sudo

Open
#942 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Shell
Stars
6.2k
Forks
724
PR merge metrics
No merged PRs in 30d

Description

Hey!

currently implementing dehydrated into my environment. I'm using [lexicon](https://github.com/AnalogJ/lexicon) for the dns-01 challenge.

As I'm using `DEHYDRATED_USER` and `DEHYDRATED_GROUP`, sudo is used to run the script. However, sudo by default does not pass environment variables. As a result the clear and easy way of running dehydrated+lexicon using env variables as described [here](https://dns-lexicon.readthedocs.io/en/latest/user_guide.html#let-s-encrypt-instructions) (with [this hook](https://github.com/AnalogJ/lexicon/blob/master/examples/dehydrated.default.sh)) does not work.

This can easily be mitigated by having sudo pass env variables. The `-E -H` options should be added. `-E` passes env variables, while `-H` sets a proper `HOME` (which would be the wrong one from the env vars otherwise)

I've been running it this way for a while now and see no issues. Would you consider making this the default?

Thanks a lot!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.