Fixes 7
This commit is contained in:
@@ -111,6 +111,7 @@ check_result $? "Proxy restart failed" > /dev/null
|
|||||||
# Execute bunkerweb_module if it's enabled
|
# Execute bunkerweb_module if it's enabled
|
||||||
module_state=$($BIN/v-ext-modules state bunkerweb_module json | jq -r '.[0].STATE')
|
module_state=$($BIN/v-ext-modules state bunkerweb_module json | jq -r '.[0].STATE')
|
||||||
if [ "$module_state" = "enabled" ]; then
|
if [ "$module_state" = "enabled" ]; then
|
||||||
|
get_domain_values 'web'
|
||||||
$BIN/v-ext-modules-run bunkerweb_module alias "$domain" "$ALIAS"
|
$BIN/v-ext-modules-run bunkerweb_module alias "$domain" "$ALIAS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,25 @@ check_result $? "Web restart failed" > /dev/null
|
|||||||
$BIN/v-restart-proxy "$restart"
|
$BIN/v-restart-proxy "$restart"
|
||||||
check_result $? "Proxy restart failed" > /dev/null
|
check_result $? "Proxy restart failed" > /dev/null
|
||||||
|
|
||||||
|
# Execute bunkerweb_module if it's enabled
|
||||||
|
module_state=$($BIN/v-ext-modules state bunkerweb_module json | jq -r '.[0].STATE')
|
||||||
|
if [ "$module_state" = "enabled" ] && [ "$BUNKERWEB" = "yes" ]; then
|
||||||
|
BUNKW_DIR=$HOMEDIR/$user/conf/web/$domain/ssl/bunkerweb
|
||||||
|
if [ ! -d "$BUNKW_DIR" ]; then
|
||||||
|
mkdir -p "$BUNKW_DIR"
|
||||||
|
chmod 0755 "$BUNKW_DIR"
|
||||||
|
fi
|
||||||
|
cp -f "$HOMEDIR/$user/conf/web/$domain/ssl/$domain.crt" "$BUNKW_DIR/"
|
||||||
|
cp -f "$HOMEDIR/$user/conf/web/$domain/ssl/$domain.key" "$BUNKW_DIR/"
|
||||||
|
cp -f "$HOMEDIR/$user/conf/web/$domain/ssl/$domain.pem" "$BUNKW_DIR/"
|
||||||
|
if [ -e "$HOMEDIR/$user/conf/web/$domain/ssl/$domain.ca" ]; then
|
||||||
|
cp -f "$HOMEDIR/$user/conf/web/$domain/ssl/$domain.ca" "$BUNKW_DIR/"
|
||||||
|
fi
|
||||||
|
chown root:nginx "$BUNKW_DIR"/*
|
||||||
|
chmod 0640 "$BUNKW_DIR"/*
|
||||||
|
$BIN/v-ext-modules-run bunkerweb_module addssl "$domain" "$BUNKW_DIR/$domain.pem" "$BUNKW_DIR/$domain.key"
|
||||||
|
fi
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
$BIN/v-log-action "$user" "Info" "Web" "SSL certificate changed (Domain: $domain)."
|
$BIN/v-log-action "$user" "Info" "Web" "SSL certificate changed (Domain: $domain)."
|
||||||
log_event "$OK" "$ARGUMENTS"
|
log_event "$OK" "$ARGUMENTS"
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ check_result $? "Proxy restart failed" > /dev/null
|
|||||||
# Execute bunkerweb_module if it's enabled
|
# Execute bunkerweb_module if it's enabled
|
||||||
module_state=$($BIN/v-ext-modules state bunkerweb_module json | jq -r '.[0].STATE')
|
module_state=$($BIN/v-ext-modules state bunkerweb_module json | jq -r '.[0].STATE')
|
||||||
if [ "$module_state" = "enabled" ]; then
|
if [ "$module_state" = "enabled" ]; then
|
||||||
|
get_domain_values 'web'
|
||||||
$BIN/v-ext-modules-run bunkerweb_module alias "$domain" "$ALIAS"
|
$BIN/v-ext-modules-run bunkerweb_module alias "$domain" "$ALIAS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ class BunkerwebWorker < Kernel::ModuleCoreWorker
|
|||||||
log_return("Domain should be specified. #{args}")
|
log_return("Domain should be specified. #{args}")
|
||||||
else
|
else
|
||||||
|
|
||||||
log("add alias to domain to bunkerweb protection")
|
log("add alias #{m_alias} to domain #{m_domain} to bunkerweb protection")
|
||||||
output = `/usr/local/hestia/bin/v-bunkerweb-module alias #{m_domain} "#{m_alias}" shell`
|
output = `/usr/local/hestia/bin/v-bunkerweb-module alias #{m_domain} "#{m_alias}" shell`
|
||||||
exit_status = $?.exitstatus
|
exit_status = $?.exitstatus
|
||||||
if exit_status != 0
|
if exit_status != 0
|
||||||
|
|||||||
Reference in New Issue
Block a user