mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-07-01 02:22:44 +00:00
Fixed auth for non-2FA
This commit is contained in:
parent
9559f3514b
commit
3c04e13ec3
@ -34,13 +34,21 @@ dns_he_add() {
|
|||||||
_clearaccountconf HE_OTP_Secret
|
_clearaccountconf HE_OTP_Secret
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_sign_in
|
if [ ! -z "$HE_OTP_Secret" ]; then
|
||||||
|
_sign_in
|
||||||
|
fi
|
||||||
|
|
||||||
# Fills in the $_zone_id
|
# Fills in the $_zone_id
|
||||||
_find_zone "$_full_domain" || return 1
|
_find_zone "$_full_domain" || return 1
|
||||||
_debug "Zone id \"$_zone_id\" will be used."
|
_debug "Zone id \"$_zone_id\" will be used."
|
||||||
|
|
||||||
body="account="
|
if [ ! -z "$HE_OTP_Secret" ]; then
|
||||||
|
body="account="
|
||||||
|
else
|
||||||
|
body="email=${HE_Username}&pass=${HE_Password}"
|
||||||
|
body="$body&account="
|
||||||
|
fi
|
||||||
|
|
||||||
body="$body&menu=edit_zone"
|
body="$body&menu=edit_zone"
|
||||||
body="$body&Type=TXT"
|
body="$body&Type=TXT"
|
||||||
body="$body&hosted_dns_zoneid=$_zone_id"
|
body="$body&hosted_dns_zoneid=$_zone_id"
|
||||||
@ -60,7 +68,9 @@ dns_he_add() {
|
|||||||
fi
|
fi
|
||||||
_debug2 response "$response"
|
_debug2 response "$response"
|
||||||
|
|
||||||
_sign_out
|
if [ ! -z "$HE_OTP_Secret" ]; then
|
||||||
|
_sign_out
|
||||||
|
fi
|
||||||
|
|
||||||
return "$exit_code"
|
return "$exit_code"
|
||||||
}
|
}
|
||||||
@ -73,14 +83,22 @@ dns_he_rm() {
|
|||||||
_txt_value=$2
|
_txt_value=$2
|
||||||
_info "Cleaning up after DNS-01 Hurricane Electric hook"
|
_info "Cleaning up after DNS-01 Hurricane Electric hook"
|
||||||
|
|
||||||
_sign_in
|
if [ ! -z "$HE_OTP_Secret" ]; then
|
||||||
|
_sign_in
|
||||||
|
fi
|
||||||
|
|
||||||
# fills in the $_zone_id
|
# fills in the $_zone_id
|
||||||
_find_zone "$_full_domain" || return 1
|
_find_zone "$_full_domain" || return 1
|
||||||
_debug "Zone id \"$_zone_id\" will be used."
|
_debug "Zone id \"$_zone_id\" will be used."
|
||||||
|
|
||||||
# Find the record id to clean
|
# Find the record id to clean
|
||||||
body="hosted_dns_zoneid=$_zone_id"
|
if [ ! -z "$HE_OTP_Secret" ]; then
|
||||||
|
body="hosted_dns_zoneid=$_zone_id"
|
||||||
|
else
|
||||||
|
body="email=${HE_Username}&pass=${HE_Password}"
|
||||||
|
body="$body&hosted_dns_zoneid=$_zone_id"
|
||||||
|
fi
|
||||||
|
|
||||||
body="$body&menu=edit_zone"
|
body="$body&menu=edit_zone"
|
||||||
body="$body&hosted_dns_editzone="
|
body="$body&hosted_dns_editzone="
|
||||||
domain_regex="$(echo "$_full_domain" | sed 's/\./\\./g')" # escape dots
|
domain_regex="$(echo "$_full_domain" | sed 's/\./\\./g')" # escape dots
|
||||||
@ -95,6 +113,13 @@ dns_he_rm() {
|
|||||||
# HE changes their website somehow).
|
# HE changes their website somehow).
|
||||||
|
|
||||||
# Remove the record
|
# Remove the record
|
||||||
|
if [ ! -z "$HE_OTP_Secret" ]; then
|
||||||
|
body="menu=edit_zone"
|
||||||
|
else
|
||||||
|
body="email=${HE_Username}&pass=${HE_Password}"
|
||||||
|
body="$body&menu=edit_zone"
|
||||||
|
fi
|
||||||
|
|
||||||
body="menu=edit_zone"
|
body="menu=edit_zone"
|
||||||
body="$body&hosted_dns_zoneid=$_zone_id"
|
body="$body&hosted_dns_zoneid=$_zone_id"
|
||||||
body="$body&hosted_dns_recordid=$_record_id"
|
body="$body&hosted_dns_recordid=$_record_id"
|
||||||
@ -107,10 +132,14 @@ dns_he_rm() {
|
|||||||
exit_code="$?"
|
exit_code="$?"
|
||||||
if [ "$exit_code" -eq 0 ]; then
|
if [ "$exit_code" -eq 0 ]; then
|
||||||
_info "Record removed successfully."
|
_info "Record removed successfully."
|
||||||
_sign_out
|
if [ ! -z "$HE_OTP_Secret" ]; then
|
||||||
|
_sign_out
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
_err "Could not clean (remove) up the record. Please go to HE administration interface and clean it by hand."
|
_err "Could not clean (remove) up the record. Please go to HE administration interface and clean it by hand."
|
||||||
_sign_out
|
if [ ! -z "$HE_OTP_Secret" ]; then
|
||||||
|
_sign_out
|
||||||
|
fi
|
||||||
return "$exit_code"
|
return "$exit_code"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -124,7 +153,7 @@ dns_he_rm() {
|
|||||||
_sign_in() {
|
_sign_in() {
|
||||||
_debug "Signing into Hurricane Electric account."
|
_debug "Signing into Hurricane Electric account."
|
||||||
|
|
||||||
body="email=${HE_Username}&pass=${HE_Password}&submit=Login%21"
|
body="email=${HE_Username}&pass=${HE_Password}"
|
||||||
|
|
||||||
response="$(_post "$body" "https://dns.he.net/")"
|
response="$(_post "$body" "https://dns.he.net/")"
|
||||||
|
|
||||||
@ -177,6 +206,10 @@ _find_zone() {
|
|||||||
|
|
||||||
_domain="$1"
|
_domain="$1"
|
||||||
|
|
||||||
|
if [ -z "$HE_OTP_Secret" ]; then
|
||||||
|
body="email=${HE_Username}&pass=${HE_Password}"
|
||||||
|
fi
|
||||||
|
|
||||||
_matches=$(_post "$body" "https://dns.he.net/" \
|
_matches=$(_post "$body" "https://dns.he.net/" \
|
||||||
| _egrep_o "delete_dom.*name=\"[^\"]+\" value=\"[0-9]+"
|
| _egrep_o "delete_dom.*name=\"[^\"]+\" value=\"[0-9]+"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user