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
54a52f70
Commit
54a52f70
authored
Feb 15, 2018
by
neilpang
Browse files
Merge branch 'dev' of
https://github.com/Neilpang/acme.sh
into dev
parents
f213215c
96cde120
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
54a52f70
...
@@ -315,12 +315,7 @@ You don't have to do anything manually!
...
@@ -315,12 +315,7 @@ You don't have to do anything manually!
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
1.
zonomi.com DNS API
1.
DreamHost.com API
And:
And:
...
...
dnsapi/README.md
View file @
54a52f70
...
@@ -515,7 +515,7 @@ acme.sh --issue --dns dns_nsone -d example.com -d www.example.com
...
@@ -515,7 +515,7 @@ acme.sh --issue --dns dns_nsone -d example.com -d www.example.com
export DuckDNS_Token="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
export DuckDNS_Token="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
```
```
Please note that since DuckDNS uses StartSSL as their cert provider, thus
Please note that since DuckDNS uses StartSSL as their cert provider, thus
--insecure may need to be used when issuing certs:
--insecure may need to be used when issuing certs:
```
```
acme.sh --insecure --issue --dns dns_duckdns -d mydomain.duckdns.org
acme.sh --insecure --issue --dns dns_duckdns -d mydomain.duckdns.org
...
@@ -744,6 +744,18 @@ acme.sh --issue --dns dns_zonomi -d example.com -d www.example.com
...
@@ -744,6 +744,18 @@ 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.
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.
Ensure the created key has add and remove privelages.
```
export DH_API_Key="<api key>"
acme.sh --issue --dns dns_dreamhost -d example.com -d www.example.com
```
The 'DH_API_KEY' will be saved in
`~/.acme.sh/account.conf`
and will
be reused when needed.
# Use custom API
# Use custom API
...
...
dnsapi/dns_dreamhost.sh
0 → 100644
View file @
54a52f70
#!/usr/bin/env sh
#Author: RhinoLance
#Report Bugs here: https://github.com/RhinoLance/acme.sh
#
#define the api endpoint
DH_API_ENDPOINT
=
"https://api.dreamhost.com/"
querystring
=
""
######## Public functions #####################
#Usage: dns_myapi_add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
dns_dreamhost_add
()
{
fulldomain
=
$1
txtvalue
=
$2
if
!
validate
"
$fulldomain
"
"
$txtvalue
"
;
then
return
1
fi
querystring
=
"key=
$DH_API_KEY
&cmd=dns-add_record&record=
$fulldomain
&type=TXT&value=
$txtvalue
"
if
!
submit
"
$querystring
"
;
then
return
1
fi
return
0
}
#Usage: fulldomain txtvalue
#Remove the txt record after validation.
dns_dreamhost_rm
()
{
fulldomain
=
$1
txtvalue
=
$2
if
!
validate
"
$fulldomain
"
"
$txtvalue
"
;
then
return
1
fi
querystring
=
"key=
$DH_API_KEY
&cmd=dns-remove_record&record=
$fulldomain
&type=TXT&value=
$txtvalue
"
if
!
submit
"
$querystring
"
;
then
return
1
fi
return
0
}
#################### Private functions below ##################################
#send the command to the api endpoint.
submit
()
{
querystring
=
$1
url
=
"
$DH_API_ENDPOINT
?
$querystring
"
_debug url
"
$url
"
if
!
response
=
"
$(
_get
"
$url
"
)
"
;
then
_err
"Error <
$1
>"
return
1
fi
if
[
-z
"
$2
"
]
;
then
message
=
"
$(
echo
"
$response
"
| _egrep_o
"
\"
Message
\"
:
\"
[^
\"
]*
\"
"
|
cut
-d
:
-f
2 |
tr
-d
\"
)
"
if
[
-n
"
$message
"
]
;
then
_err
"
$message
"
return
1
fi
fi
_debug response
"
$response
"
return
0
}
#check that we have a valid API Key
validate
()
{
fulldomain
=
$1
txtvalue
=
$2
_info
"Using dreamhost"
_debug fulldomain
"
$fulldomain
"
_debug txtvalue
"
$txtvalue
"
#retrieve the API key from the environment variable if it exists, otherwise look for a saved key.
DH_API_KEY
=
"
${
DH_API_KEY
:-
$(
_readaccountconf_mutable DH_API_KEY
)
}
"
if
[
-z
"
$DH_API_KEY
"
]
;
then
DH_API_KEY
=
""
_err
"You didn't specify the DreamHost api key yet (export DH_API_KEY=
\"
<api key>
\"
)"
_err
"Please login to your control panel, create a key and try again."
return
1
fi
#save the api key to the account conf file.
_saveaccountconf_mutable DH_API_KEY
"
$DH_API_KEY
"
}
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