diff --git a/dns_scripts/dns_add_cpanel b/dns_scripts/dns_add_cpanel index 24a1ca8a..ed3bd922 100755 --- a/dns_scripts/dns_add_cpanel +++ b/dns_scripts/dns_add_cpanel @@ -61,11 +61,11 @@ fi # If no existing record, create a new TXT record, otherwise edit the existing record if [[ "$resp" == *\"data\":[]* ]]; then - request_params="&cpanel_jsonapi_func=add_zone_record&domain=$domain&type=TXT&name=_acme-challenge$name&txtdata=$token" + request_params="&cpanel_jsonapi_func=add_zone_record&domain=${domain}&type=TXT&name=_acme-challenge&txtdata=${token}" else # shellcheck disable=SC2001 line=$(echo "$resp" | sed -e 's/.*line":\([0-9]*\),.*/\1/') - request_params="&cpanel_jsonapi_func=edit_zone_record&domain=$domain&type=TXT&name=_acme-challenge$name&txtdata=${token}&line=${line}" + request_params="&cpanel_jsonapi_func=edit_zone_record&domain=${domain}&type=TXT&name=_acme-challenge&txtdata=${token}&line=${line}" fi resp=$(curl --silent "${curl_params[@]}" "$request_func$request_params") diff --git a/dns_scripts/dns_del_cpanel b/dns_scripts/dns_del_cpanel index 922151a5..10bb7a06 100755 --- a/dns_scripts/dns_del_cpanel +++ b/dns_scripts/dns_del_cpanel @@ -58,7 +58,7 @@ fi line=$(echo "$resp" | sed -e 's/.*line":\([0-9]*\),.*/\1/') if [[ "$line" != "" ]]; then # Delete the challenge token - request_params="&cpanel_jsonapi_func=remove_zone_record&domain=$domain&type=TXT&name=_acme-challenge$name&line=$line" + request_params="&cpanel_jsonapi_func=remove_zone_record&domain=${domain}&type=TXT&name=_acme-challenge&line=${line}" resp=$(curl --silent "${curl_params[@]}" "$request_func$request_params") fi diff --git a/getssl b/getssl index ba1537a6..7db8f95c 100755 --- a/getssl +++ b/getssl @@ -293,6 +293,7 @@ # 2024-03-26 Test for "true" in wildcard property of authorization responses # 2024-10-16 Add newlines to /directory response (#765)(#859) # 2025-06-18 Support profiles +# 2025-07-28 Fix cPanel support for API zone record updates and wildcard domain support # ---------------------------------------------------------------------------------------- case :$SHELLOPTS: in @@ -301,7 +302,7 @@ esac PROGNAME=${0##*/} PROGDIR="$(cd "$(dirname "$0")" || exit; pwd -P;)" -VERSION="2.49" +VERSION="2.50" # defaults ACCOUNT_KEY_LENGTH=4096 diff --git a/other_scripts/cpanel_cert_upload b/other_scripts/cpanel_cert_upload index 1a937579..982c822b 100755 --- a/other_scripts/cpanel_cert_upload +++ b/other_scripts/cpanel_cert_upload @@ -5,6 +5,7 @@ # use with RELOAD_CMD="${HOME}/cpanel_cert_upload domain.com" domain="$1" +nowild=$(echo "${1//\*\./}") rawurlencode() { local string @@ -28,4 +29,4 @@ ecert=$( rawurlencode "${HOME}/.getssl/${domain}/${domain}.crt" ) ekey=$( rawurlencode "${HOME}/.getssl/${domain}/${domain}.key" ) echain=$( rawurlencode "${HOME}/.getssl/${domain}/chain.crt" ) -uapi SSL install_ssl domain="${domain}" cert="${ecert}" key="${ekey}" cabundle="${echain}" +uapi SSL install_ssl domain="${nowild}" cert="${ecert}" key="${ekey}" cabundle="${echain}"