Added fixes for rpm based system usage
This commit is contained in:
@@ -128,9 +128,12 @@ TIME='$time'
|
||||
DATE='$date'" > $HESTIA/data/ips/$ip
|
||||
chmod 660 $HESTIA/data/ips/$ip
|
||||
|
||||
confd=$(get_conf_d_name "$WEB_SYSTEM")
|
||||
pconfd=$(get_conf_d_name "$PROXY_SYSTEM")
|
||||
|
||||
# WEB support
|
||||
if [ -n "$WEB_SYSTEM" ]; then
|
||||
web_conf="/etc/$WEB_SYSTEM/conf.d/$ip.conf"
|
||||
web_conf="/etc/$WEB_SYSTEM/$confd/$ip.conf"
|
||||
rm -f "$web_conf"
|
||||
|
||||
if [ "$WEB_SYSTEM" = 'httpd' ] || [ "$WEB_SYSTEM" = 'apache2' ]; then
|
||||
@@ -164,12 +167,12 @@ if [ -n "$PROXY_SYSTEM" ]; then
|
||||
-e "s/%web_port%/$WEB_PORT/g" \
|
||||
-e "s/%proxy_port%/$PROXY_PORT/g" \
|
||||
-e "s/%proxy_ssl_port%/$PROXY_SSL_PORT/g" \
|
||||
> /etc/$PROXY_SYSTEM/conf.d/$ip.conf
|
||||
> /etc/$PROXY_SYSTEM/$pconfd/$ip.conf
|
||||
|
||||
process_http2_directive "/etc/$PROXY_SYSTEM/conf.d/$ip.conf"
|
||||
process_http2_directive "/etc/$PROXY_SYSTEM/$pconfd/$ip.conf"
|
||||
|
||||
# mod_extract_forwarded
|
||||
fw_conf="/etc/$WEB_SYSTEM/conf.d/mod_extract_forwarded.conf"
|
||||
fw_conf="/etc/$WEB_SYSTEM/$confd/mod_extract_forwarded.conf"
|
||||
if [ -e "$fw_conf" ]; then
|
||||
ips=$(grep 'MEFaccept ' "$fw_conf" | grep -v '#' | head -n1)
|
||||
sed -i "s/$ips/$ips $ip/g" "$fw_conf"
|
||||
|
||||
@@ -38,9 +38,10 @@ check_hestia_demo_mode
|
||||
|
||||
if [ "$status" = "enable" ]; then
|
||||
if [ ! -f "$HESTIA/web/api/index.php" ]; then
|
||||
wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/$RELEASE_BRANCH/web/api/index.php -O $HESTIA/web/api/index.php
|
||||
# Avoid useng RELEASE_BRANCH
|
||||
wget -q https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/web/api/index.php -O $HESTIA/web/api/index.php
|
||||
if [ ! -s "$HESTIA/web/api/index.php" ]; then
|
||||
wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/api/index.php -O $HESTIA/web/api/index.php
|
||||
wget -q https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/web/api/index.php -O $HESTIA/web/api/index.php
|
||||
if [ ! -s "$HESTIA/web/api/index.php" ]; then
|
||||
# Throw error message to user
|
||||
echo "ERROR: API installation failed."
|
||||
|
||||
@@ -59,6 +59,15 @@ if [ "$type" = "pma" ] || [ "$type" = "PMA" ] || [ "$type" = "phpmyadmin" ]; the
|
||||
$BIN/v-restart-service apache2
|
||||
fi
|
||||
|
||||
if [ -e "/etc/httpd/conf.h.d/phpmyadmin.inc" ]; then
|
||||
rm -f /etc/httpd/conf.h.d/phpmyadmin.inc
|
||||
cp -f $HESTIA_INSTALL_DIR/pma/apache.conf /etc/httpd/conf.h.d/phpmyadmin.inc
|
||||
sed -i "s|%pma_alias%|$alias|g" /etc/httpd/conf.h.d/phpmyadmin.inc
|
||||
|
||||
# Restart services
|
||||
$BIN/v-restart-service httpd
|
||||
fi
|
||||
|
||||
if [ -e "/etc/nginx/conf.d/phpmyadmin.inc" ]; then
|
||||
rm -f /etc/nginx/conf.d/phpmyadmin.inc
|
||||
cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/phpmyadmin.inc
|
||||
@@ -87,6 +96,15 @@ if [ "$type" = "pga" ] || [ "$type" = "PGA" ] || [ "$type" = "phppgadmin" ]; the
|
||||
$BIN/v-restart-service apache2
|
||||
fi
|
||||
|
||||
if [ -e "/etc/httpd/conf.h.d/phpmyadmin.inc" ]; then
|
||||
rm -f /etc/httpd/conf.h.d/phpmyadmin.inc
|
||||
cp -f $HESTIA_INSTALL_DIR/pga/phppgadmin.conf /etc/httpd/conf.h.d/phppgadmin.inc
|
||||
sed -i "s|%pga_alias%|$alias|g" /etc/httpd/conf.h.d/phppgadmin.inc
|
||||
|
||||
# Restart services
|
||||
$BIN/v-restart-service httpd
|
||||
fi
|
||||
|
||||
if [ -e "/etc/nginx/conf.d/phppgadmin.inc" ]; then
|
||||
rm -f /etc/nginx/conf.d/phppgadmin.inc
|
||||
cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/phppgadmin.inc
|
||||
|
||||
@@ -49,7 +49,7 @@ if [ -z "$branch" ]; then
|
||||
else
|
||||
# Check that requested branch exists
|
||||
echo "Checking for existence of $branch branch..."
|
||||
branch_check=$(curl -s --head -w %{http_code} "https://raw.githubusercontent.com/hestiacp/hestiacp/$branch/src/deb/hestia/control" -o /dev/null)
|
||||
branch_check=$(curl -s --head -w %{http_code} "https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/src/rpm/hestia/control" -o /dev/null)
|
||||
if [ "$branch_check" -ne "200" ]; then
|
||||
echo "Error: invalid branch name specified."
|
||||
exit 1
|
||||
|
||||
@@ -55,6 +55,10 @@ if [ -d /etc/apache2/ ]; then
|
||||
sed -i "s/IncludeOptional conf.d\/domains\/$WEBMAIL_ALIAS.*.conf/IncludeOptional conf.d\/domains\/$NEW_ALIAS.*.conf/g" /etc/apache2/apache2.conf
|
||||
fi
|
||||
|
||||
if [ -d /etc/httpd/ ]; then
|
||||
sed -i "s/IncludeOptional conf.h.d\/domains\/$WEBMAIL_ALIAS.*.conf/IncludeOptional conf.h.d\/domains\/$NEW_ALIAS.*.conf/g" /etc/httpd/conf/htpd.conf
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Hestia #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
@@ -99,14 +99,16 @@ if [ "$SSL" = 'yes' ]; then
|
||||
del_web_config "$WEB_SYSTEM" "$TPL.stpl"
|
||||
fi
|
||||
|
||||
pconfd=$(get_conf_d_name "$PROXY_SYSTEM")
|
||||
|
||||
# Deleting proxy
|
||||
if [ -n "$PROXY_SYSTEM" ]; then
|
||||
del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
|
||||
if [ "$SSL" = 'yes' ]; then
|
||||
del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
|
||||
fi
|
||||
if [ -e "/etc/$PROXY_SYSTEM/conf.d/01_caching_pool.conf" ]; then
|
||||
sed -i "/=$domain:/d" /etc/$PROXY_SYSTEM/conf.d/01_caching_pool.conf
|
||||
if [ -e "/etc/$PROXY_SYSTEM/$pconfd/01_caching_pool.conf" ]; then
|
||||
sed -i "/=$domain:/d" /etc/$PROXY_SYSTEM/$pconfd/01_caching_pool.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -93,17 +93,20 @@ fi
|
||||
# Deleting Hestia IP
|
||||
rm -f $HESTIA/data/ips/$ip
|
||||
|
||||
confd=$(get_conf_d_name "$WEB_SYSTEM")
|
||||
pconfd=$(get_conf_d_name "$PROXY_SYSTEM")
|
||||
|
||||
# Deleting web config
|
||||
if [ -n "$WEB_SYSTEM" ]; then
|
||||
rm -f /etc/$WEB_SYSTEM/conf.d/$ip.conf
|
||||
rm -f /etc/$WEB_SYSTEM/$confd/$ip.conf
|
||||
fi
|
||||
|
||||
# Deleting proxy config
|
||||
if [ -n "$PROXY_SYSTEM" ]; then
|
||||
rm -f /etc/$PROXY_SYSTEM/conf.d/$ip.conf
|
||||
rm -f /etc/$PROXY_SYSTEM/$pconfd/$ip.conf
|
||||
|
||||
# mod_extract_forwarded
|
||||
fw_conf="/etc/$WEB_SYSTEM/conf.d/mod_extract_forwarded.conf"
|
||||
fw_conf="/etc/$WEB_SYSTEM/$pconfd/mod_extract_forwarded.conf"
|
||||
if [ -e "$fw_conf" ]; then
|
||||
ips="$(grep 'MEFaccept 127.0.0.1' "$fw_conf")"
|
||||
new_ips="$(echo "$ips" | sed "s/$ip//")"
|
||||
|
||||
@@ -88,14 +88,16 @@ fi
|
||||
# Deleting domain from web.conf
|
||||
sed -i "/DOMAIN='$domain'/ d" "$USER_DATA/web.conf"
|
||||
|
||||
pconfd=$(get_conf_d_name "$PROXY_SYSTEM")
|
||||
|
||||
# Deleting proxy
|
||||
if [ -n "$PROXY_SYSTEM" ]; then
|
||||
del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
|
||||
if [ "$SSL" = 'yes' ]; then
|
||||
del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
|
||||
fi
|
||||
if [ -e "/etc/$PROXY_SYSTEM/conf.d/01_caching_pool.conf" ]; then
|
||||
sed -i "/=$domain:/d" "/etc/$PROXY_SYSTEM/conf.d/01_caching_pool.conf"
|
||||
if [ -e "/etc/$PROXY_SYSTEM/$pconfd/01_caching_pool.conf" ]; then
|
||||
sed -i "/=$domain:/d" "/etc/$PROXY_SYSTEM/$pconfd/01_caching_pool.conf"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -52,34 +52,37 @@ check_hestia_demo_mode
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
confd=$(get_conf_d_name "$WEB_SYSTEM")
|
||||
|
||||
# Deleting old web configs
|
||||
if [ -e "/etc/$WEB_SYSTEM/conf.d/hestia.conf" ]; then
|
||||
sed -i "/.*\/$user\/conf\/web\//d" /etc/$WEB_SYSTEM/conf.d/hestia.conf
|
||||
if [ -e "/etc/$WEB_SYSTEM/$confd/hestia.conf" ]; then
|
||||
sed -i "/.*\/$user\/conf\/web\//d" /etc/$WEB_SYSTEM/$confd/hestia.conf
|
||||
fi
|
||||
|
||||
if [ -e "$HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.conf" ]; then
|
||||
rm -f $HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.conf
|
||||
rm -f /etc/$WEB_SYSTEM/conf.d/domains/$domain.conf
|
||||
rm -f /etc/$WEB_SYSTEM/$confd/domains/$domain.conf
|
||||
fi
|
||||
if [ -e "$HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.ssl.conf" ]; then
|
||||
rm $HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.ssl.conf
|
||||
rm -f /etc/$WEB_SYSTEM/conf.d/domains/$domain.ssl.conf
|
||||
rm -f /etc/$WEB_SYSTEM/$confd/domains/$domain.ssl.conf
|
||||
fi
|
||||
|
||||
pconfd=$(get_conf_d_name "$PROXY_SYSTEM")
|
||||
# Deleting old proxy configs
|
||||
if [ -n "$PROXY_SYSTEM" ]; then
|
||||
if [ -e "/etc/$PROXY_SYSTEM/conf.d/hestia.conf" ]; then
|
||||
sed -i "/.*\/$user\/conf\/web\//d" /etc/$PROXY_SYSTEM/conf.d/hestia.conf
|
||||
if [ -e "/etc/$PROXY_SYSTEM/$pconfd/hestia.conf" ]; then
|
||||
sed -i "/.*\/$user\/conf\/web\//d" /etc/$PROXY_SYSTEM/$pconfd/hestia.conf
|
||||
fi
|
||||
|
||||
if [ -e "$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.conf" ]; then
|
||||
rm -f $HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.conf
|
||||
rm -f /etc/$PROXY_SYSTEM/conf.d/domains/$domain.conf
|
||||
rm -f /etc/$PROXY_SYSTEM/$pconfd/domains/$domain.conf
|
||||
fi
|
||||
|
||||
if [ -e "$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.ssl.conf" ]; then
|
||||
rm -f $HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.ssl.conf
|
||||
rm -f /etc/$PROXY_SYSTEM/conf.d/domains/$domain.ssl.conf
|
||||
rm -f /etc/$PROXY_SYSTEM/$pconfd/domains/$domain.ssl.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -49,35 +49,37 @@ check_hestia_demo_mode
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
confd=$(get_conf_d_name "$WEB_SYSTEM")
|
||||
pconfd=$(get_conf_d_name "$PROXY_SYSTEM")
|
||||
|
||||
# Deleting old web configs
|
||||
if [ -e "/etc/$WEB_SYSTEM/conf.d/hestia.conf" ]; then
|
||||
sed -i "/.*\/$user\/conf\/web\//d" /etc/$WEB_SYSTEM/conf.d/hestia.conf
|
||||
if [ -e "/etc/$WEB_SYSTEM/$confd/hestia.conf" ]; then
|
||||
sed -i "/.*\/$user\/conf\/web\//d" /etc/$WEB_SYSTEM/$confd/hestia.conf
|
||||
fi
|
||||
|
||||
if [ -e "$HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.conf" ]; then
|
||||
rm -f $HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.conf
|
||||
rm -f /etc/$WEB_SYSTEM/conf.d/domains/$domain.conf
|
||||
rm -f /etc/$WEB_SYSTEM/$confd/domains/$domain.conf
|
||||
fi
|
||||
if [ -e "$HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.ssl.conf" ]; then
|
||||
rm $HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.ssl.conf
|
||||
rm -f /etc/$WEB_SYSTEM/conf.d/domains/$domain.ssl.conf
|
||||
rm -f /etc/$WEB_SYSTEM/$confd/domains/$domain.ssl.conf
|
||||
fi
|
||||
|
||||
# Deleting old proxy configs
|
||||
if [ -n "$PROXY_SYSTEM" ]; then
|
||||
if [ -e "/etc/$PROXY_SYSTEM/conf.d/hestia.conf" ]; then
|
||||
sed -i "/.*\/$user\/conf\/web\//d" /etc/$PROXY_SYSTEM/conf.d/hestia.conf
|
||||
if [ -e "/etc/$PROXY_SYSTEM/$pconfd/hestia.conf" ]; then
|
||||
sed -i "/.*\/$user\/conf\/web\//d" /etc/$PROXY_SYSTEM/$pconfd/hestia.conf
|
||||
fi
|
||||
|
||||
if [ -e "$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.conf" ]; then
|
||||
rm -f $HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.conf
|
||||
rm -f /etc/$PROXY_SYSTEM/conf.d/domains/$domain.conf
|
||||
rm -f /etc/$PROXY_SYSTEM/$pconfd/domains/$domain.conf
|
||||
fi
|
||||
|
||||
if [ -e "$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.ssl.conf" ]; then
|
||||
rm -f $HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.ssl.conf
|
||||
rm -f /etc/$PROXY_SYSTEM/conf.d/domains/$domain.ssl.conf
|
||||
rm -f /etc/$PROXY_SYSTEM/$pconfd/domains/$domain.ssl.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -36,6 +36,9 @@ check_hestia_demo_mode
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
confd=$(get_conf_d_name "$WEB_SYSTEM")
|
||||
pconfd=$(get_conf_d_name "$PROXY_SYSTEM")
|
||||
|
||||
# Listing system IP addresses
|
||||
nics="$(ip -d -j link show | jq -r '.[] | if .link_type == "loopback" then empty else .ifname end')"
|
||||
|
||||
@@ -83,7 +86,7 @@ if [ -n "$old_ip" ]; then
|
||||
|
||||
# Updating PROXY
|
||||
if [ -n "$PROXY_SYSTEM" ]; then
|
||||
cd /etc/$PROXY_SYSTEM/conf.d
|
||||
cd /etc/$PROXY_SYSTEM/$pconfd
|
||||
if [ -e "$old_ip.conf" ]; then
|
||||
mv $old_ip.conf $new_ip.conf
|
||||
sed -i "s/$old_ip/$new_ip/g" $new_ip.conf
|
||||
@@ -92,7 +95,7 @@ if [ -n "$old_ip" ]; then
|
||||
|
||||
# Updating WEB
|
||||
if [ -n "$WEB_SYSTEM" ]; then
|
||||
cd /etc/$WEB_SYSTEM/conf.d
|
||||
cd /etc/$WEB_SYSTEM/$confd
|
||||
|
||||
if [ -e "$old_ip.conf" ]; then
|
||||
mv $old_ip.conf $new_ip.conf
|
||||
|
||||
@@ -30,31 +30,31 @@ source_conf "$HESTIA/conf/hestia.conf"
|
||||
if [ -f "$HESTIA/web/images/custom/logo.svg" ]; then
|
||||
cp -f $HESTIA/web/images/custom/logo.svg $HESTIA/web/images/logo.svg
|
||||
elif [ ! -f "$HESTIA/web/images/custom/logo.svg" ] && [ "$download" = "yes" ]; then
|
||||
download_file https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/images/logo.svg $HESTIA/web/images/logo.svg
|
||||
download_file https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/web/images/logo.svg $HESTIA/web/images/logo.svg
|
||||
fi
|
||||
|
||||
if [ -f "$HESTIA/web/images/custom/logo.png" ]; then
|
||||
cp -f $HESTIA/web/images/custom/logo.png $HESTIA/web/images/logo.png
|
||||
elif [ ! -f "$HESTIA/web/images/custom/logo.png" ] && [ "$download" = "yes" ]; then
|
||||
download_file https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/images/logo.png $HESTIA/web/images/logo.png
|
||||
download_file https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/web/images/logo.png $HESTIA/web/images/logo.png
|
||||
fi
|
||||
|
||||
if [ -f "$HESTIA/web/images/custom/logo-header.svg" ]; then
|
||||
cp -f $HESTIA/web/images/custom/logo-header.svg $HESTIA/web/images/logo-header.svg
|
||||
elif [ ! -f "$HESTIA/web/images/custom/logo-header.svg" ] && [ "$download" = "yes" ]; then
|
||||
download_file https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/images/logo-header.svg $HESTIA/web/images/logo-header.svg
|
||||
download_file https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/web/images/logo-header.svg $HESTIA/web/images/logo-header.svg
|
||||
fi
|
||||
|
||||
if [ -f "$HESTIA/web/images/custom/favicon.png" ]; then
|
||||
cp -f $HESTIA/web/images/custom/favicon.png $HESTIA/web/images/favicon.png
|
||||
elif [ ! -f "$HESTIA/web/images/custom/favicon.png" ] && [ "$download" = "yes" ]; then
|
||||
download_file https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/images/favicon.png $HESTIA/web/images/favicon.png
|
||||
download_file https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/web/images/favicon.png $HESTIA/web/images/favicon.png
|
||||
fi
|
||||
|
||||
if [ -f "$HESTIA/web/images/custom/favicon.ico" ]; then
|
||||
cp -f $HESTIA/web/images/custom/favicon.ico $HESTIA/web/favicon.ico
|
||||
elif [ ! -f "$HESTIA/web/images/custom/favicon.ico" ] && [ "$download" = "yes" ]; then
|
||||
download_file https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/favicon.ico $HESTIA/web/favicon.ico
|
||||
download_file https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/web/favicon.ico $HESTIA/web/favicon.ico
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------#
|
||||
|
||||
Reference in New Issue
Block a user