Added fixes for rpm based system usage

devel
Alexey Berezhok 12 months ago
parent 68a01be7c3
commit 8bcf0d1d01

@ -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:

@ -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
#----------------------------------------------------------#

@ -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: "",
};

@ -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:

@ -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 </VirtualHost> 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

@ -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
}

@ -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
}

@ -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

@ -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/

@ -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"

@ -55,4 +55,4 @@ EnableSendfile on
LogFormat "%a %l %u %t \"%r\" %>s %b" common
</IfModule>
IncludeOptional conf.d/*.conf
IncludeOptional conf.h.d/*.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

@ -45,5 +45,5 @@
</IfModule>
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
IncludeOptional /etc/httpd/conf.d/*.inc
IncludeOptional /etc/httpd/conf.h.d/*.inc
</VirtualHost>

@ -42,5 +42,5 @@
</IfModule>
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
IncludeOptional /etc/httpd/conf.d/*.inc
IncludeOptional /etc/httpd/conf.h.d/*.inc
</VirtualHost>

@ -51,5 +51,5 @@
</IfModule>
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
IncludeOptional /etc/httpd/conf.d/*.inc*
IncludeOptional /etc/httpd/conf.h.d/*.inc*
</VirtualHost>

@ -48,5 +48,5 @@
</IfModule>
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
IncludeOptional /etc/httpd/conf.d/*.inc
IncludeOptional /etc/httpd/conf.h.d/*.inc
</VirtualHost>

@ -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
</VirtualHost>

@ -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
</VirtualHost>

@ -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
</VirtualHost>

@ -36,5 +36,5 @@
AllowOverride All
</Directory>
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
IncludeOptional /etc/httpd/conf.d/*.inc
IncludeOptional /etc/httpd/conf.h.d/*.inc
</VirtualHost>

@ -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
</VirtualHost>

@ -36,5 +36,5 @@
AllowOverride All
</Directory>
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
IncludeOptional /etc/httpd/conf.d/*.inc
IncludeOptional /etc/httpd/conf.h.d/*.inc
</VirtualHost>

@ -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
</VirtualHost>

@ -34,5 +34,5 @@
</Directory>
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
IncludeOptional /etc/httpd/conf.d/*.inc
IncludeOptional /etc/httpd/conf.h.d/*.inc
</VirtualHost>

@ -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..."

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -0,0 +1,14 @@
Source: hestia
Package: hestia
Priority: optional
Version: 1.9.0~alpha
Section: admin
Maintainer: HestiaCP <info@hestiacp.com>
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

@ -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",
);
}

@ -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"

Loading…
Cancel
Save