Skip to content

Commit 1042896

Browse files
author
Kristan Kenney
committed
Merge branch 'bugfix-backend-0306'
2 parents 0062d02 + 7212c17 commit 1042896

File tree

3 files changed

+47
-24
lines changed

3 files changed

+47
-24
lines changed

bin/v-restart-system

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

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

1516
# Includes
1617
source $HESTIA/func/main.sh
@@ -20,7 +21,7 @@ source $HESTIA/func/main.sh
2021
# Verifications #
2122
#----------------------------------------------------------#
2223

23-
check_args '1' "$#" 'RESTART'
24+
check_args '1' "$#" 'RESTART [DELAY]'
2425

2526

2627
# Perform verification if read-only mode is enabled
@@ -31,6 +32,10 @@ check_hestia_demo_mode
3132
#----------------------------------------------------------#
3233

3334
if [ "$restart" = 'yes' ]; then
35+
if [ "$delay" ]; then
36+
echo "The server will restart in $delay seconds..."
37+
sleep $delay
38+
fi
3439
/sbin/reboot
3540
fi
3641

bin/v-update-sys-hestia-git

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,13 @@ if [ ! -z "$1" ]; then
9090
exit 1
9191
else
9292
/usr/local/hestia/bin/v-change-sys-config-value 'RELEASE_BRANCH' "$branch"
93-
echo "Changed update release branch to $branch from GitHub repository."
93+
echo "Changed release branch to $branch."
9494
fi
9595
else
9696
source /usr/local/hestia/conf/hestia.conf
9797
branch=$RELEASE_BRANCH
9898
fi
9999

100-
if [ ! -z "$2" ]; then
101-
install=$2
102-
else
103-
install="y"
104-
fi
105-
106100
if [ -z "$branch" ]; then
107101
echo "No branch detected, please provide one using: v-update-sys-hestia-git branch"
108102
exit
@@ -373,19 +367,42 @@ fi
373367
#
374368
#################################################################################
375369

376-
if [ "$install" = 'yes' ] || [ "$install" = 'y' ]; then
377-
echo "!!! Development builds should not be installed on systems with live production data without understanding the potential risks involved. !!!"
378-
read -p 'Do you want to proceed the package installation? [y/n] ' answer
370+
# Define package installation functions
371+
warning_message() {
372+
echo ""
373+
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
374+
echo "WARNING - Development builds should not be installed on"
375+
echo "systems with live production data without understanding"
376+
echo "the potential risks that are involved!"
377+
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
378+
echo ""
379+
}
380+
381+
install_build() {
382+
echo "Installing packages..."
383+
for i in $DEB_DIR/*.deb; do
384+
# Install all available packages
385+
dpkg -i $i
386+
done
387+
# Remove temporary files
388+
rm -rf $BUILD_DIR
389+
}
390+
391+
# Define installation routine
392+
393+
if [ "$install" = "yes" ]; then
394+
install_build
395+
else
396+
warning_message
397+
read -p "Do you wish to proceed with the installation? [y/n] " answer
379398
if [ "$answer" = 'y' ] || [ "$answer" = 'Y' ]; then
380-
echo "Installing packages..."
381-
for i in $DEB_DIR/*.deb; do
382-
# Install all available packages
383-
dpkg -i $i
384-
done
399+
install_build
385400
unset $answer
386-
# Remove temporary files
387-
rm -rf $BUILD_DIR
388401
else
389-
check_result 1 "Package installation cancelled..."
402+
echo "Installation of development build aborted."
403+
echo "Removing temporary files..."
404+
rm -rf $BUILD_DIR
405+
unset $answer
406+
echo ""
390407
fi
391408
fi

install/upgrade/versions/latest.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ fi
140140

141141
# Installing postgresql repo
142142
if [ -e "/etc/postgresql" ]; then
143+
echo "(*) Enabling native PostgreSQL APT repository..."
143144
osname="$(cat /etc/os-release | grep "^ID\=" | sed "s/ID\=//g")"
144145
if [ "$osname" = "ubuntu" ]; then
145146
codename="$(lsb_release -s -c)"
@@ -165,7 +166,7 @@ fi
165166
if [ -e "/etc/nginx/nginx.conf" ]; then
166167
nginx_tls_check=$(grep TLSv1.1 /etc/nginx/nginx.conf)
167168
if [ ! -z "$nginx_tls_check" ]; then
168-
echo "(*) Hardening nginx configuration, drop TLSv1.1 support..."
169+
echo "(*) Updating nginx security settings - disabling TLS v1.1..."
169170
sed -i 's/TLSv1.1 //g' /etc/nginx/nginx.conf
170171
fi
171172
fi
@@ -193,8 +194,8 @@ done
193194
chown root:root /var/log/$WEB_SYSTEM/domains/$WEBMAIL_ALIAS* > /dev/null 2>&1
194195

195196
# Enable IMAP/POP3 quota information
196-
if [ -z "$IMAP_SYSTEM" ]; then
197-
echo "(*) Enabling IMAP quota information reporting ..."
197+
if [ "$IMAP_SYSTEM" = "dovecot" ]; then
198+
echo "(*) Enabling IMAP quota information reporting..."
198199
if [ -e /etc/dovecot/conf.d/20-pop3.conf ]; then
199200
cp -f $HESTIA/install/deb/dovecot/conf.d/20-pop3.conf /etc/dovecot/conf.d/20-pop3.conf
200201
fi
@@ -209,7 +210,7 @@ fi
209210
# Trigger multiphp legacy migration script
210211
num_php_versions=$(ls -d /etc/php/*/fpm/pool.d 2>/dev/null |wc -l)
211212
if [ "$num_php_versions" -gt 1 ] && [ -z "$WEB_BACKEND" ]; then
212-
echo "(*) Migrate to new multiphp backend system..."
213+
echo "(*) Enabling modular Multi-PHP backend..."
213214
cp -rf $HESTIA/data/templates/web $HESTIA_BACKUP/templates/web
214215
bash $HESTIA/install/upgrade/manual/migrate_multiphp.sh > /dev/null 2>&1
215-
fi
216+
fi

0 commit comments

Comments
 (0)