Browse Source

Merge branch 'develop' into Hotfix-0619

Kristan Kenney 6 years ago
parent
commit
98fc3c1182

+ 0 - 3
ISSUE_TEMPLATE.md

@@ -18,9 +18,6 @@ Type here (e.g. 0.9.8-29)
 ### Which branch are you using?
 Type here (e.g master, develop, etc.)
 
-### Which branch are you using?
-Type here (e.g master, develop, etc.)
-
 ### What software is installed?
 Type here (e.g. Apache, Nginx, PHP-FPM, Dovecot/Exim, MariaDB, etc.)
 

+ 1 - 1
README.md

@@ -108,4 +108,4 @@ If you would like to help our developers cover their time and infrastucture cost
 
 License
 =============================
-Hestia Control Panel is licensed under [GPL v3](https://github.com/hestiacp/hestiacp/blob/master/LICENSE) license, and is based on the [VestaCP](https://www.vestacp.com/) project.<br>
+Hestia Control Panel is licensed under [GPL v3](https://github.com/hestiacp/hestiacp/blob/master/LICENSE) license, and is based on the [VestaCP](https://www.vestacp.com/) project.<br>

+ 6 - 4
bin/v-add-sys-sftp-jail

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: add system sftp jail
-# options: NONE
+# options: [RESTART]
 #
 # The script enables sftp jailed environment
 
@@ -14,6 +14,7 @@ source /etc/profile
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 
+restart=$1
 
 #----------------------------------------------------------#
 #                    Verifications                         #
@@ -45,11 +46,13 @@ if [ -z "$sftp_i" ]; then
     echo "    X11Forwarding no" >> $config
     echo "    AllowTCPForwarding no" >> $config
     echo "    ForceCommand internal-sftp" >> $config
-    restart='yes'
 fi
 
 # Validating opensshd config
-if [ "$restart" = 'yes' ]; then
+if [ "$restart" = 'no' ]; then
+   # Skipping SSH Restart
+   echo "" >  /dev/null 2>&1
+else
     subj="OpenSSH restart failed"
     email=$(grep CONTACT $HESTIA/data/users/admin/user.conf |cut -f 2 -d \')
     /usr/sbin/sshd -t >/dev/null 2>&1
@@ -59,7 +62,6 @@ if [ "$restart" = 'yes' ]; then
         echo -e "$mail_text" |$SENDMAIL -s "$subj" $email
     else
         service ssh restart >/dev/null 2>&1
-        service sshd restart >/dev/null 2>&1
     fi
 fi
 

+ 8 - 3
bin/v-add-user-sftp-jail

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: add user sftp jail
-# options: USER
+# options: USER [RESTART]
 #
 # The script enables sftp jailed environment
 
@@ -11,6 +11,7 @@
 
 # Argument definition
 user=$1
+restart=$2
 
 # Includes
 source $HESTIA/func/main.sh
@@ -62,8 +63,12 @@ chown root:root /home/$user
 #----------------------------------------------------------#
 
 # Restart ssh service
-service ssh restart > /dev/null 2>&1
-service sshd restart > /dev/null 2>&1
+if [ "$restart" = 'no' ]; then
+    # Skip restart of SSH daemon
+    echo "" > /dev/null 2>&1
+else
+    service ssh restart > /dev/null 2>&1
+fi
 
 # Logging
 log_event "$OK" "$ARGUMENTS"

+ 10 - 8
install/hst-install-debian.sh

@@ -894,7 +894,6 @@ sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
 # Enable SFTP subsystem for SSH
 sftp_subsys_enabled=$(grep -iE "^#?.*subsystem.+(sftp )?sftp-server" /etc/ssh/sshd_config)
 if [ ! -z "$sftp_subsys_enabled" ]; then
-    echo "(*) Updating SFTP subsystem configuration..."
     sed -i -E "s/^#?.*Subsystem.+(sftp )?sftp-server/Subsystem sftp internal-sftp/g" /etc/ssh/sshd_config
 fi
 
@@ -1067,8 +1066,8 @@ echo "BACKUP_SYSTEM='local'" >> $HESTIA/conf/hestia.conf
 echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
 
 # Version & Release Branch
-echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
-echo "RELEASE='develop'" >> $HESTIA/conf/hestia.conf
+echo "VERSION='1.00.0-190618'" >> $HESTIA/conf/hestia.conf
+echo "RELEASE_BRANCH='develop'" >> $HESTIA/conf/hestia.conf
 
 # Installing hosting packages
 cp -rf $hestiacp/packages $HESTIA/data/
@@ -1117,7 +1116,6 @@ if [ "$nginx" = 'yes' ]; then
     cp -f $hestiacp/nginx/status.conf /etc/nginx/conf.d/
     cp -f $hestiacp/nginx/phpmyadmin.inc /etc/nginx/conf.d/
     cp -f $hestiacp/nginx/phppgadmin.inc /etc/nginx/conf.d/
-    cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
     cp -f $hestiacp/logrotate/nginx /etc/logrotate.d/
     mkdir -p /etc/nginx/conf.d/domains
     mkdir -p /var/log/nginx/domains
@@ -1503,11 +1501,14 @@ fi
 #                   Configure Roundcube                    #
 #----------------------------------------------------------#
 
-if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
+if [ "$dovecot" = 'yes' ] && [ "$mysql" = 'yes' ]; then
     if [ "$apache" = 'yes' ]; then
         cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
         ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
     fi
+    if [ "$nginx" = 'yes' ]; then
+        cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
+    fi
     cp -f $hestiacp/roundcube/main.inc.php /etc/roundcube/config.inc.php
     cp -f $hestiacp/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
     cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
@@ -1737,9 +1738,6 @@ service hestia start
 check_result $? "hestia start failed"
 chown admin:admin $HESTIA/data/sessions
 
-# Adding cronjob for autoupdates
-$HESTIA/bin/v-add-cron-hestia-autoupdate
-
 
 #----------------------------------------------------------#
 #                   Hestia Access Info                     #
@@ -1793,7 +1791,11 @@ echo
 cat $tmpfile
 rm -f $tmpfile
 
+# Add welcome message to notification panel
+$HESTIA/bin/v-add-user-notification admin 'Welcome!' 'For more information on how to use Hestia Control Panel, click on the Help icon in the top right corner of the toolbar.<br><br>Please report any bugs or issues on GitHub at<br>https://github.com/hestiacp/hestiacp/Issues<br><br>Have a great day!'
+
 echo "(!) IMPORTANT: You must logout or restart the server before continuing."
+echo ""
 if [ "$interactive" = 'yes' ]; then
     echo -n " Do you want to logout now? [Y/N] "
     read resetshell

+ 10 - 8
install/hst-install-ubuntu.sh

@@ -868,7 +868,6 @@ sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
 # Enable SFTP subsystem for SSH
 sftp_subsys_enabled=$(grep -iE "^#?.*subsystem.+(sftp )?sftp-server" /etc/ssh/sshd_config)
 if [ ! -z "$sftp_subsys_enabled" ]; then
-    echo "(*) Updating SFTP subsystem configuration..."
     sed -i -E "s/^#?.*Subsystem.+(sftp )?sftp-server/Subsystem sftp internal-sftp/g" /etc/ssh/sshd_config
 fi
 
@@ -1031,8 +1030,8 @@ echo "BACKUP_SYSTEM='local'" >> $HESTIA/conf/hestia.conf
 echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
 
 # Version & Release Branch
-echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
-echo "RELEASE='develop'" >> $HESTIA/conf/hestia.conf
+echo "VERSION='1.00.0-190618'" >> $HESTIA/conf/hestia.conf
+echo "RELEASE_BRANCH='develop'" >> $HESTIA/conf/hestia.conf
 
 # Installing hosting packages
 cp -rf $hestiacp/packages $HESTIA/data/
@@ -1086,7 +1085,6 @@ if [ "$nginx" = 'yes' ]; then
     cp -f $hestiacp/nginx/status.conf /etc/nginx/conf.d/
     cp -f $hestiacp/nginx/phpmyadmin.inc /etc/nginx/conf.d/
     cp -f $hestiacp/nginx/phppgadmin.inc /etc/nginx/conf.d/
-    cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
     cp -f $hestiacp/logrotate/nginx /etc/logrotate.d/
     mkdir -p /etc/nginx/conf.d/domains
     mkdir -p /var/log/nginx/domains
@@ -1457,11 +1455,14 @@ fi
 #                   Configure Roundcube                    #
 #----------------------------------------------------------#
 
-if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
+if [ "$dovecot" = 'yes' ] && [ "$mysql" = 'yes' ]; then
     if [ "$apache" = 'yes' ]; then
         cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
         ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
     fi
+    if [ "$nginx" = 'yes' ]; then
+        cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
+    fi
     cp -f $hestiacp/roundcube/main.inc.php /etc/roundcube/config.inc.php
     cp -f $hestiacp/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
     cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
@@ -1639,9 +1640,6 @@ service hestia start
 check_result $? "hestia start failed"
 chown admin:admin $HESTIA/data/sessions
 
-# Adding cronjob for autoupdates
-$HESTIA/bin/v-add-cron-hestia-autoupdate
-
 
 #----------------------------------------------------------#
 #                   Hestia Access Info                     #
@@ -1695,7 +1693,11 @@ echo
 cat $tmpfile
 rm -f $tmpfile
 
+# Add welcome message to notification panel
+$HESTIA/bin/v-add-user-notification admin 'Welcome!' 'For more information on how to use Hestia Control Panel, click on the Help icon in the top right corner of the toolbar.<br><br>Please report any bugs or issues on GitHub at<br>https://github.com/hestiacp/hestiacp/Issues<br><br>Have a great day!'
+
 echo "(!) IMPORTANT: You must logout or restart the server before continuing."
+echo ""
 if [ "$interactive" = 'yes' ]; then
     echo -n " Do you want to logout now? [Y/N] "
     read resetshell

+ 43 - 9
install/upgrade/1.00.0-190618.sh

@@ -1,13 +1,27 @@
 #!/bin/bash
 
-# Define vars
+# Define global variables
 if [ -z "$HESTIA" ] || [ ! -f "${HESTIA}/conf/hestia.conf"]; then
     export HESTIA="/usr/local/hestia"
 fi
+
+# Set backup folder
 HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
+
+# Set installation source folder
 hestiacp="$HESTIA/install/deb"
+
+# Set phpMyAdmin version for upgrade
 pma_v='4.9.0.1'
 
+# Add amd64 to repositories to prevent notifications - https://goo.gl/hmsSV7
+if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/nginx.list; then
+    sed -i s/"deb "/"deb [arch=amd64] "/g /etc/apt/sources.list.d/nginx.list
+fi
+if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/mariadb.list; then
+    sed -i s/"deb "/"deb [arch=amd64] "/g /etc/apt/sources.list.d/mariadb.list
+fi
+
 # Add webmail alias variable to system configuration if non-existent
 WEBMAIL_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep WEBMAIL_ALIAS)
 if [ -z "$WEBMAIL_ALIAS_CHECK" ]; then
@@ -75,8 +89,7 @@ echo ""
 
 # Set new version
 sed -i "/VERSION/d" $HESTIA/conf/hestia.conf
-# Set new branch variable
-echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
+echo "VERSION='1.00.0-190618'" >> $HESTIA/conf/hestia.conf
 
 # Update Apache and Nginx configuration to support new file structure
 if [ -f /etc/apache2/apache.conf ]; then
@@ -240,7 +253,7 @@ if [ ! -f /etc/cron.daily/php-session-cleanup ]; then
     echo "find -O3 /home/*/tmp/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
     echo "find -O3 $HESTIA/data/sessions/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
 fi
-    chmod 755 /etc/cron.daily/php-session-cleanup
+chmod 755 /etc/cron.daily/php-session-cleanup
 
 # Fix empty pool error message for MultiPHP
 php_versions=$(ls /etc/php/*/fpm -d 2>/dev/null |wc -l)
@@ -322,15 +335,14 @@ if [ ! -z "$WEBALIZER_CHECK" ]; then
     sed -i "s/STATS_SYSTEM='webalizer,awstats'/STATS_SYSTEM='awstats'/g" $HESTIA/conf/hestia.conf
 fi
 
-# Run sftp jail once
-$HESTIA/bin/v-add-sys-sftp-jail
+# Enable SFTP chroot jail capabilities
+$HESTIA/bin/v-add-sys-sftp-jail no
 
 # Enable SFTP subsystem for SSH
 sftp_subsys_enabled=$(grep -iE "^#?.*subsystem.+(sftp )?sftp-server" /etc/ssh/sshd_config)
 if [ ! -z "$sftp_subsys_enabled" ]; then
     echo "(*) Updating SFTP subsystem configuration..."
     sed -i -E "s/^#?.*Subsystem.+(sftp )?sftp-server/Subsystem sftp internal-sftp/g" /etc/ssh/sshd_config
-    systemctl restart ssh
 fi
 
 # Remove and migrate obsolete object keys
@@ -403,6 +415,26 @@ if [ "$DB_SYSTEM" = 'mysql' ]; then
     fi
 fi
 
+# Reset backend port
+if [ ! -z "$BACKEND_PORT" ]; then
+    /usr/local/hestia/bin/v-change-sys-port $BACKEND_PORT
+fi
+
+# Move clamav to proper location - https://goo.gl/zNuM11
+if [ ! -d /usr/local/hestia/web/edit/server/clamav-daemon ]; then
+    mv /usr/local/hestia/web/edit/server/clamd /usr/local/web/edit/server/clamav-daemon
+fi
+
+# Fix named rule for AppArmor - https://goo.gl/SPqHdq
+if [ "$DNS_SYSTEM" = 'bind9' ] && [ ! -f /etc/apparmor.d/local/usr.sbin.named ]; then
+        echo "/home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2> /dev/null
+fi
+
+# Remove obsolete ports.conf if exists.
+if [ -f /usr/local/hestia/data/firewall/ports.conf ]; then
+    rm -f /usr/local/hestia/data/firewall/ports.conf
+fi
+
 # Add upgrade notification to admin user's panel
 $BIN/v-add-user-notification admin 'Upgrade complete' 'Your server has been updated to v0.10.0.<br>Please report any bugs on GitHub at<br>https://github.com/hestiacp/hestiacp/Issues<br><br>Have a great day!'
 
@@ -423,8 +455,10 @@ if [ ! -z $DNS_SYSTEM ]; then
 	$BIN/v-restart-dns $restart
 fi
 
-# restart Hestia services (nginx,php-fpm)
-systemctl restart hestia
+# Restart SSH daemon and Hestia Control Panel service
+$BIN/v-restart-service ssh $restart
+$BIN/v-restart-service hestia $restart
+
 
 echo ""
 echo "    Upgrade complete! Please report any bugs or issues to"