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
5398bac5
Unverified
Commit
5398bac5
authored
Mar 31, 2020
by
neil
Committed by
GitHub
Mar 31, 2020
Browse files
Merge pull request #2823 from acmesh-official/dev
sync
parents
2e9c4914
9984a168
Changes
4
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
5398bac5
...
@@ -4540,7 +4540,7 @@ $_authorizations_map"
...
@@ -4540,7 +4540,7 @@ $_authorizations_map"
_savedomainconf
"Le_LinkOrder"
"
$Le_LinkOrder
"
_savedomainconf
"Le_LinkOrder"
"
$Le_LinkOrder
"
_link_cert_retry
=
0
_link_cert_retry
=
0
_MAX_CERT_RETRY
=
5
_MAX_CERT_RETRY
=
30
while
[
"
$_link_cert_retry
"
-lt
"
$_MAX_CERT_RETRY
"
]
;
do
while
[
"
$_link_cert_retry
"
-lt
"
$_MAX_CERT_RETRY
"
]
;
do
if
_contains
"
$response
"
"
\"
status
\"
:
\"
valid
\"
"
;
then
if
_contains
"
$response
"
"
\"
status
\"
:
\"
valid
\"
"
;
then
_debug
"Order status is valid."
_debug
"Order status is valid."
...
...
deploy/qiniu.sh
View file @
5398bac5
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
# export QINIU_AK="QINIUACCESSKEY"
# export QINIU_AK="QINIUACCESSKEY"
# export QINIU_SK="QINIUSECRETKEY"
# export QINIU_SK="QINIUSECRETKEY"
# export QINIU_CDN_DOMAIN="cdn.example.com"
# export QINIU_CDN_DOMAIN="cdn.example.com"
# If you have more than one domain, just
# export QINIU_CDN_DOMAIN="cdn1.example.com cdn2.example.com"
QINIU_API_BASE
=
"https://api.qiniu.com"
QINIU_API_BASE
=
"https://api.qiniu.com"
...
@@ -67,21 +69,23 @@ qiniu_deploy() {
...
@@ -67,21 +69,23 @@ qiniu_deploy() {
_debug certId
"
$_certId
"
_debug certId
"
$_certId
"
## update domain ssl config
## update domain ssl config
update_path
=
"/domain/
$QINIU_CDN_DOMAIN
/httpsconf"
update_body
=
"{
\"
certid
\"
:
$_certId
,
\"
forceHttps
\"
:false}"
update_body
=
"{
\"
certid
\"
:
$_certId
,
\"
forceHttps
\"
:false}"
update_access_token
=
"
$(
_make_access_token
"
$update_path
"
)
"
for
domain
in
$QINIU_CDN_DOMAIN
;
do
_debug update_access_token
"
$update_access_token
"
update_path
=
"/domain/
$domain
/httpsconf"
export
_H1
=
"Authorization: QBox
$update_access_token
"
update_access_token
=
"
$(
_make_access_token
"
$update_path
"
)
"
update_response
=
$(
_post
"
$update_body
"
"
$QINIU_API_BASE$update_path
"
0
"PUT"
"application/json"
| _dbase64
"multiline"
)
_debug update_access_token
"
$update_access_token
"
export
_H1
=
"Authorization: QBox
$update_access_token
"
if
_contains
"
$update_response
"
"error"
;
then
update_response
=
$(
_post
"
$update_body
"
"
$QINIU_API_BASE$update_path
"
0
"PUT"
"application/json"
| _dbase64
"multiline"
)
_err
"Error in updating domain httpsconf:"
_err
"
$update_response
"
if
_contains
"
$update_response
"
"error"
;
then
return
1
_err
"Error in updating domain
$domain
httpsconf:"
fi
_err
"
$update_response
"
return
1
_debug update_response
"
$update_response
"
fi
_info
"Certificate successfully deployed"
_debug update_response
"
$update_response
"
_info
"Domain
$domain
certificate has been deployed successfully"
done
return
0
return
0
}
}
...
...
dnsapi/dns_cf.sh
View file @
5398bac5
...
@@ -94,6 +94,7 @@ dns_cf_rm() {
...
@@ -94,6 +94,7 @@ dns_cf_rm() {
CF_Token
=
"
${
CF_Token
:-
$(
_readaccountconf_mutable CF_Token
)
}
"
CF_Token
=
"
${
CF_Token
:-
$(
_readaccountconf_mutable CF_Token
)
}
"
CF_Account_ID
=
"
${
CF_Account_ID
:-
$(
_readaccountconf_mutable CF_Account_ID
)
}
"
CF_Account_ID
=
"
${
CF_Account_ID
:-
$(
_readaccountconf_mutable CF_Account_ID
)
}
"
CF_Zone_ID
=
"
${
CF_Zone_ID
:-
$(
_readaccountconf_mutable CF_Zone_ID
)
}
"
CF_Key
=
"
${
CF_Key
:-
$(
_readaccountconf_mutable CF_Key
)
}
"
CF_Key
=
"
${
CF_Key
:-
$(
_readaccountconf_mutable CF_Key
)
}
"
CF_Email
=
"
${
CF_Email
:-
$(
_readaccountconf_mutable CF_Email
)
}
"
CF_Email
=
"
${
CF_Email
:-
$(
_readaccountconf_mutable CF_Email
)
}
"
...
...
dnsapi/dns_nm.sh
0 → 100644
View file @
5398bac5
#!/usr/bin/env sh
########################################################################
# https://namemaster.de hook script for acme.sh
#
# Environment variables:
#
# - $NM_user (your namemaster.de API username)
# - $NM_sha256 (your namemaster.de API password_as_sha256hash)
#
# Author: Thilo Gass <thilo.gass@gmail.com>
# Git repo: https://github.com/ThiloGa/acme.sh
#-- dns_nm_add() - Add TXT record --------------------------------------
# Usage: dns_nm_add _acme-challenge.subdomain.domain.com "XyZ123..."
namemaster_api
=
"https://namemaster.de/api/api.php"
dns_nm_add
()
{
fulldomain
=
$1
txt_value
=
$2
_info
"Using DNS-01 namemaster hook"
NM_user
=
"
${
NM_user
:-
$(
_readaccountconf_mutable NM_user
)
}
"
NM_sha256
=
"
${
NM_sha256
:-
$(
_readaccountconf_mutable NM_sha256
)
}
"
if
[
-z
"
$NM_user
"
]
||
[
-z
"
$NM_sha256
"
]
;
then
NM_user
=
""
NM_sha256
=
""
_err
"No auth details provided. Please set user credentials using the
\$
NM_user and
\$
NM_sha256 environment variables."
return
1
fi
#save the api user and sha256 password to the account conf file.
_debug
"Save user and hash"
_saveaccountconf_mutable NM_user
"
$NM_user
"
_saveaccountconf_mutable NM_sha256
"
$NM_sha256
"
_debug
"First detect the root zone"
if
!
_get_root
"
$fulldomain
"
;
then
_err
"invalid domain"
"
$fulldomain
"
return
1
fi
_info
"die Zone lautet:"
"
$zone
"
get
=
"
$namemaster_api
?User=
$NM_user
&Password=
$NM_sha256
&Antwort=csv&Typ=ACME&zone=
$zone
&hostname=
$fulldomain
&TXT=
$txt_value
&Action=Auto&Lifetime=3600"
if
!
erg
=
"
$(
_get
"
$get
"
)
"
;
then
_err
"error Adding
$fulldomain
TXT:
$txt_value
"
return
1
fi
if
_contains
"
$erg
"
"Success"
;
then
_info
"Success, TXT Added, OK"
else
_err
"error Adding
$fulldomain
TXT:
$txt_value
erg:
$erg
"
return
1
fi
_debug
"ok Auto
$fulldomain
TXT:
$txt_value
erg:
$erg
"
return
0
}
dns_nm_rm
()
{
fulldomain
=
$1
txtvalue
=
$2
_info
"TXT enrty in
$fulldomain
is deleted automatically"
_debug fulldomain
"
$fulldomain
"
_debug txtvalue
"
$txtvalue
"
}
_get_root
()
{
domain
=
$1
get
=
"
$namemaster_api
?User=
$NM_user
&Password=
$NM_sha256
&Typ=acme&hostname=
$domain
&Action=getzone&antwort=csv"
if
!
zone
=
"
$(
_get
"
$get
"
)
"
;
then
_err
"error getting Zone"
return
1
else
if
_contains
"
$zone
"
"hostname not found"
;
then
return
1
fi
fi
}
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