Skip to content

Commit 2901b01

Browse files
authored
Fix small bugs caused by hestiamail user in main branch (hestiacp#4134)
* Changes snappy mail * Fix permissions Webmail / PHPmyadmin Fix also issues with permissions * Fix bug with update check not working
1 parent e000808 commit 2901b01

File tree

7 files changed

+65
-25
lines changed

7 files changed

+65
-25
lines changed

bin/v-add-sys-roundcube

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ if [ "$UPDATE" == "no" ]; then
116116
ln -s $RC_CONFIG_DIR/plugins/zipdownload/config.inc.php ./plugins/zipdownload/config.inc.php
117117

118118
# Set up correct permissions roundcube
119-
chown -R root:www-data $RC_CONFIG_DIR/
119+
chown -R root:hestiamail $RC_CONFIG_DIR/
120120
chmod 751 -R $RC_CONFIG_DIR
121121
chmod 644 $RC_CONFIG_DIR/config.inc.php
122122
chmod 644 $RC_CONFIG_DIR/plugins/password/config.inc.php
@@ -127,13 +127,13 @@ if [ "$UPDATE" == "no" ]; then
127127
echo "User-agent: *" > /var/lib/roundcube/robots.txt
128128
echo "Disallow: /" >> /var/lib/roundcube/robots.txt
129129

130-
chown -R root:www-data $RC_INSTALL_DIR
130+
chown -R root:hestiamail $RC_INSTALL_DIR
131131

132132
# Log file
133133
if [ ! -d $RC_LOG ]; then
134134
mkdir $RC_LOG
135135
fi
136-
chown www-data:www-data $RC_LOG
136+
chown hestiamail:hestiamail $RC_LOG
137137
chmod 751 $RC_LOG
138138

139139
if [ ! -z "$(echo "$DB_SYSTEM" | grep -E 'mysql|pgsql')" ]; then
@@ -189,9 +189,10 @@ else
189189
$RC_INSTALL_DIR/$RC_EXTRACT/bin/installto.sh -y $RC_INSTALL_DIR > /dev/null 2>&1
190190
# Use COMPOSER_ALLOW_SUPERUSER=1 to prevent update.sh script from freezing trying
191191
# to execute composer as root to update roundcube dependencies
192-
COMPOSER_ALLOW_SUPERUSER=1 $RC_INSTALL_DIR/bin/update.sh --version "$version" > /dev/null 2>&1
192+
export COMPOSER_ALLOW_SUPERUSER=1
193+
$RC_INSTALL_DIR/bin/update.sh --version "$version" > /dev/null 2>&1
193194
$RC_INSTALL_DIR/bin/indexcontacts.sh > /dev/null 2>&1
194-
chown -R root:www-data $RC_INSTALL_DIR
195+
chown -R root:hestiamail $RC_INSTALL_DIR
195196

196197
#clean up the mess
197198
if [ -d "$RC_INSTALL_DIR/installer" ]; then

bin/v-add-sys-snappymail

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,22 @@ if [ "$UPDATE" == "no" ]; then
144144

145145
else
146146
[ ! -f "${SM_INSTALL_DIR}/${SM_FILE}" ] && wget "$SM_URL" --quiet -O "${SM_INSTALL_DIR}/${SM_FILE}"
147-
version=$(cat $SM_INSTALL_DIR/data/VERSION)
148-
149-
tar -xzf snappymail-latest.tar.gz "data/VERSION" $SM_INSTALL_DIR/
150-
version_source=$(cat $SM_INSTALL_DIR/VERSION)
147+
if [ ! -f "${SM_INSTALL_DIR}/${SM_FILE}" ]; then
148+
echo "ERROR: Download failed, installation aborted."
149+
exit 2
150+
fi
151151

152+
version=$(cat $SM_INSTALL_DIR/data/VERSION)
153+
cd $SM_INSTALL_DIR
154+
mkdir -p /tmp/snappy/
155+
tar -xzf snappymail-latest.tar.gz -C /tmp/snappy/
156+
version_source=$(cat /tmp/snappy/data/VERSION)
152157
# Check version inside .tar.gz file in case hestia didn't update yet
153158
if [ "$version" != "$version_source" ]; then
154159
tar -xzf ${SM_INSTALL_DIR}/${SM_FILE}
155160
rm $SM_INSTALL_DIR/$SM_FILE
156161
fi
157-
rm ${SM_INSTALL_DIR}/VERSION
162+
rm -fr /tmp/snappy
158163
fi
159164

160165
#----------------------------------------------------------#

func/upgrade.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,11 @@ upgrade_phpmyadmin() {
621621
echo "[ * ] phpMyAdmin is up to date (${pma_version})..."
622622
# Update permissions
623623
if [ -e /var/lib/phpmyadmin/blowfish_secret.inc.php ]; then
624-
chown root:www-data /var/lib/phpmyadmin/blowfish_secret.inc.php
624+
chown root:hestiamail /var/lib/phpmyadmin/blowfish_secret.inc.php
625625
chmod 0640 /var/lib/phpmyadmin/blowfish_secret.inc.php
626626
fi
627+
chown root:hestiamail /usr/share/phpmyadmin/tmp
628+
chmod 0770 /usr/share/phpmyadmin/tmp
627629
else
628630
# Display upgrade information
629631
echo "[ * ] Upgrading phpMyAdmin to version $pma_v..."
@@ -647,13 +649,13 @@ upgrade_phpmyadmin() {
647649
# Create temporary folder and change permissions
648650
if [ ! -d /usr/share/phpmyadmin/tmp ]; then
649651
mkdir /usr/share/phpmyadmin/tmp
650-
chown root:www-data /usr/share/phpmyadmin/tmp
652+
chown root:hestiamail /usr/share/phpmyadmin/tmp
651653
chmod 0770 /usr/share/phpmyadmin/tmp
652654

653655
fi
654656

655657
if [ -e /var/lib/phpmyadmin/blowfish_secret.inc.php ]; then
656-
chown root:www-data /var/lib/phpmyadmin/blowfish_secret.inc.php
658+
chown root:hestiamail /var/lib/phpmyadmin/blowfish_secret.inc.php
657659
chmod 0640 /var/lib/phpmyadmin/blowfish_secret.inc.php
658660
fi
659661

install/hst-install-debian.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,14 +1785,14 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
17851785
cp -f $HESTIA_INSTALL_DIR/phpmyadmin/config.inc.php /etc/phpmyadmin/
17861786
mkdir -p /var/lib/phpmyadmin/tmp
17871787
chmod 770 /var/lib/phpmyadmin/tmp
1788-
chown root:www-data /usr/share/phpmyadmin/tmp
1788+
chown root:hestiamail /usr/share/phpmyadmin/tmp
17891789

17901790
# Set config and log directory
17911791
sed -i "s|'configFile' => ROOT_PATH . 'config.inc.php',|'configFile' => '/etc/phpmyadmin/config.inc.php',|g" /usr/share/phpmyadmin/libraries/vendor_config.php
17921792

17931793
# Create temporary folder and change permission
17941794
chmod 770 /usr/share/phpmyadmin/tmp
1795-
chown root:www-data /usr/share/phpmyadmin/tmp
1795+
chown root:hestiamail /usr/share/phpmyadmin/tmp
17961796

17971797
# Generate blow fish
17981798
blowfish=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)
@@ -1811,7 +1811,7 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
18111811
source $HESTIA_INSTALL_DIR/phpmyadmin/pma.sh > /dev/null 2>&1
18121812

18131813
# limit access to /etc/phpmyadmin/
1814-
chown -R root:www-data /etc/phpmyadmin/
1814+
chown -R root:hestiamail /etc/phpmyadmin/
18151815
chmod -R 640 /etc/phpmyadmin/*
18161816
chmod 750 /etc/phpmyadmin/conf.d/
18171817
fi
@@ -2131,7 +2131,7 @@ if [ "$sieve" = 'yes' ]; then
21312131
mkdir -p $RC_CONFIG_DIR/plugins/managesieve
21322132
cp -f $HESTIA_COMMON_DIR/roundcube/plugins/config_managesieve.inc.php $RC_CONFIG_DIR/plugins/managesieve/config.inc.php
21332133
ln -s $RC_CONFIG_DIR/plugins/managesieve/config.inc.php $RC_INSTALL_DIR/plugins/managesieve/config.inc.php
2134-
chown -R root:www-data $RC_CONFIG_DIR/
2134+
chown -R root:hestiamail $RC_CONFIG_DIR/
21352135
chmod 751 -R $RC_CONFIG_DIR
21362136
chmod 644 $RC_CONFIG_DIR/*.php
21372137
chmod 644 $RC_CONFIG_DIR/plugins/managesieve/config.inc.php

install/hst-install-ubuntu.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,14 +1783,14 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
17831783
cp -f $HESTIA_INSTALL_DIR/phpmyadmin/config.inc.php /etc/phpmyadmin/
17841784
mkdir -p /var/lib/phpmyadmin/tmp
17851785
chmod 770 /var/lib/phpmyadmin/tmp
1786-
chown root:www-data /usr/share/phpmyadmin/tmp
1786+
chown root:hestiamail /usr/share/phpmyadmin/tmp
17871787

17881788
# Set config and log directory
17891789
sed -i "s|'configFile' => ROOT_PATH . 'config.inc.php',|'configFile' => '/etc/phpmyadmin/config.inc.php',|g" /usr/share/phpmyadmin/libraries/vendor_config.php
17901790

17911791
# Create temporary folder and change permission
17921792
chmod 770 /usr/share/phpmyadmin/tmp
1793-
chown root:www-data /usr/share/phpmyadmin/tmp
1793+
chown root:hestiamail /usr/share/phpmyadmin/tmp
17941794

17951795
# Generate blow fish
17961796
blowfish=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)
@@ -1809,7 +1809,7 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
18091809
source $HESTIA_INSTALL_DIR/phpmyadmin/pma.sh > /dev/null 2>&1
18101810

18111811
# limit access to /etc/phpmyadmin/
1812-
chown -R root:www-data /etc/phpmyadmin/
1812+
chown -R root:hestiamail /etc/phpmyadmin/
18131813
chmod -R 640 /etc/phpmyadmin/*
18141814
chmod 750 /etc/phpmyadmin/conf.d/
18151815
fi
@@ -2093,7 +2093,7 @@ if [ "$sieve" = 'yes' ]; then
20932093
mkdir -p $RC_CONFIG_DIR/plugins/managesieve
20942094
cp -f $HESTIA_COMMON_DIR/roundcube/plugins/config_managesieve.inc.php $RC_CONFIG_DIR/plugins/managesieve/config.inc.php
20952095
ln -s $RC_CONFIG_DIR/plugins/managesieve/config.inc.php $RC_INSTALL_DIR/plugins/managesieve/config.inc.php
2096-
chown -R root:www-data $RC_CONFIG_DIR/
2096+
chown -R root:hestiamail $RC_CONFIG_DIR/
20972097
chmod 751 -R $RC_CONFIG_DIR
20982098
chmod 644 $RC_CONFIG_DIR/*.php
20992099
chmod 644 $RC_CONFIG_DIR/plugins/managesieve/config.inc.php

install/upgrade/upgrade.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2")
4646
pma_v='5.2.1'
4747

4848
# Set version of phppgadmin to install during upgrade if not already installed
49-
pga_v='7.14.5'
49+
pga_v='7.14.6'
5050

5151
# Set version of RoundCube (Webmail) to update during upgrade if not already installed
5252
# Note: only applies to "non-apt installs >= 1.4.0 or manually phased out"
53-
rc_v='1.6.2'
53+
rc_v='1.6.5'
5454

5555
# Set version of SnappyMail (Webmail) to update during upgrade if not already installed
56-
sm_v='2.28.4'
56+
sm_v='2.29.1'
5757

5858
# Update the File Manager or it's configuration file
5959
# Check if Filegator requires an update based on current version and setting below
6060
# UPGRADE_UPDATE_FILEMANAGER_CONFIG: Updates only the configuration file if changes are made but now new issue has been issued!
6161
UPGRADE_UPDATE_FILEMANAGER_CONFIG='false'
6262
# Set version of File manager to update during upgrade if not already installed
63-
fm_v='7.9.2'
63+
fm_v='7.9.3'
6464

6565
# Backblaze
6666
b2_v='3.6.0'

install/upgrade/versions/1.8.11.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
# Hestia Control Panel upgrade script for target version 1.8.11
4+
5+
#######################################################################################
6+
####### Place additional commands below. #######
7+
#######################################################################################
8+
####### upgrade_config_set_value only accepts true or false. #######
9+
####### #######
10+
####### Pass through information to the end user in case of a issue or problem #######
11+
####### #######
12+
####### Use add_upgrade_message "My message here" to include a message #######
13+
####### in the upgrade notification email. Example: #######
14+
####### #######
15+
####### add_upgrade_message "My message here" #######
16+
####### #######
17+
####### You can use \n within the string to create new lines. #######
18+
#######################################################################################
19+
20+
upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'false'
21+
upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'false'
22+
upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'false'
23+
upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'false'
24+
upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false'
25+
26+
# Folder paths
27+
SM_INSTALL_DIR="/var/lib/snappymail"
28+
SM_CONFIG_DIR="/etc/snappymail"
29+
SM_LOG="/var/log/snappymail"
30+
31+
chown hestiamail:hestiamail /var/lib/snappymail
32+
chown hestiamail:hestiamail /etc/snappymail

0 commit comments

Comments
 (0)