From 8bcf0d1d0123bb63870de6cd1ff81e5d491ce022 Mon Sep 17 00:00:00 2001 From: Alexey Berezhok Date: Sun, 14 Apr 2024 22:48:16 +0300 Subject: [PATCH] Added fixes for rpm based system usage --- README.md | 2 +- bin/v-add-sys-ip | 11 ++- bin/v-change-sys-api | 5 +- bin/v-change-sys-db-alias | 18 ++++ bin/v-change-sys-release | 2 +- bin/v-change-sys-webmail | 4 + bin/v-change-web-domain-name | 6 +- bin/v-delete-sys-ip | 9 +- bin/v-delete-web-domain | 6 +- bin/v-rebuild-web-domain | 19 ++-- bin/v-rebuild-web-domains | 18 ++-- bin/v-update-sys-ip | 7 +- bin/v-update-white-label-logo | 10 +-- .../theme/components/InstallOptions.vue | 2 +- docs/docs/introduction/getting-started.md | 2 +- docs/docs/server-administration/databases.md | 15 ++++ func/domain.sh | 90 ++++++++++++++----- func/main.sh | 11 ++- func/rebuild.sh | 27 ++++-- install/hst-install-rhel.sh | 14 +-- install/hst-install-ubuntu.sh | 4 +- install/rpm/httpd/hestia.conf | 2 +- install/rpm/httpd/httpd.conf | 6 +- install/rpm/templates/web/httpd/default.stpl | 2 +- install/rpm/templates/web/httpd/default.tpl | 2 +- install/rpm/templates/web/httpd/hosting.stpl | 2 +- install/rpm/templates/web/httpd/hosting.tpl | 2 +- .../templates/web/httpd/php-fpm/default.stpl | 2 +- .../templates/web/httpd/php-fpm/default.tpl | 2 +- install/rpm/templates/web/httpd/phpcgi.stpl | 2 +- install/rpm/templates/web/httpd/phpcgi.tpl | 2 +- install/rpm/templates/web/httpd/phpfcgid.stpl | 2 +- install/rpm/templates/web/httpd/phpfcgid.tpl | 2 +- install/rpm/templates/web/httpd/www-data.stpl | 2 +- install/rpm/templates/web/httpd/www-data.tpl | 2 +- install/upgrade/manual/migrate_phpmyadmin.sh | 6 ++ install/upgrade/versions/1.0.2.sh | 4 + install/upgrade/versions/1.00.0-190618.sh | 15 +++- install/upgrade/versions/1.1.0.sh | 21 ++++- install/upgrade/versions/1.5.0.sh | 8 ++ install/upgrade/versions/1.7.1.sh | 7 ++ src/hst_bootstrap_install.sh | 6 +- src/lxd_compile.sh | 2 +- src/rpm/hestia/control | 14 +++ test/make-test-containers.php | 4 +- test/test.bats | 66 ++++++++++++-- 46 files changed, 350 insertions(+), 117 deletions(-) create mode 100644 src/rpm/hestia/control diff --git a/README.md b/README.md index 7b4585a..3cfe850 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ ssh root@your.server Download the installation script for the latest release: ```bash -wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh +wget https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh ``` If the download fails due to an SSL validation error, please be sure you've installed the ca-certificate package on your system - you can do this with the following command: diff --git a/bin/v-add-sys-ip b/bin/v-add-sys-ip index 9711b1d..4eecbb1 100755 --- a/bin/v-add-sys-ip +++ b/bin/v-add-sys-ip @@ -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" diff --git a/bin/v-change-sys-api b/bin/v-change-sys-api index fdd53fb..92da649 100755 --- a/bin/v-change-sys-api +++ b/bin/v-change-sys-api @@ -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." diff --git a/bin/v-change-sys-db-alias b/bin/v-change-sys-db-alias index 816db87..c76be8d 100755 --- a/bin/v-change-sys-db-alias +++ b/bin/v-change-sys-db-alias @@ -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 diff --git a/bin/v-change-sys-release b/bin/v-change-sys-release index b2ea28c..aae514d 100755 --- a/bin/v-change-sys-release +++ b/bin/v-change-sys-release @@ -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 diff --git a/bin/v-change-sys-webmail b/bin/v-change-sys-webmail index 1a1cd92..8b3be4e 100755 --- a/bin/v-change-sys-webmail +++ b/bin/v-change-sys-webmail @@ -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 # #----------------------------------------------------------# diff --git a/bin/v-change-web-domain-name b/bin/v-change-web-domain-name index dee80ff..291e090 100755 --- a/bin/v-change-web-domain-name +++ b/bin/v-change-web-domain-name @@ -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 diff --git a/bin/v-delete-sys-ip b/bin/v-delete-sys-ip index 76e602f..1ac77e2 100755 --- a/bin/v-delete-sys-ip +++ b/bin/v-delete-sys-ip @@ -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//")" diff --git a/bin/v-delete-web-domain b/bin/v-delete-web-domain index 90deaeb..de7cbac 100755 --- a/bin/v-delete-web-domain +++ b/bin/v-delete-web-domain @@ -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 diff --git a/bin/v-rebuild-web-domain b/bin/v-rebuild-web-domain index ece7488..3d6266f 100755 --- a/bin/v-rebuild-web-domain +++ b/bin/v-rebuild-web-domain @@ -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 diff --git a/bin/v-rebuild-web-domains b/bin/v-rebuild-web-domains index e74abd1..a55d0b3 100755 --- a/bin/v-rebuild-web-domains +++ b/bin/v-rebuild-web-domains @@ -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 diff --git a/bin/v-update-sys-ip b/bin/v-update-sys-ip index 1d3720c..6d39ce2 100755 --- a/bin/v-update-sys-ip +++ b/bin/v-update-sys-ip @@ -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 diff --git a/bin/v-update-white-label-logo b/bin/v-update-white-label-logo index 4cfade4..d6aaa26 100755 --- a/bin/v-update-white-label-logo +++ b/bin/v-update-white-label-logo @@ -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 #----------------------------------------------------------# diff --git a/docs/.vitepress/theme/components/InstallOptions.vue b/docs/.vitepress/theme/components/InstallOptions.vue index 82575ba..07657ad 100644 --- a/docs/.vitepress/theme/components/InstallOptions.vue +++ b/docs/.vitepress/theme/components/InstallOptions.vue @@ -13,7 +13,7 @@ export default { return { pageloader: false, hestia_wget: - "wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh", + "wget https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh", hestia_install: "sudo bash hst-install.sh", installStr: "", }; diff --git a/docs/docs/introduction/getting-started.md b/docs/docs/introduction/getting-started.md index b4ec9ea..343169a 100644 --- a/docs/docs/introduction/getting-started.md +++ b/docs/docs/introduction/getting-started.md @@ -43,7 +43,7 @@ Interactive installer that will install the default Hestia software configuratio Download the installation script for the latest release: ```bash -wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh +wget https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh ``` If the download fails due to an SSL validation error, please be sure you've installed the ca-certificate package on your system - you can do this with the following command: diff --git a/docs/docs/server-administration/databases.md b/docs/docs/server-administration/databases.md index f997bad..1b23bcd 100644 --- a/docs/docs/server-administration/databases.md +++ b/docs/docs/server-administration/databases.md @@ -36,6 +36,21 @@ systemctl restart apache2 IncludeOptional /etc/apache2/conf.d/*.inc ``` +### For httpd + +```bash +nano /etc/httpd/conf.h.d/ip.conf + +# Add the following code before both closing tags +IncludeOptional /etc/httpd/conf.h.d/*.inc + +# Restart apache2 +systemctl restart httpd + +# You can also add the following in /etc/apache2.conf instead +IncludeOptional /etc/httpd/conf.h.d/*.inc +``` + ### For Nginx ```bash diff --git a/func/domain.sh b/func/domain.sh index e92b671..ddc0926 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -249,6 +249,12 @@ prepare_web_domain_values() { # Add web config add_web_config() { # Check if folder already exists + if [ "$1" = "httpd" ]; then + confd="conf.h.d" + else + confd="conf.d" + fi + if [ ! -d "$HOMEDIR/$user/conf/web/$domain" ]; then mkdir -p "$HOMEDIR/$user/conf/web/$domain/" fi @@ -309,8 +315,8 @@ add_web_config() { chmod 640 $conf if [[ "$2" =~ stpl$ ]]; then - rm -f /etc/$1/conf.d/domains/$domain.ssl.conf - ln -s $conf /etc/$1/conf.d/domains/$domain.ssl.conf + rm -f /etc/$1/$confd/domains/$domain.ssl.conf + ln -s $conf /etc/$1/$confd/domains/$domain.ssl.conf # Rename/Move extra SSL config files find=$(find $HOMEDIR/$user/conf/web/*.$domain.org* 2> /dev/null) @@ -326,8 +332,8 @@ add_web_config() { fi done else - rm -f /etc/$1/conf.d/domains/$domain.conf - ln -s $conf /etc/$1/conf.d/domains/$domain.conf + rm -f /etc/$1/$confd/domains/$domain.conf + ln -s $conf /etc/$1/$confd/domains/$domain.conf # Rename/Move extra config files find=$(find $HOMEDIR/$user/conf/web/*.$domain.org* 2> /dev/null) for f in $find; do @@ -394,6 +400,11 @@ replace_web_config() { # Delete web configuration del_web_config() { + if [ "$1" = "httpd" ]; then + confd="conf.h.d" + else + confd="conf.d" + fi conf="$HOMEDIR/$user/conf/web/$domain/$1.conf" local confname="$domain.conf" if [[ "$2" =~ stpl$ ]]; then @@ -410,17 +421,17 @@ del_web_config() { rm -f $legacyconf # Remove old global includes file - rm -f /etc/$1/conf.d/hestia.conf + rm -f /etc/$1/$confd/hestia.conf fi # Remove domain configuration files and clean up symbolic links rm -f "$conf" if [ -n "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" = "$1" ]; then - rm -f "/etc/$WEB_SYSTEM/conf.d/domains/$confname" + rm -f "/etc/$WEB_SYSTEM/$confd/domains/$confname" fi if [ -n "$PROXY_SYSTEM" ] && [ "$PROXY_SYSTEM" = "$1" ]; then - rm -f "/etc/$PROXY_SYSTEM/conf.d/domains/$confname" + rm -f "/etc/$PROXY_SYSTEM/$confd/domains/$confname" fi } @@ -787,6 +798,16 @@ add_mail_ssl_config() { # Delete SSL support for mail domain del_mail_ssl_config() { + if [ "$WEB_SYSTEM" = "httpd" ]; then + confd="conf.h.d" + else + confd="conf.d" + fi + if [ "$PROXY_SYSTEM" = "httpd" ]; then + pconfd="conf.h.d" + else + pconfd="conf.d" + fi # Check to prevent accidental removal of mismatched certificate wildcard_domain="\\*.$(echo "$domain" | cut -f 1 -d . --complement)" mail_cert_match=$($BIN/v-list-mail-domain-ssl $user $domain | awk '/SUBJECT|ALIASES/' | grep -wE " $domain| $wildcard_domain") @@ -799,8 +820,8 @@ del_mail_ssl_config() { # Remove SSL vhost configuration rm -f $HOMEDIR/$user/conf/mail/$domain/*.*ssl.conf - rm -f /etc/$WEB_SYSTEM/conf.d/domains/$WEBMAIL_ALIAS.$domain.ssl.conf - rm -f /etc/$PROXY_SYSTEM/conf.d/domains/$WEBMAIL_ALIAS.$domain.ssl.conf + rm -f /etc/$WEB_SYSTEM/$confd/domains/$WEBMAIL_ALIAS.$domain.ssl.conf + rm -f /etc/$PROXY_SYSTEM/$pconfd/domains/$WEBMAIL_ALIAS.$domain.ssl.conf # Remove SSL certificates rm -f $HOMEDIR/$user/conf/mail/$domain/ssl/* @@ -821,6 +842,11 @@ del_mail_ssl_certificates() { # Add webmail config add_webmail_config() { + if [ "$1" = "httpd" ]; then + confd="conf.h.d" + else + confd="conf.d" + fi mkdir -p "$HOMEDIR/$user/conf/mail/$domain" conf="$HOMEDIR/$user/conf/mail/$domain/$1.conf" if [[ "$2" =~ stpl$ ]]; then @@ -883,13 +909,13 @@ add_webmail_config() { if [[ "$2" =~ stpl$ ]]; then if [ -n "$WEB_SYSTEM" ]; then forcessl="$HOMEDIR/$user/conf/mail/$domain/$WEB_SYSTEM.forcessl.conf" - rm -f /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.ssl.conf - ln -s $conf /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.ssl.conf + rm -f /etc/$1/$confd/domains/$WEBMAIL_ALIAS.$domain.ssl.conf + ln -s $conf /etc/$1/$confd/domains/$WEBMAIL_ALIAS.$domain.ssl.conf fi if [ -n "$PROXY_SYSTEM" ]; then forcessl="$HOMEDIR/$user/conf/mail/$domain/$PROXY_SYSTEM.forcessl.conf" - rm -f /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.ssl.conf - ln -s $conf /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.ssl.conf + rm -f /etc/$1/$confd/domains/$WEBMAIL_ALIAS.$domain.ssl.conf + ln -s $conf /etc/$1/$confd/domains/$WEBMAIL_ALIAS.$domain.ssl.conf fi # Add rewrite rules to force HTTPS/SSL connections @@ -904,12 +930,12 @@ add_webmail_config() { find $HOMEDIR/$user/conf/mail/ -maxdepth 1 -type f \( -name "$domain.*" -o -name "ssl.$domain.*" -o -name "*nginx.$domain.*" \) -exec rm {} \; else if [ -n "$WEB_SYSTEM" ]; then - rm -f /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.conf - ln -s $conf /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.conf + rm -f /etc/$1/$confd/domains/$WEBMAIL_ALIAS.$domain.conf + ln -s $conf /etc/$1/$confd/domains/$WEBMAIL_ALIAS.$domain.conf fi if [ -n "$PROXY_SYSTEM" ]; then - rm -f /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.conf - ln -s $conf /etc/$1/conf.d/domains/$WEBMAIL_ALIAS.$domain.conf + rm -f /etc/$1/$confd/domains/$WEBMAIL_ALIAS.$domain.conf + ln -s $conf /etc/$1/$confd/domains/$WEBMAIL_ALIAS.$domain.conf fi # Clear old configurations find $HOMEDIR/$user/conf/mail/ -maxdepth 1 -type f \( -name "$domain.*" \) -exec rm {} \; @@ -918,27 +944,47 @@ add_webmail_config() { # Delete webmail support del_webmail_config() { + if [ "$WEB_SYSTEM" = "httpd" ]; then + confd="conf.h.d" + else + confd="conf.d" + fi + if [ "$PROXY_SYSTEM" = "httpd" ]; then + pconfd="conf.h.d" + else + pconfd="conf.d" + fi if [ -n "$WEB_SYSTEM" ]; then - rm -f $HOMEDIR/$user/conf/mail/$domain/$WEB_SYSTEM.conf - rm -f /etc/$WEB_SYSTEM/conf.d/domains/$WEBMAIL_ALIAS.$domain.conf + rm -f $HOMEDIR/$user/$confd/mail/$domain/$WEB_SYSTEM.conf + rm -f /etc/$WEB_SYSTEM/$confd/domains/$WEBMAIL_ALIAS.$domain.conf fi if [ -n "$PROXY_SYSTEM" ]; then rm -f $HOMEDIR/$user/conf/mail/$domain/$PROXY_SYSTEM.*conf - rm -f /etc/$PROXY_SYSTEM/conf.d/domains/$WEBMAIL_ALIAS.$domain.conf + rm -f /etc/$PROXY_SYSTEM/$pconfd/domains/$WEBMAIL_ALIAS.$domain.conf fi } # Delete SSL webmail support del_webmail_ssl_config() { + if [ "$WEB_SYSTEM" = "httpd" ]; then + confd="conf.h.d" + else + confd="conf.d" + fi + if [ "$PROXY_SYSTEM" = "httpd" ]; then + pconfd="conf.h.d" + else + pconfd="conf.d" + fi if [ -n "$WEB_SYSTEM" ]; then rm -f $HOMEDIR/$user/conf/mail/$domain/$WEB_SYSTEM.*ssl.conf - rm -f /etc/$WEB_SYSTEM/conf.d/domains/$WEBMAIL_ALIAS.$domain.ssl.conf + rm -f /etc/$WEB_SYSTEM/$confd/domains/$WEBMAIL_ALIAS.$domain.ssl.conf fi if [ -n "$PROXY_SYSTEM" ]; then rm -f $HOMEDIR/$user/conf/mail/$domain/$PROXY_SYSTEM.*ssl.conf - rm -f /etc/$PROXY_SYSTEM/conf.d/domains/$WEBMAIL_ALIAS.$domain.ssl.conf + rm -f /etc/$PROXY_SYSTEM/$pconfd/domains/$WEBMAIL_ALIAS.$domain.ssl.conf fi } diff --git a/func/main.sh b/func/main.sh index 8c7a248..e35e5c4 100644 --- a/func/main.sh +++ b/func/main.sh @@ -28,7 +28,7 @@ MAILTPL=$HESTIA/data/templates/mail DNSTPL=$HESTIA/data/templates/dns RRD=$HESTIA/web/rrd SENDMAIL="$HESTIA/web/inc/mail-wrapper.php" -HESTIA_GIT_REPO="https://raw.githubusercontent.com/hestiacp/hestiacp" +HESTIA_GIT_REPO="https://dev.putey.net/bayrepo/hestiacp" HESTIA_THEMES="$HESTIA/web/css/themes" HESTIA_THEMES_CUSTOM="$HESTIA/web/css/themes/custom" SCRIPT="$(basename $0)" @@ -1722,3 +1722,12 @@ convert_dot_version_to_non_dot() { version="$1" echo "${version//./}" } + +# Get conf,d name according to web system +get_conf_d_name(){ + if [ "$1" = "httpd" ]; then + echo "conf.h.d" + else + echo "conf.d" + fi +} \ No newline at end of file diff --git a/func/rebuild.sh b/func/rebuild.sh index ece6961..b2c1644 100644 --- a/func/rebuild.sh +++ b/func/rebuild.sh @@ -221,13 +221,22 @@ rebuild_user_conf() { # WEB domain rebuild rebuild_web_domain_conf() { - + if [ "$WEB_SYSTEM" = "httpd" ]; then + confd="conf.h.d" + else + confd="conf.d" + fi + if [ "$PROXY_SYSTEM" = "httpd" ]; then + pconfd="conf.h.d" + else + pconfd="conf.d" + fi # Ensure that global domain folders are available - if [ ! -d /etc/$WEB_SYSTEM/conf.d/domains ]; then - mkdir -p /etc/$WEB_SYSTEM/conf.d/domains + if [ ! -d /etc/$WEB_SYSTEM/$confd/domains ]; then + mkdir -p /etc/$WEB_SYSTEM/$confd/domains fi - if [ ! -d /etc/$PROXY_SYSTEM/conf.d/domains ]; then - mkdir -p /etc/$PROXY_SYSTEM/conf.d/domains + if [ ! -d /etc/$PROXY_SYSTEM/$pconfd/domains ]; then + mkdir -p /etc/$PROXY_SYSTEM/$pconfd/domains fi syshealth_repair_web_config @@ -236,11 +245,11 @@ rebuild_web_domain_conf() { prepare_web_domain_values # Remove old web configuration files - if [ -f /etc/$WEB_SYSTEM/conf.d/$domain.conf ]; then - rm -f /etc/$WEB_SYSTEM/conf.d/$domain*.conf + if [ -f /etc/$WEB_SYSTEM/$confd/$domain.conf ]; then + rm -f /etc/$WEB_SYSTEM/$confd/$domain*.conf fi - if [ -f /etc/$PROXY_SYSTEM/conf.d/$domain.conf ]; then - rm -f /etc/$PROXY_SYSTEM/conf.d/$domain*.conf + if [ -f /etc/$PROXY_SYSTEM/$pconfd/$domain.conf ]; then + rm -f /etc/$PROXY_SYSTEM/$pconfd/$domain*.conf fi # Temporary allow write permissions to owner diff --git a/install/hst-install-rhel.sh b/install/hst-install-rhel.sh index 94f303b..06874a6 100755 --- a/install/hst-install-rhel.sh +++ b/install/hst-install-rhel.sh @@ -750,7 +750,7 @@ cp -r /etc/nginx/* $hst_backups/nginx > /dev/null 2>&1 # Backup Apache configuration systemctl stop httpd > /dev/null 2>&1 cp -r /etc/httpd/* $hst_backups/httpd > /dev/null 2>&1 -rm -f /etc/httpd/conf.d/* > /dev/null 2>&1 +rm -f /etc/httpd/conf.h.d/* > /dev/null 2>&1 # Backup PHP-FPM configuration systemctl stop php*-fpm > /dev/null 2>&1 @@ -1309,12 +1309,12 @@ check_result $? "nginx start failed" if [ "$apache" = 'yes' ]; then echo "[ * ] Configuring Apache Web Server..." - mkdir -p /etc/httpd/conf.d - mkdir -p /etc/httpd/conf.d/domains + mkdir -p /etc/httpd/conf.h.d + mkdir -p /etc/httpd/conf.h.d/domains # Copy configuration files cp -f $HESTIA_INSTALL_DIR/httpd/httpd.conf /etc/httpd/conf/ - cp -f $HESTIA_INSTALL_DIR/httpd/status.conf /etc/httpd/conf.d/hestia-status.conf + cp -f $HESTIA_INSTALL_DIR/httpd/status.conf /etc/httpd/conf.h.d/hestia-status.conf cp -f $HESTIA_INSTALL_DIR/logrotate/httpd /etc/logrotate.d/ # Enable needed modules @@ -1334,7 +1334,7 @@ if [ "$apache" = 'yes' ]; then # Disable prefork and php, enable event sed 's/LoadModule mpm_prefork_module/#LoadModule mpm_prefork_module/' -i /etc/httpd/conf.modules.d/00-mpm.conf sed 's/#LoadModule mpm_event_module/LoadModule mpm_event_module/' -i /etc/httpd/conf.modules.d/00-mpm.conf - cp -f $HESTIA_INSTALL_DIR/httpd/hestia-event.conf /etc/httpd/conf.d/ + cp -f $HESTIA_INSTALL_DIR/httpd/hestia-event.conf /etc/httpd/conf.h.d/ fi if [ ! -d /etc/httpd/sites-available ]; then @@ -1517,7 +1517,7 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then # Configuring Apache2 for PHPMYADMIN if [ "$apache" = 'yes' ]; then - touch /etc/httpd/conf.d/phpmyadmin.inc + touch /etc/httpd/conf.h.d/phpmyadmin.inc fi # Overwrite old files @@ -1580,7 +1580,7 @@ if [ "$postgresql" = 'yes' ]; then ln -s /etc/phppgadmin/config.inc.php /usr/share/phppgadmin/conf/ # Configuring phpPgAdmin if [ "$apache" = 'yes' ]; then - cp -f $HESTIA_INSTALL_DIR/pga/phppgadmin.conf /etc/httpd/conf.d/phppgadmin.inc + cp -f $HESTIA_INSTALL_DIR/pga/phppgadmin.conf /etc/httpd/conf.h.d/phppgadmin.inc fi cp -f $HESTIA_INSTALL_DIR/pga/config.inc.php /etc/phppgadmin/ diff --git a/install/hst-install-ubuntu.sh b/install/hst-install-ubuntu.sh index 7bf3722..47b4f6c 100755 --- a/install/hst-install-ubuntu.sh +++ b/install/hst-install-ubuntu.sh @@ -434,7 +434,7 @@ fi # Validate whether installation script matches release version before continuing with install if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then - release_branch_ver=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/release/src/deb/hestia/control | grep "Version:" | awk '{print $2}') + release_branch_ver=$(curl -s https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/src/deb/hestia/control | grep "Version:" | awk '{print $2}') if [ "$HESTIA_INSTALL_VER" != "$release_branch_ver" ]; then echo echo -e "\e[91mInstallation aborted\e[0m" @@ -442,7 +442,7 @@ if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then echo -e "\e[33mERROR: Install script version does not match package version!\e[0m" echo -e "\e[33mPlease download the installer from the release branch in order to continue:\e[0m" echo "" - echo -e "\e[33mhttps://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh\e[0m" + echo -e "\e[33mhttps://dev.putey.net/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh\e[0m" echo "" echo -e "\e[33mTo test pre-release versions, build the .deb packages and re-run the installer:\e[0m" echo -e " \e[33m./hst_autocompile.sh \e[1m--hestia branchname no\e[21m\e[0m" diff --git a/install/rpm/httpd/hestia.conf b/install/rpm/httpd/hestia.conf index fc68cfb..fa13846 100644 --- a/install/rpm/httpd/hestia.conf +++ b/install/rpm/httpd/hestia.conf @@ -55,4 +55,4 @@ EnableSendfile on LogFormat "%a %l %u %t \"%r\" %>s %b" common -IncludeOptional conf.d/*.conf +IncludeOptional conf.h.d/*.conf diff --git a/install/rpm/httpd/httpd.conf b/install/rpm/httpd/httpd.conf index cd4d7d8..99f99ac 100644 --- a/install/rpm/httpd/httpd.conf +++ b/install/rpm/httpd/httpd.conf @@ -67,9 +67,9 @@ LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent LogFormat "%b" bytes -Include conf.d/*.conf -IncludeOptional conf.d/domains/webmail.*.conf -IncludeOptional conf.d/domains/*.conf +Include conf.h.d/*.conf +IncludeOptional conf.h.d/domains/webmail.*.conf +IncludeOptional conf.h.d/domains/*.conf ErrorDocument 403 /error/403.html ErrorDocument 404 /error/404.html diff --git a/install/rpm/templates/web/httpd/default.stpl b/install/rpm/templates/web/httpd/default.stpl index 27a0773..3cdde66 100644 --- a/install/rpm/templates/web/httpd/default.stpl +++ b/install/rpm/templates/web/httpd/default.stpl @@ -45,5 +45,5 @@ IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_* - IncludeOptional /etc/httpd/conf.d/*.inc + IncludeOptional /etc/httpd/conf.h.d/*.inc diff --git a/install/rpm/templates/web/httpd/default.tpl b/install/rpm/templates/web/httpd/default.tpl index 7b57e51..8445cb3 100644 --- a/install/rpm/templates/web/httpd/default.tpl +++ b/install/rpm/templates/web/httpd/default.tpl @@ -42,5 +42,5 @@ IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_* - IncludeOptional /etc/httpd/conf.d/*.inc + IncludeOptional /etc/httpd/conf.h.d/*.inc diff --git a/install/rpm/templates/web/httpd/hosting.stpl b/install/rpm/templates/web/httpd/hosting.stpl index a02ae26..0155350 100644 --- a/install/rpm/templates/web/httpd/hosting.stpl +++ b/install/rpm/templates/web/httpd/hosting.stpl @@ -51,5 +51,5 @@ IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_* - IncludeOptional /etc/httpd/conf.d/*.inc* + IncludeOptional /etc/httpd/conf.h.d/*.inc* diff --git a/install/rpm/templates/web/httpd/hosting.tpl b/install/rpm/templates/web/httpd/hosting.tpl index 85f7a7f..df0767e 100644 --- a/install/rpm/templates/web/httpd/hosting.tpl +++ b/install/rpm/templates/web/httpd/hosting.tpl @@ -48,5 +48,5 @@ IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_* - IncludeOptional /etc/httpd/conf.d/*.inc + IncludeOptional /etc/httpd/conf.h.d/*.inc diff --git a/install/rpm/templates/web/httpd/php-fpm/default.stpl b/install/rpm/templates/web/httpd/php-fpm/default.stpl index 6de27cf..717a597 100644 --- a/install/rpm/templates/web/httpd/php-fpm/default.stpl +++ b/install/rpm/templates/web/httpd/php-fpm/default.stpl @@ -37,5 +37,5 @@ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_* - IncludeOptional /etc/httpd/conf.d/*.inc + IncludeOptional /etc/httpd/conf.h.d/*.inc diff --git a/install/rpm/templates/web/httpd/php-fpm/default.tpl b/install/rpm/templates/web/httpd/php-fpm/default.tpl index 8213dd3..c9ebd32 100644 --- a/install/rpm/templates/web/httpd/php-fpm/default.tpl +++ b/install/rpm/templates/web/httpd/php-fpm/default.tpl @@ -34,5 +34,5 @@ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_* - IncludeOptional /etc/httpd/conf.d/*.inc + IncludeOptional /etc/httpd/conf.h.d/*.inc diff --git a/install/rpm/templates/web/httpd/phpcgi.stpl b/install/rpm/templates/web/httpd/phpcgi.stpl index b775178..0293990 100644 --- a/install/rpm/templates/web/httpd/phpcgi.stpl +++ b/install/rpm/templates/web/httpd/phpcgi.stpl @@ -40,5 +40,5 @@ %ssl_ca_str%SSLCertificateChainFile %ssl_ca% IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_* - IncludeOptional /etc/httpd/conf.d/*.inc + IncludeOptional /etc/httpd/conf.h.d/*.inc diff --git a/install/rpm/templates/web/httpd/phpcgi.tpl b/install/rpm/templates/web/httpd/phpcgi.tpl index a38d577..392b25b 100644 --- a/install/rpm/templates/web/httpd/phpcgi.tpl +++ b/install/rpm/templates/web/httpd/phpcgi.tpl @@ -36,5 +36,5 @@ AllowOverride All IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_* - IncludeOptional /etc/httpd/conf.d/*.inc + IncludeOptional /etc/httpd/conf.h.d/*.inc diff --git a/install/rpm/templates/web/httpd/phpfcgid.stpl b/install/rpm/templates/web/httpd/phpfcgid.stpl index 5da82d3..75730d4 100644 --- a/install/rpm/templates/web/httpd/phpfcgid.stpl +++ b/install/rpm/templates/web/httpd/phpfcgid.stpl @@ -41,5 +41,5 @@ %ssl_ca_str%SSLCertificateChainFile %ssl_ca% IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_* - IncludeOptional /etc/httpd/conf.d/*.inc + IncludeOptional /etc/httpd/conf.h.d/*.inc diff --git a/install/rpm/templates/web/httpd/phpfcgid.tpl b/install/rpm/templates/web/httpd/phpfcgid.tpl index 366a1fa..5052f0a 100644 --- a/install/rpm/templates/web/httpd/phpfcgid.tpl +++ b/install/rpm/templates/web/httpd/phpfcgid.tpl @@ -36,5 +36,5 @@ AllowOverride All IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_* - IncludeOptional /etc/httpd/conf.d/*.inc + IncludeOptional /etc/httpd/conf.h.d/*.inc diff --git a/install/rpm/templates/web/httpd/www-data.stpl b/install/rpm/templates/web/httpd/www-data.stpl index 2992f27..d953075 100644 --- a/install/rpm/templates/web/httpd/www-data.stpl +++ b/install/rpm/templates/web/httpd/www-data.stpl @@ -37,5 +37,5 @@ %ssl_ca_str%SSLCertificateChainFile %ssl_ca% IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_* - IncludeOptional /etc/httpd/conf.d/*.inc + IncludeOptional /etc/httpd/conf.h.d/*.inc diff --git a/install/rpm/templates/web/httpd/www-data.tpl b/install/rpm/templates/web/httpd/www-data.tpl index 4124b08..0dd536f 100644 --- a/install/rpm/templates/web/httpd/www-data.tpl +++ b/install/rpm/templates/web/httpd/www-data.tpl @@ -34,5 +34,5 @@ IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_* - IncludeOptional /etc/httpd/conf.d/*.inc + IncludeOptional /etc/httpd/conf.h.d/*.inc diff --git a/install/upgrade/manual/migrate_phpmyadmin.sh b/install/upgrade/manual/migrate_phpmyadmin.sh index 2ba1e69..b05d9f6 100755 --- a/install/upgrade/manual/migrate_phpmyadmin.sh +++ b/install/upgrade/manual/migrate_phpmyadmin.sh @@ -65,6 +65,12 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf fi + if [ "$WEB_SYSTEM" == "httpd" ]; then + cp -f $HESTIA_INSTALL_DIR/pma/apache.conf /etc/phpmyadmin/ + rm /etc/httpd/conf.h.d/phpmyadmin.conf + ln -s /etc/phpmyadmin/apache.conf /etc/httpd/conf.h.d/phpmyadmin.conf + fi + PASS=$(generate_password) echo "[ * ] Installing phpMyAdmin version v$pma_v..." diff --git a/install/upgrade/versions/1.0.2.sh b/install/upgrade/versions/1.0.2.sh index d399c97..e68ac84 100644 --- a/install/upgrade/versions/1.0.2.sh +++ b/install/upgrade/versions/1.0.2.sh @@ -52,6 +52,10 @@ if [ -f "/etc/apache2/conf.d/hestia.conf" ]; then echo "[ * ] Removing old Apache configuration file from previous version of Hestia Control Panel..." rm -f /etc/apache2/conf.d/hestia.conf fi +if [ -f "/etc/httpd/conf.h.d/hestia.conf" ]; then + echo "[ * ] Removing old Apache configuration file from previous version of Hestia Control Panel..." + rm -f /etc/httpd/conf.h.d/hestia.conf +fi if [ -f "/etc/nginx/conf.d/hestia.conf" ]; then echo "[ * ] Removing old NGINX configuration file from previous version of Hestia Control Panel..." rm -f /etc/nginx/conf.d/hestia.conf diff --git a/install/upgrade/versions/1.00.0-190618.sh b/install/upgrade/versions/1.00.0-190618.sh index f9de15c..dede153 100644 --- a/install/upgrade/versions/1.00.0-190618.sh +++ b/install/upgrade/versions/1.00.0-190618.sh @@ -6,6 +6,17 @@ ####### Place additional commands below. ####### ####################################################################################### +if [ "$WEB_SYSTEM" = "httpd" ]; then + confd="conf.h.d" +else + confd="conf.d" +fi +if [ "$PROXY_SYSTEM" = "httpd" ]; then + pconfd="conf.h.d" +else + pconfd="conf.d" +fi + # Add webmail alias variable to system configuration if non-existent if [ -z "$WEBMAIL_ALIAS" ]; then echo "[ * ] Updating webmail alias configuration..." @@ -119,7 +130,7 @@ done # Add unassigned hosts configuration to Nginx and Apache for ipaddr in $($BIN/v-list-sys-ips plain | cut -f1); do - web_conf="/etc/$WEB_SYSTEM/conf.d/$ipaddr.conf" + web_conf="/etc/$WEB_SYSTEM/$confd/$ipaddr.conf" rm -f $web_conf if [ "$WEB_SYSTEM" = "apache2" ]; then @@ -151,7 +162,7 @@ for ipaddr in $($BIN/v-list-sys-ips plain | cut -f1); do | sed -e "s/%ip%/$ipaddr/g" \ -e "s/%web_port%/$WEB_PORT/g" \ -e "s/%proxy_port%/$PROXY_PORT/g" \ - > /etc/$PROXY_SYSTEM/conf.d/$ipaddr.conf + > /etc/$PROXY_SYSTEM/$pconfd/$ipaddr.conf fi done diff --git a/install/upgrade/versions/1.1.0.sh b/install/upgrade/versions/1.1.0.sh index 2d31b91..0bfca37 100644 --- a/install/upgrade/versions/1.1.0.sh +++ b/install/upgrade/versions/1.1.0.sh @@ -197,13 +197,25 @@ chown root:root /var/log/$WEB_SYSTEM/domains/$WEBMAIL_ALIAS* > /dev/null 2>&1 if [ "$IMAP_SYSTEM" = "dovecot" ]; then echo "[ * ] Enabling IMAP quota information reporting..." if [ -e /etc/dovecot/conf.d/20-pop3.conf ]; then - cp -f $HESTIA/install/deb/dovecot/conf.d/20-pop3.conf /etc/dovecot/conf.d/20-pop3.conf + if [ -e /etc/redhat-release ]; then + cp -f $HESTIA/install/rpm/dovecot/conf.d/20-pop3.conf /etc/dovecot/conf.d/20-pop3.conf + else + cp -f $HESTIA/install/deb/dovecot/conf.d/20-pop3.conf /etc/dovecot/conf.d/20-pop3.conf + fi fi if [ -e /etc/dovecot/conf.d/20-imap.conf ]; then - cp -f $HESTIA/install/deb/dovecot/conf.d/20-imap.conf /etc/dovecot/conf.d/20-imap.conf + if [ -e /etc/redhat-release ]; then + cp -f $HESTIA/install/rpm/dovecot/conf.d/20-imap.conf /etc/dovecot/conf.d/20-imap.conf + else + cp -f $HESTIA/install/deb/dovecot/conf.d/20-imap.conf /etc/dovecot/conf.d/20-imap.conf + fi fi if [ -e /etc/dovecot/conf.d/90-quota.conf ]; then - cp -f $HESTIA/install/deb/dovecot/conf.d/90-quota.conf /etc/dovecot/conf.d/90-quota.conf + if [ -e /etc/redhat-release ]; then + cp -f $HESTIA/install/deb/dovecot/conf.d/90-quota.conf /etc/dovecot/conf.d/90-quota.conf + else + cp -f $HESTIA/install/deb/dovecot/conf.d/90-quota.conf /etc/dovecot/conf.d/90-quota.conf + fi fi fi @@ -222,3 +234,6 @@ fi if [ -e /etc/apache2/conf.d/roundcube.conf ]; then rm -f /etc/apache2/conf.d/roundcube.conf fi +if [ -e /etc/httpd/conf.h.d/roundcube.conf ]; then + rm -f /etc/httpd/conf.h.d/roundcube.conf +fi diff --git a/install/upgrade/versions/1.5.0.sh b/install/upgrade/versions/1.5.0.sh index c66f25c..ff02afc 100644 --- a/install/upgrade/versions/1.5.0.sh +++ b/install/upgrade/versions/1.5.0.sh @@ -26,6 +26,10 @@ if [ -n "$DB_PMA_ALIAS" ]; then rm /etc/apache2/conf.d/phpmyadmin.conf touch /etc/apache2/conf.d/phpmyadmin.inc fi + if [ -e "/etc/httpd/conf.h.d/phpmyadmin.conf" ]; then + rm /etc/httpd/conf.h.d/phpmyadmin.conf + touch /etc/httpd/conf.h.d/phpmyadmin.inc + fi $HESTIA/bin/v-change-sys-db-alias 'pma' "$DB_PMA_ALIAS" fi @@ -34,6 +38,10 @@ if [ -n "$DB_PGA_ALIAS" ]; then rm /etc/apache2/conf.d/phppgadmin.conf touch /etc/apache2/conf.d/phppgadmin.inc fi + if [ -e "/etc/httpd/conf.h.d/phppgadmin.conf" ]; then + rm /etc/httpd/conf.h.d/phppgadmin.conf + touch /etc/httpd/conf.h.d/phppgadmin.inc + fi $HESTIA/bin/v-change-sys-db-alias 'pga' "$DB_PGA_ALIAS" fi diff --git a/install/upgrade/versions/1.7.1.sh b/install/upgrade/versions/1.7.1.sh index e10072e..71e2680 100644 --- a/install/upgrade/versions/1.7.1.sh +++ b/install/upgrade/versions/1.7.1.sh @@ -44,3 +44,10 @@ if [ "$WEB_SYSTEM" = "apache2" ]; then sed -i "s/IncludeOptional conf.d\/domains\/\*.conf/IncludeOptional conf.d\/domains\/$WEBMAIL_ALIAS.*.conf\nIncludeOptional conf.d\/domains\/\*.conf/g" /etc/apache2/apache2.conf fi fi + +if [ "$WEB_SYSTEM" = "httpd" ]; then + if ! (grep -q "$WEBMAIL_ALIAS.*.conf" /etc/httpd/conf/httpd.conf); then + echo "[ * ] Update /etc/httpd/conf/httpd.conf..." + sed -i "s/IncludeOptional conf.d\/domains\/\*.conf/IncludeOptional conf.d\/domains\/$WEBMAIL_ALIAS.*.conf\nIncludeOptional conf.d\/domains\/\*.conf/g" /etc/httpd/conf/httpd.conf + fi +fi diff --git a/src/hst_bootstrap_install.sh b/src/hst_bootstrap_install.sh index a480468..83ee1ed 100755 --- a/src/hst_bootstrap_install.sh +++ b/src/hst_bootstrap_install.sh @@ -11,11 +11,11 @@ os=$3 # Download specified installer and compiler if [ -f "/etc/redhat-release" ]; then - wget https://raw.githubusercontent.com/$fork/hestiacp/$branch/install/hst-install-rhel.sh + wget https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/install/hst-install-rhel.sh else - wget https://raw.githubusercontent.com/$fork/hestiacp/$branch/install/hst-install-$os.sh + wget https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/install/hst-install-$os.sh fi -wget https://raw.githubusercontent.com/$fork/hestiacp/$branch/src/hst_autocompile.sh +wget https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/src/hst_autocompile.sh # Execute compiler and build hestia core package chmod +x hst_autocompile.sh diff --git a/src/lxd_compile.sh b/src/lxd_compile.sh index d50a1fc..200277d 100644 --- a/src/lxd_compile.sh +++ b/src/lxd_compile.sh @@ -8,7 +8,7 @@ else apt -y install curl wget fi -curl https://raw.githubusercontent.com/hestiacp/hestiacp/$branch/src/hst_autocompile.sh > /tmp/hst_autocompile.sh +curl https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/src/hst_autocompile.sh > /tmp/hst_autocompile.sh chmod +x /tmp/hst_autocompile.sh mkdir -p /opt/hestiacp diff --git a/src/rpm/hestia/control b/src/rpm/hestia/control new file mode 100644 index 0000000..a912d87 --- /dev/null +++ b/src/rpm/hestia/control @@ -0,0 +1,14 @@ +Source: hestia +Package: hestia +Priority: optional +Version: 1.9.0~alpha +Section: admin +Maintainer: HestiaCP +Homepage: https://www.hestiacp.com +Architecture: amd64 +Depends: bash, awk, sed, acl, sysstat, setpriv | util-linux (>= 2.33), zstd, lsb-release, idn2, jq +Description: hestia + hestia is an open source hosting control panel. + hestia has a clean and focused interface without the clutter. + hestia has the latest of very innovative technologies. + hestia is a fork from VestaCP, special thanks to vestacp.com and Serghey Rodin diff --git a/test/make-test-containers.php b/test/make-test-containers.php index e58acae..344e12d 100644 --- a/test/make-test-containers.php +++ b/test/make-test-containers.php @@ -256,10 +256,10 @@ function lxc_run($args, &$rc) { function getHestiaVersion($branch) { $control_file = ""; if ($branch === "~localsrc") { - $control_file = file_get_contents(SHARED_HOST_FOLDER . "/hestiacp/src/deb/hestia/control"); + $control_file = file_get_contents(SHARED_HOST_FOLDER . "/hestiacp/src/rpm/hestia/control"); } else { $control_file = file_get_contents( - "https://raw.githubusercontent.com/hestiacp/hestiacp/${branch}/src/deb/hestia/control", + "https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/src/rpm/hestia/control", ); } diff --git a/test/test.bats b/test/test.bats index 289c47c..cb98a3b 100755 --- a/test/test.bats +++ b/test/test.bats @@ -635,13 +635,25 @@ function check_ip_not_banned(){ assert_success refute_output - assert_file_exist /etc/$WEB_SYSTEM/conf.d/$ip.conf + if [ "$WEB_SYSTEM" = "httpd" ]; then + confd="conf.h.d" + else + confd="conf.d" + fi + + if [ "$PROXY_SYSTEM" = "httpd" ]; then + pconfd="conf.h.d" + else + pconfd="conf.d" + fi + + assert_file_exist /etc/$WEB_SYSTEM/$confd/$ip.conf assert_file_exist $HESTIA/data/ips/$ip assert_file_contains $HESTIA/data/ips/$ip "OWNER='$user'" assert_file_contains $HESTIA/data/ips/$ip "INTERFACE='$interface'" if [ -n "$PROXY_SYSTEM" ]; then - assert_file_exist /etc/$PROXY_SYSTEM/conf.d/$ip.conf + assert_file_exist /etc/$PROXY_SYSTEM/$pconfd/$ip.conf [ -f "$a2_rpaf" ] && assert_file_contains "$a2_rpaf" "RPAFproxy_ips.*$ip\b" [ -f "$a2_remoteip" ] && assert_file_contains "$a2_remoteip" "RemoteIPInternalProxy $ip\$" fi @@ -683,13 +695,25 @@ function check_ip_not_banned(){ assert_success refute_output - assert_file_exist /etc/$WEB_SYSTEM/conf.d/$ip.conf + if [ "$WEB_SYSTEM" = "httpd" ]; then + confd="conf.h.d" + else + confd="conf.d" + fi + + if [ "$PROXY_SYSTEM" = "httpd" ]; then + pconfd="conf.h.d" + else + pconfd="conf.d" + fi + + assert_file_exist /etc/$WEB_SYSTEM/$confd/$ip.conf assert_file_exist $HESTIA/data/ips/$ip assert_file_contains $HESTIA/data/ips/$ip "OWNER='$user'" assert_file_contains $HESTIA/data/ips/$ip "INTERFACE='$interface'" if [ -n "$PROXY_SYSTEM" ]; then - assert_file_exist /etc/$PROXY_SYSTEM/conf.d/$ip.conf + assert_file_exist /etc/$PROXY_SYSTEM/$pconfd/$ip.conf local a2_rpaf="/etc/$WEB_SYSTEM/mods-enabled/rpaf.conf" [ -f "$a2_rpaf" ] && assert_file_contains "$a2_rpaf" "RPAFproxy_ips.*$ip\b" @@ -704,7 +728,19 @@ function check_ip_not_banned(){ assert_success refute_output - assert_file_not_exist /etc/$WEB_SYSTEM/conf.d/$ip.conf + if [ "$WEB_SYSTEM" = "httpd" ]; then + confd="conf.h.d" + else + confd="conf.d" + fi + + if [ "$PROXY_SYSTEM" = "httpd" ]; then + pconfd="conf.h.d" + else + pconfd="conf.d" + fi + + assert_file_not_exist /etc/$WEB_SYSTEM/$confd/$ip.conf assert_file_not_exist $HESTIA/data/ips/$ip @@ -713,11 +749,11 @@ function check_ip_not_banned(){ assert_success refute_output - assert_file_not_exist /etc/$WEB_SYSTEM/conf.d/$ip.conf + assert_file_not_exist /etc/$WEB_SYSTEM/$confd/$ip.conf assert_file_not_exist $HESTIA/data/ips/$ip if [ -n "$PROXY_SYSTEM" ]; then - assert_file_not_exist /etc/$PROXY_SYSTEM/conf.d/$ip.conf + assert_file_not_exist /etc/$PROXY_SYSTEM/$pconfd/$ip.conf fi # remoteip and rpaf config hashes must match the initial one @@ -739,13 +775,25 @@ function check_ip_not_banned(){ assert_success refute_output - assert_file_exist /etc/$WEB_SYSTEM/conf.d/$ip.conf + if [ "$WEB_SYSTEM" = "httpd" ]; then + confd="conf.h.d" + else + confd="conf.d" + fi + + if [ "$PROXY_SYSTEM" = "httpd" ]; then + pconfd="conf.h.d" + else + pconfd="conf.d" + fi + + assert_file_exist /etc/$WEB_SYSTEM/$confd/$ip.conf assert_file_exist $HESTIA/data/ips/$ip assert_file_contains $HESTIA/data/ips/$ip "OWNER='$user'" assert_file_contains $HESTIA/data/ips/$ip "INTERFACE='$interface'" if [ -n "$PROXY_SYSTEM" ]; then - assert_file_exist /etc/$PROXY_SYSTEM/conf.d/$ip.conf + assert_file_exist /etc/$PROXY_SYSTEM/$pconfd/$ip.conf local a2_rpaf="/etc/$WEB_SYSTEM/mods-enabled/rpaf.conf" [ -f "$a2_rpaf" ] && assert_file_contains "$a2_rpaf" "RPAFproxy_ips.*$ip\b"