mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-04-29 22:07:44 +00:00
Merge 368a6e4fc8ccbbccd22a4986685f9c1b419a1255 into 40b6db6a2715628aa977ed1853fe5256704010ae
This commit is contained in:
commit
0f61188c0c
@ -27,6 +27,14 @@ dns_cf_add() {
|
||||
CF_Key="${CF_Key:-$(_readaccountconf_mutable CF_Key)}"
|
||||
CF_Email="${CF_Email:-$(_readaccountconf_mutable CF_Email)}"
|
||||
|
||||
_check_banned_tlds "$fulldomain"
|
||||
if [ "$?" = "1" ]; then
|
||||
_err "Your domain TLD is banned by Cloudflare to use the API."
|
||||
_err "Please use DNS manual mode."
|
||||
_err "See https://github.com/acmesh-official/acme.sh/issues/2901."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ "$CF_Token" ]; then
|
||||
if [ "$CF_Zone_ID" ]; then
|
||||
_savedomainconf CF_Token "$CF_Token"
|
||||
@ -250,3 +258,15 @@ _cf_rest() {
|
||||
_debug2 response "$response"
|
||||
return 0
|
||||
}
|
||||
|
||||
_check_banned_tlds() {
|
||||
banned_tlds="cf,ga,gq,ml,tk"
|
||||
domain_parts="$(echo "$1" | tr '.' ' ' | wc -w)"
|
||||
tld="$(echo "$1" | cut -d . -f "$domain_parts")"
|
||||
for i in $(echo "$banned_tlds" | tr ',' ' '); do
|
||||
if [ "$tld" = "$i" ]; then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user