certbot / certbot

Certbot is EFF's tool to obtain certs from Let's Encrypt and (optionally) auto-enable HTTPS on your server. It can also act as a client for any other CA that uses the ACME protocol.
Other
31.11k stars 3.38k forks source link

Feature Request: Support environment variables for: `--config-dir`, `--work-dir`, `--logs-dir` #9958

Open jvanasco opened 6 days ago

jvanasco commented 6 days ago

It would be useful if Certbot supported environment variables for: --config-dir, --work-dir, --logs-dir

For example, someone could set an environment variable to be:

CERTBOT_config_dir=/etc/letsencrypt-alt

Then, if Certbot were to pick up that variable it would:

1- Override the default value, just like --config-dir. 2- Print a debug message to the screen, noting the use of the environment variable.

If a command line argument were passed, that should take priority and a message would be printed as well.

The rationale for this request is that it can be cumbersome and confusing to include this directive on every single invocation of Certbot. Unlike other directives, --config-dir can not be used in a .cli file (as that is loaded from the config-dir. I am not sure if work-dir and logs-dir have similar limitations, but they are often used in conjunction with config-dir.

This would be useful to a limited number of users, but it would be a large improvement for readability/maintenance and usability to those who leverage alternate configurations.

Thank you for your consideration.