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
f511a527
Unverified
Commit
f511a527
authored
Aug 24, 2020
by
Sergey Pashinin
Browse files
Using _post function
parent
de692d3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy/vault.sh
View file @
f511a527
...
...
@@ -49,14 +49,15 @@ vault_deploy() {
_cfullchain
=
$(
sed
-z
's/\n/\\n/g'
<
"
$5
"
)
URL
=
"
$VAULT_ADDR
/v1/
$VAULT_PREFIX
/
$_cdomain
"
export
_H1
=
"X-Vault-Token:
$VAULT_TOKEN
"
if
[
-n
"
$FABIO
"
]
;
then
curl
--silent
-H
"X-Vault-Token:
$VAULT_TOKEN
"
--request
POST
--data
"{
\"
cert
\"
:
\"
$_cfullchain
\"
,
\"
key
\"
:
\"
$_ckey
\"
}"
"
$URL
"
||
return
1
_post
"{
\"
cert
\"
:
\"
$_cfullchain
\"
,
\"
key
\"
:
\"
$_ckey
\"
}"
"
$URL
"
else
curl
--silent
-H
"X-Vault-Token:
$VAULT_TOKEN
"
--request
POST
--data
"{
\"
value
\"
:
\"
$_ccert
\"
}"
"
$URL
/cert.pem"
||
return
1
curl
--silent
-H
"X-Vault-Token:
$VAULT_TOKEN
"
--request
POST
--data
"{
\"
value
\"
:
\"
$_ckey
\"
}"
"
$URL
/cert.key"
||
return
1
curl
--silent
-H
"X-Vault-Token:
$VAULT_TOKEN
"
--request
POST
--data
"{
\"
value
\"
:
\"
$_cca
\"
}"
"
$URL
/chain.pem"
||
return
1
curl
--silent
-H
"X-Vault-Token:
$VAULT_TOKEN
"
--request
POST
--data
"{
\"
value
\"
:
\"
$_cfullchain
\"
}"
"
$URL
/fullchain.pem"
||
return
1
_post
"{
\"
value
\"
:
\"
$_ccert
\"
}"
"
$URL
/cert.pem"
_post
"{
\"
value
\"
:
\"
$_ckey
\"
}"
"
$URL
/cert.key"
_post
"{
\"
value
\"
:
\"
$_cca
\"
}"
"
$URL
/chain.pem"
_post
"{
\"
value
\"
:
\"
$_cfullchain
\"
}"
"
$URL
/fullchain.pem"
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