Created
January 30, 2026 16:14
-
-
Save bjoern-r/a92f0a8ba7c45e9a3e8491f2295af3cb to your computer and use it in GitHub Desktop.
TrueNAS acme helper script for deploying DNS-01 challange using acmeproxy.pl
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 | |
| ## use together with https://github.com/madcamel/acmeproxy.pl | |
| ACMEPROXY_AUTH='user:password' | |
| ACMEPROXY_URL='https://acmeproxy.example.com:9443' | |
| set_challange() { | |
| local DOMAIN="${1}" TOKEN_FQDN="${2}" TOKEN_VALUE="${3}" | |
| curl -X POST "${ACMEPROXY_URL}/present" \ | |
| -H "Content-Type: application/json" \ | |
| --user "${ACMEPROXY_AUTH}" \ | |
| -d '{"fqdn":"'${TOKEN_FQDN}'","value":"'${TOKEN_VALUE}'"}' | |
| } | |
| unset_challange() { | |
| local DOMAIN="${1}" TOKEN_FQDN="${2}" TOKEN_VALUE="${3}" | |
| curl -X POST "${ACMEPROXY_URL}/cleanup" \ | |
| -H "Content-Type: application/json" \ | |
| --user "${ACMEPROXY_AUTH}" \ | |
| -d '{"fqdn":"'${TOKEN_FQDN}'","value":"'${TOKEN_VALUE}'"}' | |
| } | |
| HANDLER="$1"; shift | |
| case "${HANDLER}" in | |
| set) | |
| set_challange "$@" | |
| ;; | |
| unset) | |
| unset_challange "$@" | |
| ;; | |
| *) | |
| ;; | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment