mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-11 22:30:44 +01:00
Pass CHALLENGETYPE to hook.sh for deploy_challenge, clean_challenge, and invalid_challenge #173
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @whereisaaron on GitHub (Dec 23, 2016).
dehydratedallows for per-certificate configuration of various parameters including theCHALLENGETYPE(e.g.http-01ordns-01). I'd like to propose this parameter is passed to the challenge related functions in theHOOKscript (if any).This would e.g. allow the hook script to only create
dns-01challenge records for those challenges, and do nothing or something different forhttp-01challenges.The CHALLENGETYPE parameter would be added at an additional/last parameter to:
deploy_challengeclean_challengeinvalid_challengeand so and would be backwards compatible with existing hook scripts.
The
CHALLENGETYPEcould be an extra parameter for the HOOK_CHAIN case of X*Y parameters, but this would be a breaking change for people usingHOOK_CHAIN. The extra parameter could also be entirely omitted in theHOOK_CHAINcase to maintain backward compatibility.It is possible to achieve the same result by specifying per-certificate hook scripts, and maintaining separate hook scripts for each challenge type. However as the number of challenge types will grow over time, it seems more cumbersome than parameterizing a single script.
What to people think?
@lukas2511 commented on GitHub (Jan 29, 2017):
I exported a few variables in
57197306d7, you should now be able to just pull them from the environment variables in your hooks, no changes to the existing hooks required.@whereisaaron commented on GitHub (Jan 30, 2017):
That will work, thanks for exporting that!
As a comment. I think the challenge type is a pretty intrinsic part if a hook call, since the hook script is there to facilitate the challenge types. So I would have thought it would be the first challenge hook call argument, right before or after the domain name. But the export is equally as functional, so I'll take it and shut up 😉