mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-08-21 15:43:29 +08:00
dns_zonomi: make the API endpoint configurable via ZM_Api
RimuHosting (which owns zonomi) exposes the identical API at https://rimuhosting.com/dns/dyndns.jsp; an overridable endpoint serves both providers with one hook. The default stays zonomi.com and is not written to the account conf. https://github.com/acmesh-official/acme.sh/issues/6475
This commit is contained in:
@@ -5,9 +5,11 @@ Site: zonomi.com
|
|||||||
Docs: github.com/acmesh-official/acme.sh/wiki/dnsapi#dns_zonomi
|
Docs: github.com/acmesh-official/acme.sh/wiki/dnsapi#dns_zonomi
|
||||||
Options:
|
Options:
|
||||||
ZM_Key API Key
|
ZM_Key API Key
|
||||||
|
OptionsAlt:
|
||||||
|
ZM_Api API endpoint. Default: "https://zonomi.com/app/dns/dyndns.jsp". For RimuHosting use "https://rimuhosting.com/dns/dyndns.jsp".
|
||||||
'
|
'
|
||||||
|
|
||||||
ZM_Api="https://zonomi.com/app/dns/dyndns.jsp"
|
ZM_Api_Default="https://zonomi.com/app/dns/dyndns.jsp"
|
||||||
|
|
||||||
######## Public functions #####################
|
######## Public functions #####################
|
||||||
|
|
||||||
@@ -28,6 +30,8 @@ dns_zonomi_add() {
|
|||||||
#save the api key to the account conf file.
|
#save the api key to the account conf file.
|
||||||
_saveaccountconf_mutable ZM_Key "$ZM_Key"
|
_saveaccountconf_mutable ZM_Key "$ZM_Key"
|
||||||
|
|
||||||
|
_zm_init_api
|
||||||
|
|
||||||
_info "Get existing txt records for $fulldomain"
|
_info "Get existing txt records for $fulldomain"
|
||||||
if ! _zm_request "action=QUERY&name=$fulldomain"; then
|
if ! _zm_request "action=QUERY&name=$fulldomain"; then
|
||||||
_err "error"
|
_err "error"
|
||||||
@@ -64,11 +68,27 @@ dns_zonomi_rm() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
_zm_init_api
|
||||||
|
|
||||||
_zm_request "action=DELETE&type=TXT&name=$fulldomain"
|
_zm_request "action=DELETE&type=TXT&name=$fulldomain"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#################### Private functions below ##################################
|
#################### Private functions below ##################################
|
||||||
|
|
||||||
|
# resolve the API endpoint: zonomi by default, overridable for providers
|
||||||
|
# sharing the same API on another host (e.g. RimuHosting)
|
||||||
|
_zm_init_api() {
|
||||||
|
ZM_Api="${ZM_Api:-$(_readaccountconf_mutable ZM_Api)}"
|
||||||
|
if [ -z "$ZM_Api" ]; then
|
||||||
|
ZM_Api="$ZM_Api_Default"
|
||||||
|
fi
|
||||||
|
_debug2 ZM_Api "$ZM_Api"
|
||||||
|
if [ "$ZM_Api" != "$ZM_Api_Default" ]; then
|
||||||
|
_saveaccountconf_mutable ZM_Api "$ZM_Api"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
#qstr
|
#qstr
|
||||||
_zm_request() {
|
_zm_request() {
|
||||||
qstr="$1"
|
qstr="$1"
|
||||||
|
|||||||
Reference in New Issue
Block a user