Howto use the ACME hook

Discussion in 'Installation/Configuration' started by Nedim, Mar 30, 2023.

  1. Nedim

    Nedim New Member

    What is the proper way to create a custom hook script?

    I am running
    Code:
    Ubuntu 22.04.2 LTS (Jammy Jellyfish)
    and I have run
    Code:
    ispconfig_update.sh --force
    so I have the latest ISPConfig version.

    My problem is that I can not figure out howto use the ACME hooks.

    When I list the crontab there is
    crontab -l
    Code:
    58 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null
    I tried to modify the script
    Code:
     /root/.acme.sh/letsencrypt_renew_hook.sh
    and add something like echo 'TEEEEEST'
    and then run
    Code:
    "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" --force --test
    but I am not sure the changes are being executed.

    When I grep for the Hook keyword I get this

    Code:
    grep Hook /root/.acme.sh/mail.xxxx.xxxx.com/mail.xxx.xxxx.com.conf
    Code:
    Le_PreHook=''
    Le_PostHook=''
    Le_RenewHook=''
    
    I do not see where the hook scripts are referenced. I tried to create /usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_renew_hook.sh but as far I can see the file is being ignored.
     
    Last edited: Mar 30, 2023
  2. Nedim

    Nedim New Member

  3. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  4. Nedim

    Nedim New Member

    So the hook is not supported out of the box? I have to tweak the cron command? Are you sure about that?
     
  5. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

  6. Nedim

    Nedim New Member

    @ahrasis I think I know where I messed up. I added the server cert to the ISPConfig as web domain and generated the cert as well from the ISPConfig. I guess that has overwritten the original cert. Is there a way to regenerate the original cert?
     
  7. Nedim

    Nedim New Member

    I regenerated the server cert using
    ispconfig_update.sh --force
     
  8. Nedim

    Nedim New Member

    I see now that only the server cert has
    Code:
    Le_RenewHook='__ACME_BASE64__START_b............
    My question is: How do I add a Hook for certs generated from the ISPConfig web interface?
     
  9. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

     
  10. Nedim

    Nedim New Member

    from the docs

    Those hooks are only accepted by the --issue command, but will be saved and apply to --renew or --cron commands as well. As such it can be a good way to do things (like close and re-open a server, or notify of updates) that need to happen only when issuance is actually attempted.
     
  11. Nedim

    Nedim New Member

    maybe --reloadcmd could be helpful in my case, I will test and report back.
     

Share This Page