acme.sh icon indicating copy to clipboard operation
acme.sh copied to clipboard

customscript notification won't work

Open shtingeri opened this issue 2 years ago • 3 comments

Steps to reproduce copy custom_script_file to /acme.sh/customscript.sh execute

export CUSTOMSCRIPT_PATH="/acme.sh/customscript.sh"

acme.sh --set-notify --notify-hook customscript --debug 2

Debug log

[Wed Aug 31 11:59:20 UTC 2022] Lets find script dir.
[Wed Aug 31 11:59:20 UTC 2022] _SCRIPT_='/usr/local/bin/acme.sh'
[Wed Aug 31 11:59:21 UTC 2022] _script='/root/.acme.sh/acme.sh'
[Wed Aug 31 11:59:21 UTC 2022] _script_home='/root/.acme.sh'
[Wed Aug 31 11:59:21 UTC 2022] Using default home:/root/.acme.sh
[Wed Aug 31 11:59:21 UTC 2022] Using config home:/acme.sh
[Wed Aug 31 11:59:21 UTC 2022] LE_WORKING_DIR='/root/.acme.sh'
https://github.com/acmesh-official/acme.sh
v3.0.5
[Wed Aug 31 11:59:21 UTC 2022] Running cmd: setnotify
[Wed Aug 31 11:59:21 UTC 2022] Using config home:/acme.sh
[Wed Aug 31 11:59:21 UTC 2022] default_acme_server='https://acme-v02.api.letsencrypt.org/directory'
[Wed Aug 31 11:59:21 UTC 2022] ACME_DIRECTORY='https://acme-v02.api.letsencrypt.org/directory'
[Wed Aug 31 11:59:21 UTC 2022] _ACME_SERVER_HOST='acme-v02.api.letsencrypt.org'
[Wed Aug 31 11:59:21 UTC 2022] _ACME_SERVER_PATH='directory'
[Wed Aug 31 11:59:21 UTC 2022] Set notify hook to: customscript
[Wed Aug 31 11:59:21 UTC 2022] Sending via: customscript
[Wed Aug 31 11:59:21 UTC 2022] Found  for customscript
[Wed Aug 31 11:59:21 UTC 2022] Can not find the hook file for customscript

shtingeri avatar Aug 31 '22 12:08 shtingeri

Please upgrade to the latest code and try again first. Maybe it's already fixed. acme.sh --upgrade If it's still not working, please provide the log with --debug 2, otherwise, nobody can help you.

github-actions[bot] avatar Aug 31 '22 12:08 github-actions[bot]

Please upgrade to the latest code and try again first. Maybe it's already fixed. acme.sh --upgrade If it's still not working, please provide the log with --debug 2, otherwise, nobody can help you.

Already up to date and the issue persists.

shtingeri avatar Aug 31 '22 12:08 shtingeri

who told you to use in this way?

Neilpang avatar Sep 01 '22 13:09 Neilpang

who told you to use in this way?

This is the wiki I referred to.

shtingeri avatar Oct 27 '22 04:10 shtingeri

sorry, that code was not added yet.
you can just copy your script to ~/.acme.sh/notify/

and use:

acme.sh --set-notify  --notify-hook  yourscript

Neilpang avatar Oct 29 '22 02:10 Neilpang

Can we get https://github.com/acmesh-official/acme.sh/pull/4193 merged? Please and thank you!

ahrex avatar Mar 03 '23 22:03 ahrex

sorry, that code was not added yet. you can just copy your script to ~/.acme.sh/notify/

and use:

acme.sh --set-notify  --notify-hook  yourscript

Nope, it doesn't work as described, acme.sh says:

[Do 25. Apr 17:02:11 CEST 2024] It seems that your api file is not correct, it must have a function named: yourscript_send
[Do 25. Apr 17:02:11 CEST 2024] Set /root/.acme.sh/notify/yourscript.sh error.
[Do 25. Apr 17:02:11 CEST 2024] Can not set notify hook to: yourscript

pkoevesdi avatar Apr 25 '24 15:04 pkoevesdi

I can confirm that #4193 works, and would really like to see it in an upcoming release. Why is this issue closed anyway? It is totally valid issue, since it doesn't work in the way the wiki says.

pkoevesdi avatar Apr 25 '24 15:04 pkoevesdi

I am having an issue with this instructions:

$ acme.sh --set-notify --notify-hook customscript
[Sat Jul  6 22:33:17 BRT 2024] Set notify hook to: customscript
[Sat Jul  6 22:33:17 BRT 2024] Sending via: customscript
[Sat Jul  6 22:33:17 BRT 2024] Can not find the hook file for customscript

The current instruction is not working :-(

@pkoevesdi, How did you make it work?

cerealconyogurt avatar Jul 07 '24 01:07 cerealconyogurt

You need the script https://raw.githubusercontent.com/acmesh-official/acme.sh/c327b888c12904c76a4c504f341e32f07a33b973/notify/customscript.sh in your folder notify, then it works as written in https://github.com/acmesh-official/acme.sh/pull/4193.

pkoevesdi avatar Jul 07 '24 08:07 pkoevesdi