Created
August 10, 2026 11:18
-
-
Save cyanide-burnout/87091bb8ad95d08e13777d3762fc41a6 to your computer and use it in GitHub Desktop.
Let’s Encrypt / haproxy certificate deployment hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # cp hook.sh /etc/letsencrypt/renewal-hooks/deploy/hook.sh | |
| # echo "show ssl cert" | socat stdio /run/haproxy/admin.sock | |
| # https://www.haproxy.com/blog/dynamic-ssl-certificate-storage-in-haproxy | |
| NAME=$(basename ${RENEWED_LINEAGE}) | |
| TARGET=/etc/ssl/haproxy/${NAME}.pem | |
| cat $RENEWED_LINEAGE/fullchain.pem $RENEWED_LINEAGE/privkey.pem > $TARGET | |
| echo -e "set ssl cert $TARGET <<\n$(sed '/^[[:space:]]*$/d' $TARGET)\n" | socat stdio /run/haproxy/admin.sock | |
| echo "commit ssl cert $TARGET" | socat stdio /run/haproxy/admin.sock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment