mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-13 15:13:33 +01:00
this_hookscript_is_broken__dehydrated_is_working_fine__please_ignore_unknown_hooks_in_your_script #289
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 @nkovacne on GitHub (Mar 7, 2018).
We just upgraded to the last version of dehydrated (prior version was: 4.0.X). After that, when running the script I see:
In the CHANGELOG I could find this:
The function that throws this message just checks whether the
HOOKvariable has any content and then it shows the message. I also understand that this is done on purpose, but I just can't understand the reason?Will it be wrong to specify a hook from now on? In our case this hook does a lot of work in terms of integration with our DNS server so it is unthinkable to remove it. If this is the wrong way to go, is there any other recommended way to do this?
@lukas2511 commented on GitHub (Mar 7, 2018):
Dehydrated is constantly extended with new hook calls and existing hook scripts constantly break and I get tons of bug reports that dehydrated is broken while it's actually just the hook script that breaks everything.
Hook scripts should just ignore unknown hooks, that's why this hook breaker has been implemented.
It should make it clear to hook script authors to simply please_ignore_unknown_hooks to be compatible with future dehydrated versions.
If you are using somebody elses hook script please contact them to ignore all unknown hook calls. If this is your script please make sure that you ignore unknown hooks.
See the example hook for an example implementation on how to ignore unknown hook calls:
2eedd69ee9/docs/examples/hook.sh (L164-L166)@txr13 commented on GitHub (Mar 7, 2018):
@nkovacne The example hook script in the repo illustrates how to whitelist particular functions in a hook script. All others will be ignored.
If you implement something like that, and whitelist only the functions implemented by your hook script, the error will go away.
@nkovacne commented on GitHub (Mar 7, 2018):
@txr13 Yep, in fact it was my fault. My hook file actually caught any undefined hook and sent to stdout the error message that I wrote in my first message (which I thought was sent by the dehydrated script). I simply removed the "echo" statement and it stopped showing up. Thanks.