Skip to content

Commit 98fc3c1

Browse files
author
Kristan Kenney
authored
Merge branch 'develop' into Hotfix-0619
2 parents f0753bb + 90e10c2 commit 98fc3c1

File tree

7 files changed

+78
-36
lines changed

7 files changed

+78
-36
lines changed

ISSUE_TEMPLATE.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ Type here (e.g. 0.9.8-29)
1818
### Which branch are you using?
1919
Type here (e.g master, develop, etc.)
2020

21-
### Which branch are you using?
22-
Type here (e.g master, develop, etc.)
23-
2421
### What software is installed?
2522
Type here (e.g. Apache, Nginx, PHP-FPM, Dovecot/Exim, MariaDB, etc.)
2623

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ If you would like to help our developers cover their time and infrastucture cost
108108

109109
License
110110
=============================
111-
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>
111+
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>

bin/v-add-sys-sftp-jail

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# info: add system sftp jail
3-
# options: NONE
3+
# options: [RESTART]
44
#
55
# The script enables sftp jailed environment
66

@@ -14,6 +14,7 @@ source /etc/profile
1414
source $HESTIA/func/main.sh
1515
source $HESTIA/conf/hestia.conf
1616

17+
restart=$1
1718

1819
#----------------------------------------------------------#
1920
# Verifications #
@@ -45,11 +46,13 @@ if [ -z "$sftp_i" ]; then
4546
echo " X11Forwarding no" >> $config
4647
echo " AllowTCPForwarding no" >> $config
4748
echo " ForceCommand internal-sftp" >> $config
48-
restart='yes'
4949
fi
5050

5151
# Validating opensshd config
52-
if [ "$restart" = 'yes' ]; then
52+
if [ "$restart" = 'no' ]; then
53+
# Skipping SSH Restart
54+
echo "" > /dev/null 2>&1
55+
else
5356
subj="OpenSSH restart failed"
5457
email=$(grep CONTACT $HESTIA/data/users/admin/user.conf |cut -f 2 -d \')
5558
/usr/sbin/sshd -t >/dev/null 2>&1
@@ -59,7 +62,6 @@ if [ "$restart" = 'yes' ]; then
5962
echo -e "$mail_text" |$SENDMAIL -s "$subj" $email
6063
else
6164
service ssh restart >/dev/null 2>&1
62-
service sshd restart >/dev/null 2>&1
6365
fi
6466
fi
6567

bin/v-add-user-sftp-jail

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# info: add user sftp jail
3-
# options: USER
3+
# options: USER [RESTART]
44
#
55
# The script enables sftp jailed environment
66

@@ -11,6 +11,7 @@
1111

1212
# Argument definition
1313
user=$1
14+
restart=$2
1415

1516
# Includes
1617
source $HESTIA/func/main.sh
@@ -62,8 +63,12 @@ chown root:root /home/$user
6263
#----------------------------------------------------------#
6364

6465
# Restart ssh service
65-
service ssh restart > /dev/null 2>&1
66-
service sshd restart > /dev/null 2>&1
66+
if [ "$restart" = 'no' ]; then
67+
# Skip restart of SSH daemon
68+
echo "" > /dev/null 2>&1
69+
else
70+
service ssh restart > /dev/null 2>&1
71+
fi
6772

6873
# Logging
6974
log_event "$OK" "$ARGUMENTS"

install/hst-install-debian.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,6 @@ sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
894894
# Enable SFTP subsystem for SSH
895895
sftp_subsys_enabled=$(grep -iE "^#?.*subsystem.+(sftp )?sftp-server" /etc/ssh/sshd_config)
896896
if [ ! -z "$sftp_subsys_enabled" ]; then
897-
echo "(*) Updating SFTP subsystem configuration..."
898897
sed -i -E "s/^#?.*Subsystem.+(sftp )?sftp-server/Subsystem sftp internal-sftp/g" /etc/ssh/sshd_config
899898
fi
900899

@@ -1067,8 +1066,8 @@ echo "BACKUP_SYSTEM='local'" >> $HESTIA/conf/hestia.conf
10671066
echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
10681067

10691068
# Version & Release Branch
1070-
echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
1071-
echo "RELEASE='develop'" >> $HESTIA/conf/hestia.conf
1069+
echo "VERSION='1.00.0-190618'" >> $HESTIA/conf/hestia.conf
1070+
echo "RELEASE_BRANCH='develop'" >> $HESTIA/conf/hestia.conf
10721071

10731072
# Installing hosting packages
10741073
cp -rf $hestiacp/packages $HESTIA/data/
@@ -1117,7 +1116,6 @@ if [ "$nginx" = 'yes' ]; then
11171116
cp -f $hestiacp/nginx/status.conf /etc/nginx/conf.d/
11181117
cp -f $hestiacp/nginx/phpmyadmin.inc /etc/nginx/conf.d/
11191118
cp -f $hestiacp/nginx/phppgadmin.inc /etc/nginx/conf.d/
1120-
cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
11211119
cp -f $hestiacp/logrotate/nginx /etc/logrotate.d/
11221120
mkdir -p /etc/nginx/conf.d/domains
11231121
mkdir -p /var/log/nginx/domains
@@ -1503,11 +1501,14 @@ fi
15031501
# Configure Roundcube #
15041502
#----------------------------------------------------------#
15051503

1506-
if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
1504+
if [ "$dovecot" = 'yes' ] && [ "$mysql" = 'yes' ]; then
15071505
if [ "$apache" = 'yes' ]; then
15081506
cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
15091507
ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
15101508
fi
1509+
if [ "$nginx" = 'yes' ]; then
1510+
cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
1511+
fi
15111512
cp -f $hestiacp/roundcube/main.inc.php /etc/roundcube/config.inc.php
15121513
cp -f $hestiacp/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
15131514
cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
@@ -1737,9 +1738,6 @@ service hestia start
17371738
check_result $? "hestia start failed"
17381739
chown admin:admin $HESTIA/data/sessions
17391740

1740-
# Adding cronjob for autoupdates
1741-
$HESTIA/bin/v-add-cron-hestia-autoupdate
1742-
17431741

17441742
#----------------------------------------------------------#
17451743
# Hestia Access Info #
@@ -1793,7 +1791,11 @@ echo
17931791
cat $tmpfile
17941792
rm -f $tmpfile
17951793

1794+
# Add welcome message to notification panel
1795+
$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!'
1796+
17961797
echo "(!) IMPORTANT: You must logout or restart the server before continuing."
1798+
echo ""
17971799
if [ "$interactive" = 'yes' ]; then
17981800
echo -n " Do you want to logout now? [Y/N] "
17991801
read resetshell

install/hst-install-ubuntu.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,6 @@ sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
868868
# Enable SFTP subsystem for SSH
869869
sftp_subsys_enabled=$(grep -iE "^#?.*subsystem.+(sftp )?sftp-server" /etc/ssh/sshd_config)
870870
if [ ! -z "$sftp_subsys_enabled" ]; then
871-
echo "(*) Updating SFTP subsystem configuration..."
872871
sed -i -E "s/^#?.*Subsystem.+(sftp )?sftp-server/Subsystem sftp internal-sftp/g" /etc/ssh/sshd_config
873872
fi
874873

@@ -1031,8 +1030,8 @@ echo "BACKUP_SYSTEM='local'" >> $HESTIA/conf/hestia.conf
10311030
echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
10321031

10331032
# Version & Release Branch
1034-
echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
1035-
echo "RELEASE='develop'" >> $HESTIA/conf/hestia.conf
1033+
echo "VERSION='1.00.0-190618'" >> $HESTIA/conf/hestia.conf
1034+
echo "RELEASE_BRANCH='develop'" >> $HESTIA/conf/hestia.conf
10361035

10371036
# Installing hosting packages
10381037
cp -rf $hestiacp/packages $HESTIA/data/
@@ -1086,7 +1085,6 @@ if [ "$nginx" = 'yes' ]; then
10861085
cp -f $hestiacp/nginx/status.conf /etc/nginx/conf.d/
10871086
cp -f $hestiacp/nginx/phpmyadmin.inc /etc/nginx/conf.d/
10881087
cp -f $hestiacp/nginx/phppgadmin.inc /etc/nginx/conf.d/
1089-
cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
10901088
cp -f $hestiacp/logrotate/nginx /etc/logrotate.d/
10911089
mkdir -p /etc/nginx/conf.d/domains
10921090
mkdir -p /var/log/nginx/domains
@@ -1457,11 +1455,14 @@ fi
14571455
# Configure Roundcube #
14581456
#----------------------------------------------------------#
14591457

1460-
if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
1458+
if [ "$dovecot" = 'yes' ] && [ "$mysql" = 'yes' ]; then
14611459
if [ "$apache" = 'yes' ]; then
14621460
cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
14631461
ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
14641462
fi
1463+
if [ "$nginx" = 'yes' ]; then
1464+
cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
1465+
fi
14651466
cp -f $hestiacp/roundcube/main.inc.php /etc/roundcube/config.inc.php
14661467
cp -f $hestiacp/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
14671468
cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
@@ -1639,9 +1640,6 @@ service hestia start
16391640
check_result $? "hestia start failed"
16401641
chown admin:admin $HESTIA/data/sessions
16411642

1642-
# Adding cronjob for autoupdates
1643-
$HESTIA/bin/v-add-cron-hestia-autoupdate
1644-
16451643

16461644
#----------------------------------------------------------#
16471645
# Hestia Access Info #
@@ -1695,7 +1693,11 @@ echo
16951693
cat $tmpfile
16961694
rm -f $tmpfile
16971695

1696+
# Add welcome message to notification panel
1697+
$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!'
1698+
16981699
echo "(!) IMPORTANT: You must logout or restart the server before continuing."
1700+
echo ""
16991701
if [ "$interactive" = 'yes' ]; then
17001702
echo -n " Do you want to logout now? [Y/N] "
17011703
read resetshell

install/upgrade/1.00.0-190618.sh

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
#!/bin/bash
22

3-
# Define vars
3+
# Define global variables
44
if [ -z "$HESTIA" ] || [ ! -f "${HESTIA}/conf/hestia.conf"]; then
55
export HESTIA="/usr/local/hestia"
66
fi
7+
8+
# Set backup folder
79
HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
10+
11+
# Set installation source folder
812
hestiacp="$HESTIA/install/deb"
13+
14+
# Set phpMyAdmin version for upgrade
915
pma_v='4.9.0.1'
1016

17+
# Add amd64 to repositories to prevent notifications - https://goo.gl/hmsSV7
18+
if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/nginx.list; then
19+
sed -i s/"deb "/"deb [arch=amd64] "/g /etc/apt/sources.list.d/nginx.list
20+
fi
21+
if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/mariadb.list; then
22+
sed -i s/"deb "/"deb [arch=amd64] "/g /etc/apt/sources.list.d/mariadb.list
23+
fi
24+
1125
# Add webmail alias variable to system configuration if non-existent
1226
WEBMAIL_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep WEBMAIL_ALIAS)
1327
if [ -z "$WEBMAIL_ALIAS_CHECK" ]; then
@@ -75,8 +89,7 @@ echo ""
7589

7690
# Set new version
7791
sed -i "/VERSION/d" $HESTIA/conf/hestia.conf
78-
# Set new branch variable
79-
echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
92+
echo "VERSION='1.00.0-190618'" >> $HESTIA/conf/hestia.conf
8093

8194
# Update Apache and Nginx configuration to support new file structure
8295
if [ -f /etc/apache2/apache.conf ]; then
@@ -240,7 +253,7 @@ if [ ! -f /etc/cron.daily/php-session-cleanup ]; then
240253
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
241254
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
242255
fi
243-
chmod 755 /etc/cron.daily/php-session-cleanup
256+
chmod 755 /etc/cron.daily/php-session-cleanup
244257

245258
# Fix empty pool error message for MultiPHP
246259
php_versions=$(ls /etc/php/*/fpm -d 2>/dev/null |wc -l)
@@ -322,15 +335,14 @@ if [ ! -z "$WEBALIZER_CHECK" ]; then
322335
sed -i "s/STATS_SYSTEM='webalizer,awstats'/STATS_SYSTEM='awstats'/g" $HESTIA/conf/hestia.conf
323336
fi
324337

325-
# Run sftp jail once
326-
$HESTIA/bin/v-add-sys-sftp-jail
338+
# Enable SFTP chroot jail capabilities
339+
$HESTIA/bin/v-add-sys-sftp-jail no
327340

328341
# Enable SFTP subsystem for SSH
329342
sftp_subsys_enabled=$(grep -iE "^#?.*subsystem.+(sftp )?sftp-server" /etc/ssh/sshd_config)
330343
if [ ! -z "$sftp_subsys_enabled" ]; then
331344
echo "(*) Updating SFTP subsystem configuration..."
332345
sed -i -E "s/^#?.*Subsystem.+(sftp )?sftp-server/Subsystem sftp internal-sftp/g" /etc/ssh/sshd_config
333-
systemctl restart ssh
334346
fi
335347

336348
# Remove and migrate obsolete object keys
@@ -403,6 +415,26 @@ if [ "$DB_SYSTEM" = 'mysql' ]; then
403415
fi
404416
fi
405417

418+
# Reset backend port
419+
if [ ! -z "$BACKEND_PORT" ]; then
420+
/usr/local/hestia/bin/v-change-sys-port $BACKEND_PORT
421+
fi
422+
423+
# Move clamav to proper location - https://goo.gl/zNuM11
424+
if [ ! -d /usr/local/hestia/web/edit/server/clamav-daemon ]; then
425+
mv /usr/local/hestia/web/edit/server/clamd /usr/local/web/edit/server/clamav-daemon
426+
fi
427+
428+
# Fix named rule for AppArmor - https://goo.gl/SPqHdq
429+
if [ "$DNS_SYSTEM" = 'bind9' ] && [ ! -f /etc/apparmor.d/local/usr.sbin.named ]; then
430+
echo "/home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2> /dev/null
431+
fi
432+
433+
# Remove obsolete ports.conf if exists.
434+
if [ -f /usr/local/hestia/data/firewall/ports.conf ]; then
435+
rm -f /usr/local/hestia/data/firewall/ports.conf
436+
fi
437+
406438
# Add upgrade notification to admin user's panel
407439
$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!'
408440

@@ -423,8 +455,10 @@ if [ ! -z $DNS_SYSTEM ]; then
423455
$BIN/v-restart-dns $restart
424456
fi
425457

426-
# restart Hestia services (nginx,php-fpm)
427-
systemctl restart hestia
458+
# Restart SSH daemon and Hestia Control Panel service
459+
$BIN/v-restart-service ssh $restart
460+
$BIN/v-restart-service hestia $restart
461+
428462

429463
echo ""
430464
echo " Upgrade complete! Please report any bugs or issues to"

0 commit comments

Comments
 (0)