Skip to content

Instantly share code, notes, and snippets.

@bjoern-r
Created January 30, 2026 16:14
Show Gist options
  • Select an option

  • Save bjoern-r/a92f0a8ba7c45e9a3e8491f2295af3cb to your computer and use it in GitHub Desktop.

Select an option

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
#!/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