Added passeneg manager. Part 8

This commit is contained in:
Alexey Berezhok
2024-12-23 23:42:58 +03:00
parent 645cd8386a
commit 0ecf0ee925
3 changed files with 22 additions and 40 deletions

View File

@@ -4,7 +4,7 @@
#
# example: v-unpdate-web-domain admin acme.com test_template
#
# This function of updating of the domain's configs.
# This function of updating of the domain's configs and set template or notemplate if just update of configs
#----------------------------------------------------------#
# Variables & Functions #
@@ -38,7 +38,7 @@ format_domain_idn
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'USER DOMAIN [RESTART]'
check_args '3' "$#" 'USER DOMAIN TEMPLATE [RESTART]'
is_format_valid 'user' 'domain'
is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
is_object_valid 'user' 'USER' "$user"
@@ -50,7 +50,7 @@ check_hestia_demo_mode
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
##TODO
# Parsing domain values
get_domain_values 'web'
local_ip=$(get_real_ip $IP)
@@ -60,37 +60,7 @@ prepare_web_domain_values
if [ "$template" != "notemplate" ]; then
update_object_value 'web' 'DOMAIN' "$domain" '$PROXY' "$template"
fi
echo "TPL=$TPL"
echo "PROXY=$PROXY.tpl"
echo "USER_DATA=$USER_DATA"
exit 0
# Rebuilding vhost
del_web_config "$WEB_SYSTEM" "$TPL.tpl"
add_web_config "$WEB_SYSTEM" "$TPL.tpl"
if [ "$SSL" = 'yes' ]; then
del_web_config "$WEB_SYSTEM" "$TPL.stpl"
add_web_config "$WEB_SYSTEM" "$TPL.stpl"
fi
# Rebuilding proxy configuration
if [ -n "$PROXY_SYSTEM" ] && [ -n "$PROXY" ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
add_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
if [ "$SSL" = 'yes' ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
add_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
fi
fi
# Rebuilding backend configuration
if [ -n "$WEB_BACKEND" ]; then
prepare_web_backend "$BACKEND"
delete_web_backend
template=$(get_object_value 'web' 'DOMAIN' "$domain" '$BACKEND')
$BIN/v-add-web-domain-backend $user $domain $template $restart
$BIN/v-log-action "system" "Info" "Web" "Set new template=$template for $PROXY (User: $user, Domain: $domain)."
fi
#----------------------------------------------------------#