[FEATURE] separate challenge hook and deployment hook #238

Closed
opened 2025-12-29 01:19:36 +01:00 by adam · 1 comment
Owner

Originally created by @candlerb on GitHub (Jul 29, 2017).

I find that I use the same deploy_challenge/clean_challenge hook code everywhere, but different deploy_cert hooks on different types of server. So I would like to install a standard challenge script and a custom deployment script.

My current approach is to have the main hook script handle the challenge, and then invoke a second hook script for the deployment:

    "deploy_cert")
        /etc/dehydrated/deploy_cert.sh "$@"
        ;;

This works, but it would be nice if config could point to a separate deployment script.

Here are a couple of ideas:

  1. Have more specific CHALLENGE_HOOK and DEPLOY_HOOK variables, with fallback to HOOK if not specified. e.g.

    CHALLENGE_HOOK=${CHALLENGE_HOOK:-$HOOK}
    ...
    "${CHALLENGE_HOOK}" "deploy_challenge" ${deploy_args[${idx}]}
    

    (Use CHALLENGE_HOOK for deploy_challenge, clean_challenge, invalid_challenge; use DEPLOY_HOOK for deploy_cert and unchanged_cert; use HOOK for everything else)

  2. Be able to specify multiple HOOKs, and invoke all of them in turn. Challenge hook scripts would ignore deployment tasks, and vice versa.

    (Having challenge + multiple deployment scripts might be useful)

Originally created by @candlerb on GitHub (Jul 29, 2017). I find that I use the same `deploy_challenge`/`clean_challenge` hook code everywhere, but different `deploy_cert` hooks on different types of server. So I would like to install a standard challenge script and a custom deployment script. My current approach is to have the main hook script handle the challenge, and then invoke a second hook script for the deployment: ``` "deploy_cert") /etc/dehydrated/deploy_cert.sh "$@" ;; ``` This works, but it would be nice if config could point to a separate deployment script. Here are a couple of ideas: 1. Have more specific CHALLENGE_HOOK and DEPLOY_HOOK variables, with fallback to HOOK if not specified. e.g. ``` CHALLENGE_HOOK=${CHALLENGE_HOOK:-$HOOK} ... "${CHALLENGE_HOOK}" "deploy_challenge" ${deploy_args[${idx}]} ``` (Use CHALLENGE_HOOK for deploy_challenge, clean_challenge, invalid_challenge; use DEPLOY_HOOK for deploy_cert and unchanged_cert; use HOOK for everything else) 2. Be able to specify multiple HOOKs, and invoke all of them in turn. Challenge hook scripts would ignore deployment tasks, and vice versa. (Having challenge + multiple deployment scripts might be useful)
adam closed this issue 2025-12-29 01:19:36 +01:00
Author
Owner

@lukas2511 commented on GitHub (Sep 20, 2017):

Why not just use a wrapper hook script? I don't think this is a really useful feature inside of dehydrated, this would just overcomplicate things for users who don't have those special usecases.

@lukas2511 commented on GitHub (Sep 20, 2017): Why not just use a wrapper hook script? I don't think this is a really useful feature inside of dehydrated, this would just overcomplicate things for users who don't have those special usecases.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#238