Cli option to set enviromnent variables for hooks

I’d love to have a cli option like --hook-env X=Y (can be used multiple times with different X).

How it works: X with value Y is added to the hook’s environment during call.
I see python’s subprocess.Popen() used by execute() in certbot/certbot/ allows using a custom environment like shown here

How can we benefit from this feature: this way we can put config variables for hooks into cli.ini (so it is a single config for all certbot stuff) in a nice and clean way like

renew-hook = /var/apps/
hook-env = MY_EMAIL=kaka@shino.bu

while keeping logging logic intact: this line woks incorrectly in case I use a dirty cli.ini hack like

renew-hook = MY_EMAIL=kaka@shino.bu /var/apps/ # Quoting required mby?
disable-hook-validation = True
1 Like

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