Skip to content

Commit 386a8e4

Browse files
author
Kristan Kenney
committed
Version bump: Hestia Control Panel v1.2.2 (development)
1 parent 10fe02b commit 386a8e4

File tree

10 files changed

+363
-220
lines changed

10 files changed

+363
-220
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
### Features
66

77
### Bugfixes
8-
- Improved quality of default web domain templates for Drupal.
8+
99

1010
## [1.2.1] - Service Release 1 (beta)
1111
### Features

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
[Hestia Control Panel](https://www.hestiacp.com/)
44
==================================================
55
**Latest stable release:** Version 1.2.0 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md)<br>
6+
**Latest beta release:** Version 1.2.1 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/beta/CHANGELOG.md)<br>
7+
**Latest unstable development snapshot:** Version 1.2.2 | [View Changelog](https://github.com/hestiacp/hestiacp/main/release/CHANGELOG.md)<br>
68

79
**Web:** [www.hestiacp.com](https://www.hestiacp.com/)<br>
810
**Documentation:** [docs.hestiacp.com](https://docs.hestiacp.com/)<br>

func/upgrade.sh

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,92 @@ upgrade_complete_message() {
6161

6262
upgrade_init_backup() {
6363
# Ensure that backup directories are created
64-
mkdir -p $HESTIA_BACKUP/conf/
64+
# Hestia Control Panel configuration files
65+
mkdir -p $HESTIA_BACKUP/conf/hestia/
66+
67+
# Hosting Packages
6568
mkdir -p $HESTIA_BACKUP/packages/
69+
70+
# Domain template files
6671
mkdir -p $HESTIA_BACKUP/templates/
72+
73+
# System services (apache2, nginx, bind9, vsftpd, etc).
74+
if [ ! -z "$WEB_SYSTEM" ]; then
75+
mkdir -p $HESTIA_BACKUP/conf/$WEB_SYSTEM/
76+
fi
77+
if [ ! -z "$IMAP_SYSTEM" ]; then
78+
mkdir -p $HESTIA_BACKUP/conf/$IMAP_SYSTEM/
79+
fi
80+
if [ ! -z "$MAIL_SYSTEM" ]; then
81+
mkdir -p $HESTIA_BACKUP/conf/$MAIL_SYSTEM/
82+
fi
83+
if [ ! -z "$DNS_SYSTEM" ]; then
84+
mkdir -p $HESTIA_BACKUP/conf/$DNS_SYSTEM/
85+
fi
86+
if [ ! -z "$PROXY_SYSTEM" ]; then
87+
mkdir -p $HESTIA_BACKUP/conf/$PROXY_SYSTEM/
88+
fi
89+
if [ ! -z "$DB_SYSTEM" ]; then
90+
mkdir -p $HESTIA_BACKUP/conf/$DB_SYSTEM/
91+
fi
92+
if [ ! -z "$FTP_SYSTEM" ]; then
93+
mkdir -p $HESTIA_BACKUP/conf/$FTP_SYSTEM/
94+
fi
95+
if [ ! -z "$FIREWALL_SYSTEM" ]; then
96+
mkdir -p $HESTIA_BACKUP/conf/$FIREWALL_SYSTEM/
97+
fi
98+
if [ ! -z "$FIREWALL_EXTENSION" ]; then
99+
mkdir -p $HESTIA_BACKUP/conf/$FIREWALL_EXTENSION/
100+
fi
101+
if [ -e "/etc/ssh/sshd_config" ]; then
102+
mkdir -p $HESTIA_BACKUP/conf/ssh/
103+
fi
104+
105+
echo "[ * ] Backing up existing templates and configuration files..."
106+
107+
cp -rf $HESTIA/data/packages/* $HESTIA_BACKUP/packages/
108+
109+
cp -rf $HESTIA/data/templates/* $HESTIA_BACKUP/templates/
110+
111+
# Hestia Control Panel configuration files
112+
cp -rf $HESTIA/conf/* $HESTIA_BACKUP/conf/hestia/
113+
114+
# System service configuration files (apache2, nginx, bind9, vsftpd, etc).
115+
if [ ! -z "$WEB_SYSTEM" ]; then
116+
cp -f /etc/$WEB_SYSTEM/*.conf $HESTIA_BACKUP/conf/$WEB_SYSTEM/
117+
cp -f /etc/$WEB_SYSTEM/conf.d/*.conf $HESTIA_BACKUP/conf/$WEB_SYSTEM/
118+
fi
119+
if [ ! -z "$PROXY_SYSTEM" ]; then
120+
cp -f /etc/$PROXY_SYSTEM/*.conf $HESTIA_BACKUP/conf/$PROXY_SYSTEM/
121+
cp -f /etc/$PROXY_SYSTEM/conf.d/*.conf $HESTIA_BACKUP/conf/$PROXY_SYSTEM/
122+
cp -f /etc/$PROXY_SYSTEM/conf.d/*.inc $HESTIA_BACKUP/conf/$PROXY_SYSTEM/
123+
fi
124+
if [ ! -z "$IMAP_SYSTEM" ]; then
125+
cp -f /etc/$IMAP_SYSTEM/*.conf $HESTIA_BACKUP/conf/$IMAP_SYSTEM/
126+
cp -f /etc/$IMAP_SYSTEM/conf.d/*.conf $HESTIA_BACKUP/conf/$IMAP_SYSTEM/
127+
fi
128+
if [ ! -z "$MAIL_SYSTEM" ]; then
129+
cp -f /etc/$MAIL_SYSTEM/*.conf $HESTIA_BACKUP/conf/$MAIL_SYSTEM/
130+
fi
131+
if [ ! -z "$DNS_SYSTEM" ]; then
132+
if [ "$DNS_SYSTEM" = "bind9" ]; then
133+
cp -f /etc/bind/*.conf $HESTIA_BACKUP/conf/$DNS_SYSTEM/
134+
fi
135+
fi
136+
if [ ! -z "$DB_SYSTEM" ]; then
137+
cp -f /etc/$DB_SYSTEM/*.cnf $HESTIA_BACKUP/conf/$DB_SYSTEM/
138+
cp -f /etc/$DB_SYSTEM/conf.d/*.cnf $HESTIA_BACKUP/conf/$DB_SYSTEM/
139+
fi
140+
if [ ! -z "$FTP_SYSTEM" ]; then
141+
cp -f /etc/$FTP_SYSTEM.conf $HESTIA_BACKUP/conf/$FTP_SYSTEM/
142+
fi
143+
if [ ! -z "$FIREWALL_EXTENSION" ]; then
144+
cp -f /etc/$FIREWALL_EXTENSION/*.conf $HESTIA_BACKUP/conf/$FIREWALL_EXTENSION/
145+
cp -f /etc/$FIREWALL_EXTENSION/*.local $HESTIA_BACKUP/conf/$FIREWALL_EXTENSION/
146+
fi
147+
if [ -e "/etc/ssh/sshd_config" ]; then
148+
cp -f /etc/ssh/sshd_config $HESTIA_BACKUP/conf/ssh/sshd_config
149+
fi
67150
}
68151

69152
upgrade_refresh_config() {
@@ -164,11 +247,34 @@ upgrade_start_routine() {
164247

165248
# Upgrade to Version 1.2.0
166249
if [ $VERSION = "1.1.1" ] || [ $VERSION = "1.1.2" ]; then
250+
source $HESTIA/install/upgrade/versions/previous/1.2.0.sh
251+
VERSION="1.2.1"
252+
upgrade_set_version $VERSION
253+
upgrade_refresh_config
254+
fi
255+
256+
257+
# Upgrade to Version 1.2.1
258+
if [ $VERSION = "1.2.0" ]; then
259+
# Process steps which may not have correctly executed from v1.1.0.
260+
echo
261+
echo "[ ! ] Reprocessing steps from v1.1.0 due to a previous installer bug..."
262+
echo
263+
source $HESTIA/install/upgrade/versions/previous/1.1.0.sh
264+
source $HESTIA/install/upgrade/versions/previous/1.2.0.sh
265+
VERSION="1.2.1"
266+
upgrade_refresh_config
267+
fi
268+
269+
270+
# Upgrade to Version 1.2.2
271+
if [ $VERSION = "1.2.1" ]; then
167272
source $HESTIA/install/upgrade/versions/latest.sh
168273
VERSION="$new_version"
169274
upgrade_refresh_config
170275
fi
171276

277+
172278
#####################################################################
173279
####### End version-specific upgrade instruction sets #######
174280
#####################################################################

install/hst-install-debian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
2323
VERBOSE='no'
2424

2525
# Define software versions
26-
HESTIA_INSTALL_VER='1.2.0'
26+
HESTIA_INSTALL_VER='1.2.2'
2727
pma_v='5.0.2'
2828
multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4")
2929
fpm_v="7.3"

install/hst-install-ubuntu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
2323
VERBOSE='no'
2424

2525
# Define software versions
26-
HESTIA_INSTALL_VER='1.2.0'
26+
HESTIA_INSTALL_VER='1.2.2'
2727
pma_v='5.0.2'
2828
multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4")
2929
fpm_v="7.3"

install/upgrade/versions/latest.sh

Lines changed: 1 addition & 213 deletions
Original file line numberDiff line numberDiff line change
@@ -1,223 +1,11 @@
11
#!/bin/sh
22

3-
# Hestia Control Panel upgrade script for target version 1.2.0
3+
# Hestia Control Panel upgrade script for target version 1.2.2
44

55
#######################################################################################
66
####### Place additional commands below. #######
77
#######################################################################################
88

9-
# Check iptables paths and add symlinks when necessary
10-
11-
if [ ! -e "/sbin/iptables" ]; then
12-
if which iptables; then
13-
ln -s "$(which iptables)" /sbin/iptables
14-
elif [ -e "/usr/sbin/iptables" ]; then
15-
ln -s /usr/sbin/iptables /sbin/iptables
16-
elif whereis -B /bin /sbin /usr/bin /usr/sbin -f -b iptables; then
17-
autoiptables=$(whereis -B /bin /sbin /usr/bin /usr/sbin -f -b iptables | cut -d '' -f 2)
18-
if [ -x "$autoiptables" ]; then
19-
ln -s "$autoiptables" /sbin/iptables
20-
fi
21-
fi
22-
fi
23-
24-
if [ ! -e "/sbin/iptables-save" ]; then
25-
if which iptables-save; then
26-
ln -s "$(which iptables-save)" /sbin/iptables-save
27-
elif [ -e "/usr/sbin/iptables-save" ]; then
28-
ln -s /usr/sbin/iptables-save /sbin/iptables-save
29-
elif whereis -B /bin /sbin /usr/bin /usr/sbin -f -b iptables-save; then
30-
autoiptables_save=$(whereis -B /bin /sbin /usr/bin /usr/sbin -f -b iptables-save | cut -d '' -f 2)
31-
if [ -x "$autoiptables_save" ]; then
32-
ln -s "$autoiptables_save" /sbin/iptables-save
33-
fi
34-
fi
35-
fi
36-
37-
if [ ! -e "/sbin/iptables-restore" ]; then
38-
if which iptables-restore; then
39-
ln -s "$(which iptables-restore)" /sbin/iptables-restore
40-
elif [ -e "/usr/sbin/iptables-restore" ]; then
41-
ln -s /usr/sbin/iptables-restore /sbin/iptables-restore
42-
elif whereis -B /bin /sbin /usr/bin /usr/sbin -f -b iptables-restore; then
43-
autoiptables_restore=$(whereis -B /bin /sbin /usr/bin /usr/sbin -f -b iptables-restore | cut -d '' -f 2)
44-
if [ -x "$autoiptables_restore" ]; then
45-
ln -s "$autoiptables_restore" /sbin/iptables-restore
46-
fi
47-
fi
48-
fi
49-
50-
if [ -e "/etc/apache2/mods-enabled/status.conf" ]; then
51-
sed -i '/Allow from all/d' /etc/apache2/mods-enabled/status.conf
52-
fi
53-
54-
# Add sury apache2 repository
55-
if [ "$WEB_SYSTEM" = "apache2" ] && [ ! -e "/etc/apt/sources.list.d/apache2.list" ]; then
56-
echo "[ * ] Configuring sury.org Apache2 repository..."
57-
58-
# Check OS and install related repository
59-
if [ -e "/etc/os-release" ]; then
60-
type=$(grep "^ID=" /etc/os-release | cut -f 2 -d '=')
61-
if [ "$type" = "ubuntu" ]; then
62-
codename="$(lsb_release -s -c)"
63-
echo "deb http://ppa.launchpad.net/ondrej/apache2/ubuntu $codename main" > /etc/apt/sources.list.d/apache2.list
64-
elif [ "$type" = "debian" ]; then
65-
codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
66-
echo "deb https://packages.sury.org/apache2/ $codename main" > /etc/apt/sources.list.d/apache2.list
67-
wget --quiet https://packages.sury.org/apache2/apt.gpg -O /tmp/apache2_signing.key
68-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/apache2_signing.key > /dev/null 2>&1
69-
fi
70-
fi
71-
fi
72-
73-
# Roundcube fixes for PHP 7.4 compatibility
74-
if [ -d /usr/share/roundcube ]; then
75-
echo "[ * ] Updating Roundcube configuration..."
76-
[ -f "/usr/share/roundcube/plugins/enigma/lib/enigma_ui.php" ] && sed -i 's/$identities, "\\n"/"\\n", $identities/g' /usr/share/roundcube/plugins/enigma/lib/enigma_ui.php
77-
[ -f "/usr/share/roundcube/program/lib/Roundcube/rcube_contacts.php" ] && sed -i 's/(array_keys($post_search), \x27|\x27)/(\x27|\x27, array_keys($post_search))/g' /usr/share/roundcube/program/lib/Roundcube/rcube_contacts.php
78-
[ -f "/usr/share/roundcube/program/lib/Roundcube/rcube_db.php" ] && sed -i 's/implode($name, \x27.\x27)/implode(\x27.\x27, $name)/g' /usr/share/roundcube/program/lib/Roundcube/rcube_db.php
79-
[ -f "/usr/share/roundcube/program/steps/addressbook/search.inc" ] && sed -i 's/$fields, \x27,\x27/\x27,\x27, $fields/g' /usr/share/roundcube/program/steps/addressbook/search.inc
80-
[ -f "/usr/share/roundcube/program/steps/addressbook/search.inc" ] && sed -i 's/implode($fields, \x27,\x27)/implode(\x27,\x27, $fields)/g' /usr/share/roundcube/program/steps/addressbook/search.inc
81-
[ -f "/usr/share/roundcube/program/steps/mail/sendmail.inc" ] && sed -i 's/implode($bstyle, \x27; \x27)/implode(\x27; \x27, $bstyle)/g' /usr/share/roundcube/program/steps/mail/sendmail.inc
82-
fi
83-
84-
# Enable Roundcube plugins
85-
if [ -d /usr/share/roundcube ]; then
86-
cp -f $HESTIA_INSTALL_DIR/roundcube/plugins/config_newmail_notifier.inc.php /etc/roundcube/plugins/newmail_notifier/config.inc.php
87-
cp -f $HESTIA_INSTALL_DIR/roundcube/plugins/config_zipdownload.inc.php /etc/roundcube/plugins/zipdownload/config.inc.php
88-
[ -f "/etc/roundcube/config.inc.php" ] && sed -i "s/array('password')/array('password','newmail_notifier','zipdownload')/g" /etc/roundcube/config.inc.php
89-
fi
90-
91-
# HELO support for multiple domains and IPs
92-
if [ -e "/etc/exim4/exim4.conf.template" ]; then
93-
echo "[ * ] Updating exim4 configuration..."
94-
sed -i 's|helo_data = ${primary_hostname}|helo_data = ${if exists {\/etc\/exim4\/mailhelo.conf}{${lookup{$sender_address_domain}lsearch*{\/etc\/exim4\/mailhelo.conf}{$value}{$primary_hostname}}}{$primary_hostname}}|g' /etc/exim4/exim4.conf.template
95-
fi
96-
97-
# Add daily midnight cron
98-
if [ -z "$($BIN/v-list-cron-jobs admin | grep 'v-update-sys-queue daily')" ]; then
99-
echo "[ * ] Updating cron jobs..."
100-
command="sudo $BIN/v-update-sys-queue daily"
101-
$BIN/v-add-cron-job 'admin' '01' '00' '*' '*' '*' "$command"
102-
fi
103-
[ ! -f "touch $HESTIA/data/queue/daily.pipe" ] && touch $HESTIA/data/queue/daily.pipe
104-
105-
# Remove existing network-up hooks so they get regenerated when updating the firewall
106-
# - network hook will also restore ipset config during start-up
107-
if [ -f "/usr/lib/networkd-dispatcher/routable.d/50-ifup-hooks" ]; then
108-
rm "/usr/lib/networkd-dispatcher/routable.d/50-ifup-hooks"
109-
$BIN/v-update-firewall
110-
fi
111-
if [ -f "/etc/network/if-pre-up.d/iptables" ];then
112-
rm "/etc/network/if-pre-up.d/iptables"
113-
$BIN/v-update-firewall
114-
fi
115-
116-
# Add hestia-event.conf, if the server is running apache2
117-
if [ "$WEB_SYSTEM" = "apache2" ]; then
118-
echo "[ * ] Updating Apache2 configuration..."
119-
# Cleanup
120-
rm --force /etc/apache2/mods-available/hestia-event.conf
121-
rm --force /etc/apache2/mods-enabled/hestia-event.conf
122-
rm --force /etc/apache2/conf-available/hestia-event.conf
123-
rm --force /etc/apache2/conf-enabled/hestia-event.conf
124-
125-
if [ $(a2query -M) = 'event' ] && [ ! -e "/etc/apache2/conf.d/hestia-event.conf" ]; then
126-
cp -f $HESTIA_INSTALL_DIR/apache2/hestia-event.conf /etc/apache2/conf.d/
127-
fi
128-
129-
# Move apache mod_status config to /mods-available and rename it to prevent losing changes on upgrade
130-
cp -f $HESTIA_INSTALL_DIR/apache2/status.conf /etc/apache2/mods-available/hestia-status.conf
131-
cp -f /etc/apache2/mods-available/status.load /etc/apache2/mods-available/hestia-status.load
132-
a2dismod --quiet status > /dev/null 2>&1
133-
a2enmod --quiet hestia-status > /dev/null 2>&1
134-
rm --force /etc/apache2/mods-enabled/status.conf # a2dismod will not remove the file if it isn't a symlink
135-
fi
136-
137-
# Install File Manager during upgrade if environment variable oesn't already exist and isn't set to false
138-
# so that we don't override preference
139-
FILE_MANAGER_CHECK=$(cat $HESTIA/conf/hestia.conf | grep "FILE_MANAGER='false'")
140-
if [ -z "$FILE_MANAGER_CHECK" ]; then
141-
if [ ! -e "$HESTIA/web/fm/configuration.php" ]; then
142-
echo "[ ! ] Installing File Manager..."
143-
# Install the File Manager
144-
$HESTIA/bin/v-add-sys-filemanager quiet
145-
else
146-
echo "[ * ] Updating File Manager configuration..."
147-
# Update configuration.php
148-
cp -f $HESTIA_INSTALL_DIR/filemanager/filegator/configuration.php $HESTIA/web/fm/configuration.php
149-
# Set environment variable for interface
150-
$HESTIA/bin/v-change-sys-config-value 'FILE_MANAGER' 'true'
151-
fi
152-
fi
153-
154-
# Enable nginx module loading
155-
if [ -f "/etc/nginx/nginx.conf" ]; then
156-
echo "[ * ] Updating NGINX configuration..."
157-
if [ ! -d "/etc/nginx/modules-enabled" ]; then
158-
mkdir -p "/etc/nginx/modules-enabled"
159-
fi
160-
161-
if ! grep --silent "include /etc/nginx/modules-enabled" /etc/nginx/nginx.conf; then
162-
sed -i '/^pid/ a include /etc/nginx/modules-enabled/*.conf;' /etc/nginx/nginx.conf
163-
fi
164-
fi
165-
166-
# Fix public_(s)html group ownership
167-
echo "[ * ] Updating public_(s)html ownership..."
168-
for user in $($HESTIA/bin/v-list-sys-users plain); do
169-
# skip users with missing home folder
170-
[[ -d /home/${user}/ ]] || continue
171-
172-
# skip users without web domains
173-
ls /home/${user}/web/*/public_*html >/dev/null 2>&1 || continue
174-
175-
chown --silent --no-dereference :www-data /home/$user/web/*/public_*html
176-
done
177-
178-
# Fix phpMyAdmin blowfish_secret error message due to incorrect permissions
179-
if [ -e /var/lib/phpmyadmin/blowfish_secret.inc.php ]; then
180-
echo "[ * ] Updating phpMyAdmin permissions..."
181-
chmod 0644 /var/lib/phpmyadmin/blowfish_secret.inc.php
182-
fi
183-
184-
# Ensure that backup compression level is correctly set
185-
GZIP_LVL_CHECK=$(cat $HESTIA/conf/hestia.conf | grep BACKUP_GZIP)
186-
if [ -z "$GZIP_LVL_CHECK" ]; then
187-
echo "[ * ] Updating backup compression level variable..."
188-
$BIN/v-change-sys-config-value "BACKUP_GZIP" '9'
189-
fi
190-
191-
# Update phpMyAdmin/phpPgAdmin templates and set missing alias variables if necessary
192-
if [ -e "/var/lib/phpmyadmin" ]; then
193-
PMA_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep DB_PMA_ALIAS)
194-
if [ -z "$PMA_ALIAS_CHECK" ]; then
195-
echo "[ * ] Updating phpMyAdmin alias..."
196-
$HESTIA/bin/v-change-sys-db-alias "pma" "phpMyAdmin"
197-
else
198-
echo "[ * ] Updating phpMyAdmin configuration..."
199-
$HESTIA/bin/v-change-sys-db-alias "pma" "$DB_PMA_ALIAS"
200-
fi
201-
fi
202-
203-
if [ -e "/var/lib/phppgadmin" ]; then
204-
PGA_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep DB_PGA_ALIAS)
205-
if [ -z "$PGA_ALIAS_CHECK" ]; then
206-
echo "[ * ] Updating phpPgAdmin alias..."
207-
$HESTIA/bin/v-change-sys-db-alias "pga" "phpPgAdmin"
208-
else
209-
echo "[ * ] Updating phpPgAdmin configuration..."
210-
$HESTIA/bin/v-change-sys-db-alias "pga" "$DB_PGA_ALIAS"
211-
fi
212-
fi
213-
214-
# Ensure that backup compression level is correctly set
215-
GZIP_LVL_CHECK=$(cat $HESTIA/conf/hestia.conf | grep BACKUP_GZIP)
216-
if [ -z "$GZIP_LVL_CHECK" ]; then
217-
echo "[ * ] Updating backup compression level variable..."
218-
$BIN/v-change-sys-config-value "BACKUP_GZIP" '9'
219-
fi
220-
2219
# Update template files to add warnings
22210
# Backup current templates
22311
cp -r -f $HESTIA/data/templates/* $HESTIA_BACKUP/templates/

0 commit comments

Comments
 (0)