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
48e9006c
Commit
48e9006c
authored
Aug 25, 2017
by
neilpang
Browse files
fix cpanel uapi
parent
309bec47
Changes
2
Hide whitespace changes
Inline
Side-by-side
deploy/README.md
View file @
48e9006c
...
...
@@ -80,3 +80,21 @@ acme.sh --deploy -d ftp.example.com --deploy-hook exim4
```
sh
acme.sh
--deploy
-d
ftp.example.com
--deploy-hook
keychain
```
## 7. Deploy to cpanel host.
```
acme.sh --deploy -d example.com --deploy-hook cpanel_uapi
```
If you are login as root, please specify the username to deploy cert to:
```
sh
export
DEPLOY_CPANEL_USER
=
username
acme.sh
--deploy
-d
example.com
--deploy-hook
cpanel_uapi
```
deploy/cpanel_uapi.sh
View file @
48e9006c
...
...
@@ -11,7 +11,7 @@
#domain keyfile certfile cafile fullchain
cpanel_uapi
()
{
cpanel_uapi
_deploy
()
{
_cdomain
=
"
$1
"
_ckey
=
"
$2
"
_ccert
=
"
$3
"
...
...
@@ -24,6 +24,14 @@ cpanel_uapi() {
_debug _cca
"
$_cca
"
_debug _cfullchain
"
$_cfullchain
"
if
!
_exists uapi
;
then
_err
"The command uapi is not found."
return
1
fi
if
!
_exists php
;
then
_err
"The command php is not found."
return
1
fi
# read cert and key files and urlencode both
_certstr
=
$(
cat
"
$_ccert
"
)
_keystr
=
$(
cat
"
$_ckey
"
)
...
...
@@ -34,6 +42,11 @@ cpanel_uapi() {
_debug _key
"
$_key
"
if
[
"
$(
id
-u
)
"
=
0
]
;
then
if
[
-z
"
$DEPLOY_CPANEL_USER
"
]
;
then
_err
"It seems that you are root, please define the target user name: export DEPLOY_CPANEL_USER=username"
return
1
;
fi
_savedomainconf DEPLOY_CPANEL_USER
"
$DEPLOY_CPANEL_USER
"
_response
=
$(
uapi
--user
=
"
$DEPLOY_CPANEL_USER
"
SSL install_ssl
domain
=
"
$_cdomain
"
cert
=
"
$_cert
"
key
=
"
$_key
"
)
else
_response
=
$(
uapi SSL install_ssl
domain
=
"
$_cdomain
"
cert
=
"
$_cert
"
key
=
"
$_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