Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
7f2699c6
Unverified
Commit
7f2699c6
authored
May 08, 2021
by
neil
Committed by
GitHub
May 08, 2021
Browse files
Merge pull request #3511 from acmesh-official/dev
Dev
parents
d0a16b0e
aede5c48
Changes
2
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
7f2699c6
#!/usr/bin/env sh
#!/usr/bin/env sh
VER
=
2.
8.9
VER
=
2.
9.0
PROJECT_NAME
=
"acme.sh"
PROJECT_NAME
=
"acme.sh"
...
@@ -3578,6 +3578,7 @@ _regAccount() {
...
@@ -3578,6 +3578,7 @@ _regAccount() {
_err
"Can not get EAB credentials from ZeroSSL."
_err
"Can not get EAB credentials from ZeroSSL."
return
1
return
1
fi
fi
_debug2
"
$_eabresp
"
_eab_id
=
"
$(
echo
"
$_eabresp
"
|
tr
',}'
'\n'
|
grep
'"eab_kid"'
|
cut
-d
:
-f
2 |
tr
-d
'"'
)
"
_eab_id
=
"
$(
echo
"
$_eabresp
"
|
tr
',}'
'\n'
|
grep
'"eab_kid"'
|
cut
-d
:
-f
2 |
tr
-d
'"'
)
"
if
[
-z
"
$_eab_id
"
]
;
then
if
[
-z
"
$_eab_id
"
]
;
then
_err
"Can not resolve _eab_id"
_err
"Can not resolve _eab_id"
...
@@ -4781,15 +4782,8 @@ $_authorizations_map"
...
@@ -4781,15 +4782,8 @@ $_authorizations_map"
_debug2 response
"
$response
"
_debug2 response
"
$response
"
status
=
$(
echo
"
$response
"
| _egrep_o
'"status":"[^"]*'
|
cut
-d
:
-f
2 |
tr
-d
'"'
)
status
=
$(
echo
"
$response
"
| _egrep_o
'"status":"[^"]*'
|
cut
-d
:
-f
2 |
tr
-d
'"'
)
if
_contains
"
$status
"
"valid"
;
then
_info
"
$(
__green Success
)
"
_stopserver
"
$serverproc
"
serverproc
=
""
_clearupwebbroot
"
$_currentRoot
"
"
$removelevel
"
"
$token
"
break
fi
if
[
"
$status
"
=
"invalid"
]
;
then
if
_contains
"
$status
"
"invalid"
;
then
error
=
"
$(
echo
"
$response
"
| _egrep_o
'"error":\{[^\}]*'
)
"
error
=
"
$(
echo
"
$response
"
| _egrep_o
'"error":\{[^\}]*'
)
"
_debug2 error
"
$error
"
_debug2 error
"
$error
"
errordetail
=
"
$(
echo
"
$error
"
| _egrep_o
'"detail": *"[^"]*'
|
cut
-d
'"'
-f
4
)
"
errordetail
=
"
$(
echo
"
$error
"
| _egrep_o
'"detail": *"[^"]*'
|
cut
-d
'"'
-f
4
)
"
...
@@ -4811,6 +4805,14 @@ $_authorizations_map"
...
@@ -4811,6 +4805,14 @@ $_authorizations_map"
return
1
return
1
fi
fi
if
_contains
"
$status
"
"valid"
;
then
_info
"
$(
__green Success
)
"
_stopserver
"
$serverproc
"
serverproc
=
""
_clearupwebbroot
"
$_currentRoot
"
"
$removelevel
"
"
$token
"
break
fi
if
[
"
$status
"
=
"pending"
]
;
then
if
[
"
$status
"
=
"pending"
]
;
then
_info
"Pending"
_info
"Pending"
elif
[
"
$status
"
=
"processing"
]
;
then
elif
[
"
$status
"
=
"processing"
]
;
then
...
...
deploy/gcore_cdn.sh
View file @
7f2699c6
...
@@ -56,9 +56,9 @@ gcore_cdn_deploy() {
...
@@ -56,9 +56,9 @@ gcore_cdn_deploy() {
_request
=
"{
\"
username
\"
:
\"
$Le_Deploy_gcore_cdn_username
\"
,
\"
password
\"
:
\"
$Le_Deploy_gcore_cdn_password
\"
}"
_request
=
"{
\"
username
\"
:
\"
$Le_Deploy_gcore_cdn_username
\"
,
\"
password
\"
:
\"
$Le_Deploy_gcore_cdn_password
\"
}"
_debug _request
"
$_request
"
_debug _request
"
$_request
"
export
_H1
=
"Content-Type:application/json"
export
_H1
=
"Content-Type:application/json"
_response
=
$(
_post
"
$_request
"
"https://api.gcdn.co/auth/
sign
in"
)
_response
=
$(
_post
"
$_request
"
"https://api.gcdn.co/auth/
jwt/log
in"
)
_debug _response
"
$_response
"
_debug _response
"
$_response
"
_regex
=
".*
\"
token
\"
:
\"\(
[-._0-9A-Za-z]*
\)\"
.*$"
_regex
=
".*
\"
access
\"
:
\"\(
[-._0-9A-Za-z]*
\)\"
.*$"
_debug _regex
"
$_regex
"
_debug _regex
"
$_regex
"
_token
=
$(
echo
"
$_response
"
|
sed
-n
"s/
$_regex
/
\1
/p"
)
_token
=
$(
echo
"
$_response
"
|
sed
-n
"s/
$_regex
/
\1
/p"
)
_debug _token
"
$_token
"
_debug _token
"
$_token
"
...
@@ -72,12 +72,15 @@ gcore_cdn_deploy() {
...
@@ -72,12 +72,15 @@ gcore_cdn_deploy() {
export
_H2
=
"Authorization:Token
$_token
"
export
_H2
=
"Authorization:Token
$_token
"
_response
=
$(
_get
"https://api.gcdn.co/resources"
)
_response
=
$(
_get
"https://api.gcdn.co/resources"
)
_debug _response
"
$_response
"
_debug _response
"
$_response
"
_regex
=
".*(
\"
id
\"
.*?
\"
cname
\"
:
\"
$_cdomain
\"
.*?})"
_regex
=
"
\"
primary_resource
\"
:null},"
_debug _regex
"
$_regex
"
_response
=
$(
echo
"
$_response
"
|
sed
"s/
$_regex
/
$_regex
\n
/g"
)
_debug _response
"
$_response
"
_regex
=
"^.*
\"
cname
\"
:
\"
$_cdomain
\"
.*$"
_regex
=
"^.*
\"
cname
\"
:
\"
$_cdomain
\"
.*$"
_debug _regex
"
$_regex
"
_debug _regex
"
$_regex
"
_resource
=
$(
echo
"
$_response
"
|
sed
's/},{/},\n{/g'
|
_egrep_o
"
$_regex
"
)
_resource
=
$(
echo
"
$_response
"
| _egrep_o
"
$_regex
"
)
_debug _resource
"
$_resource
"
_debug _resource
"
$_resource
"
_regex
=
".*
\"
id
\"
:
\(
[0-9]*
\)
.*
\"
rules
\"
.*
$"
_regex
=
".*
\"
id
\"
:
\(
[0-9]*
\)
.*$"
_debug _regex
"
$_regex
"
_debug _regex
"
$_regex
"
_resourceId
=
$(
echo
"
$_resource
"
|
sed
-n
"s/
$_regex
/
\1
/p"
)
_resourceId
=
$(
echo
"
$_resource
"
|
sed
-n
"s/
$_regex
/
\1
/p"
)
_debug _resourceId
"
$_resourceId
"
_debug _resourceId
"
$_resourceId
"
...
...
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