cpanel_uapi deploy-hook with root user

cpanel_uapi deploy-hook with root user, first time issue time cannot deploy cert. and give error  "Error in deploying certificate - cannot retrieve sitelist"
source of error: cpanel asks for username in site list:
solution: root user set the username  DEPLOY_CPANEL_USER and sitelist command processes the code with this argument
test env:
106.0.7 cpanel
centos 7
latest acme.sh
This commit is contained in:
mevlüt furkan demir 2022-10-09 19:01:24 +03:00 committed by GitHub
parent ff8de34415
commit 26ab454bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,13 @@ cpanel_uapi_deploy() {
# Auto mode
if [ "$DEPLOY_CPANEL_AUTO_ENABLED" = "true" ]; then
# call API for site config
_response=$(uapi DomainInfo list_domains)
if [ -n "$_uapi_user" ]; then
_response=$(uapi --user="$_uapi_user" DomainInfo list_domains)
else
_response=$(uapi DomainInfo list_domains)
fi
# exit if error in response
if [ -z "$_response" ] || [ "${_response#*"$uapi_error_response"}" != "$_response" ]; then
_err "Error in deploying certificate - cannot retrieve sitelist:"