Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
2ef9904d
Unverified
Commit
2ef9904d
authored
Feb 11, 2018
by
Martin Donlon
Committed by
GitHub
Feb 11, 2018
Browse files
Merge branch 'dev' into dreamhost_dns
parents
2c83224f
0c63090a
Changes
4
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
2ef9904d
...
@@ -315,7 +315,7 @@ You don't have to do anything manually!
...
@@ -315,7 +315,7 @@ You don't have to do anything manually!
1.
InternetX autoDNS API (https://internetx.com)
1.
InternetX autoDNS API (https://internetx.com)
1.
Azure DNS
1.
Azure DNS
1.
selectel.com(selectel.ru) DNS API
1.
selectel.com(selectel.ru) DNS API
1.
zonomi.com DNS API
And:
And:
1.
lexicon DNS API: https://github.com/Neilpang/acme.sh/wiki/How-to-use-lexicon-dns-api
1.
lexicon DNS API: https://github.com/Neilpang/acme.sh/wiki/How-to-use-lexicon-dns-api
...
...
acme.sh
View file @
2ef9904d
#!/usr/bin/env sh
#!/usr/bin/env sh
VER
=
2.7.
6
VER
=
2.7.
7
PROJECT_NAME
=
"acme.sh"
PROJECT_NAME
=
"acme.sh"
...
@@ -1561,6 +1561,9 @@ _inithttp() {
...
@@ -1561,6 +1561,9 @@ _inithttp() {
_ACME_CURL
=
"
$_ACME_CURL
--cacert
$CA_BUNDLE
"
_ACME_CURL
=
"
$_ACME_CURL
--cacert
$CA_BUNDLE
"
fi
fi
if
_contains
"
$(
curl
--help
2>&1
)
"
"--globoff"
;
then
_ACME_CURL
=
"
$_ACME_CURL
-g "
fi
fi
fi
if
[
-z
"
$_ACME_WGET
"
]
&&
_exists
"wget"
;
then
if
[
-z
"
$_ACME_WGET
"
]
&&
_exists
"wget"
;
then
...
...
dnsapi/README.md
View file @
2ef9904d
...
@@ -719,7 +719,29 @@ acme.sh --issue --dns dns_selectel -d example.com -d www.example.com
...
@@ -719,7 +719,29 @@ acme.sh --issue --dns dns_selectel -d example.com -d www.example.com
The
`SL_Key`
will be saved in
`~/.acme.sh/account.conf`
and will be reused when needed.
The
`SL_Key`
will be saved in
`~/.acme.sh/account.conf`
and will be reused when needed.
## 39. Use DreamHost DNS API
## 39. Use zonomi.com domain API to automatically issue cert
First you need to login to your account to find your API key from: http://zonomi.com/app/dns/dyndns.jsp
Your will find your api key in the example urls:
```
sh
https://zonomi.com/app/dns/dyndns.jsp?host
=
example.com&api_key
=
1063364558943540954358668888888888
```
```
sh
export
ZM_Key
=
"1063364558943540954358668888888888"
```
Ok, let's issue a cert now:
```
acme.sh --issue --dns dns_zonomi -d example.com -d www.example.com
```
The
`ZM_Key`
will be saved in
`~/.acme.sh/account.conf`
and will be reused when needed.
## 40. Use DreamHost DNS API
DNS API keys may be created at https://panel.dreamhost.com/?tree=home.api.
DNS API keys may be created at https://panel.dreamhost.com/?tree=home.api.
Ensure the created key has add and remove privelages.
Ensure the created key has add and remove privelages.
...
...
dnsapi/dns_zonomi.sh
0 → 100644
View file @
2ef9904d
#!/usr/bin/env sh
#
#ZM_Key="sdfsdfsdfljlbjkljlkjsdfoiwje"
#
#https://zonomi.com dns api
ZM_Api
=
"https://zonomi.com/app/dns/dyndns.jsp"
######## Public functions #####################
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
dns_zonomi_add
()
{
fulldomain
=
$1
txtvalue
=
$2
ZM_Key
=
"
${
ZM_Key
:-
$(
_readaccountconf_mutable ZM_Key
)
}
"
if
[
-z
"
$ZM_Key
"
]
;
then
ZM_Key
=
""
_err
"You don't specify zonomi api key yet."
_err
"Please create your key and try again."
return
1
fi
#save the api key to the account conf file.
_saveaccountconf_mutable ZM_Key
"
$ZM_Key
"
_info
"Get existing txt records for
$fulldomain
"
if
!
_zm_request
"action=QUERY&name=
$fulldomain
"
;
then
_err
"error"
return
1
fi
if
_contains
"
$response
"
"<record"
;
then
_debug
"get and update records"
_qstr
=
"action[1]=SET&type[1]=TXT&name[1]=
$fulldomain
&value[1]=
$txtvalue
"
_qindex
=
2
for
t
in
$(
echo
"
$response
"
|
tr
-d
"
\r\n
"
| _egrep_o
'<action.*</action>'
|
tr
"<"
"
\n
"
|
grep
record |
grep
'type="TXT"'
|
cut
-d
'"'
-f
6
)
;
do
_debug2 t
"
$t
"
_qstr
=
"
$_qstr
&action[
$_qindex
]=SET&type[
$_qindex
]=TXT&name[
$_qindex
]=
$fulldomain
&value[
$_qindex
]=
$t
"
_qindex
=
"
$(
_math
"
$_qindex
"
+ 1
)
"
done
_zm_request
"
$_qstr
"
else
_debug
"Just add record"
_zm_request
"action=SET&type=TXT&name=
$fulldomain
&value=
$txtvalue
"
fi
}
#fulldomain txtvalue
dns_zonomi_rm
()
{
fulldomain
=
$1
txtvalue
=
$2
ZM_Key
=
"
${
ZM_Key
:-
$(
_readaccountconf_mutable ZM_Key
)
}
"
if
[
-z
"
$ZM_Key
"
]
;
then
ZM_Key
=
""
_err
"You don't specify zonomi api key yet."
_err
"Please create your key and try again."
return
1
fi
_zm_request
"action=DELETE&type=TXT&name=
$fulldomain
"
}
#################### Private functions below ##################################
#qstr
_zm_request
()
{
qstr
=
"
$1
"
_debug2
"qstr"
"
$qstr
"
_zm_url
=
"
$ZM_Api
?api_key=
$ZM_Key
&
$qstr
"
_debug2
"_zm_url"
"
$_zm_url
"
response
=
"
$(
_get
"
$_zm_url
"
)
"
if
[
"
$?
"
!=
"0"
]
;
then
return
1
fi
_debug2 response
"
$response
"
_contains
"
$response
"
"<is_ok>OK:"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment