Skip to content

Commit 7d9e1bf

Browse files
shiwildyjaapmarcus
andauthored
Fix PhpMyAdmin bug, add RHEL to not supported os and fix typo in upgrade.conf (hestiacp#4634)
* fix: PhpMyAdmin config file invalid permission * fix: PhpMyAdmin config file invalid permission * feat: add rhel base to not supported * fix: typo * feat: add rhel to not supported * Run npm run format --------- Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
1 parent 3cae4f0 commit 7d9e1bf

File tree

4 files changed

+60
-58
lines changed

4 files changed

+60
-58
lines changed

install/hst-install-debian.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,14 +1859,14 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
18591859
cp -f $HESTIA_INSTALL_DIR/phpmyadmin/config.inc.php /etc/phpmyadmin/
18601860
mkdir -p /var/lib/phpmyadmin/tmp
18611861
chmod 770 /var/lib/phpmyadmin/tmp
1862-
chown root:hestiamail /usr/share/phpmyadmin/tmp
1862+
chown -R root:www-data /usr/share/phpmyadmin/tmp/
18631863

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

18671867
# Create temporary folder and change permission
18681868
chmod 770 /usr/share/phpmyadmin/tmp
1869-
chown root:hestiamail /usr/share/phpmyadmin/tmp
1869+
chown -R root:www-data /usr/share/phpmyadmin/tmp/
18701870

18711871
# Generate blow fish
18721872
blowfish=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)
@@ -1886,7 +1886,7 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
18861886

18871887
# Limit access to /etc/phpmyadmin/
18881888
chown -R root:www-data /etc/phpmyadmin/
1889-
chmod -R 640 /etc/phpmyadmin/*
1889+
chmod 640 /etc/phpmyadmin/config.inc.php
18901890
chmod 750 /etc/phpmyadmin/conf.d/
18911891
fi
18921892

install/hst-install-ubuntu.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,14 +1888,14 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
18881888
cp -f $HESTIA_INSTALL_DIR/phpmyadmin/config.inc.php /etc/phpmyadmin/
18891889
mkdir -p /var/lib/phpmyadmin/tmp
18901890
chmod 770 /var/lib/phpmyadmin/tmp
1891-
chown root:hestiamail /usr/share/phpmyadmin/tmp
1891+
chown -R root:www-data /usr/share/phpmyadmin/tmp/
18921892

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

18961896
# Create temporary folder and change permission
18971897
chmod 770 /usr/share/phpmyadmin/tmp
1898-
chown root:hestiamail /usr/share/phpmyadmin/tmp
1898+
chown -R root:www-data /usr/share/phpmyadmin/tmp/
18991899

19001900
# Generate blow fish
19011901
blowfish=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)
@@ -1915,7 +1915,7 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
19151915

19161916
# Limit access to /etc/phpmyadmin/
19171917
chown -R root:www-data /etc/phpmyadmin/
1918-
chmod -R 640 /etc/phpmyadmin/*
1918+
chmod 640 /etc/phpmyadmin/config.inc.php
19191919
chmod 750 /etc/phpmyadmin/conf.d/
19201920
fi
19211921

install/hst-install.sh

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,24 @@ if [ -e "/etc/os-release" ] && [ ! -e "/etc/redhat-release" ]; then
5555
elif [ "$type" = "debian" ]; then
5656
release=$(cat /etc/debian_version | grep -o "[0-9]\{1,2\}" | head -n1)
5757
VERSION='debian'
58+
else
59+
type="NoSupport"
5860
fi
59-
elif [ -e "/etc/os-release" ] && [ -e "/etc/redhat-release" ]; then
60-
type=$(grep "^ID=" /etc/os-release | cut -f 2 -d '"')
61-
if [ "$type" = "rhel" ]; then
62-
release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
63-
VERSION='rhel'
64-
elif [ "$type" = "almalinux" ]; then
65-
release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
66-
VERSION='almalinux'
67-
elif [ "$type" = "eurolinux" ]; then
68-
release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
69-
VERSION='eurolinux'
70-
elif [ "$type" = "rocky" ]; then
71-
release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
72-
VERSION='rockylinux'
73-
fi
61+
# elif [ -e "/etc/os-release" ] && [ -e "/etc/redhat-release" ]; then
62+
# type=$(grep "^ID=" /etc/os-release | cut -f 2 -d '"')
63+
# if [ "$type" = "rhel" ]; then
64+
# release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
65+
# VERSION='rhel'
66+
# elif [ "$type" = "almalinux" ]; then
67+
# release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
68+
# VERSION='almalinux'
69+
# elif [ "$type" = "eurolinux" ]; then
70+
# release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
71+
# VERSION='eurolinux'
72+
# elif [ "$type" = "rocky" ]; then
73+
# release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
74+
# VERSION='rockylinux'
75+
# fi
7476
else
7577
type="NoSupport"
7678
fi
@@ -95,57 +97,57 @@ fi
9597
check_wget_curl() {
9698
# Check wget
9799
if [ -e '/usr/bin/wget' ]; then
98-
if [ -e '/etc/redhat-release' ]; then
99-
wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-rhel.sh -O hst-install-rhel.sh
100-
if [ "$?" -eq '0' ]; then
101-
bash hst-install-rhel.sh $*
102-
exit
103-
else
104-
echo "Error: hst-install-rhel.sh download failed."
105-
exit 1
106-
fi
100+
# if [ -e '/etc/redhat-release' ]; then
101+
# wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-rhel.sh -O hst-install-rhel.sh
102+
# if [ "$?" -eq '0' ]; then
103+
# bash hst-install-rhel.sh $*
104+
# exit
105+
# else
106+
# echo "Error: hst-install-rhel.sh download failed."
107+
# exit 1
108+
# fi
109+
# else
110+
wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh -O hst-install-$type.sh
111+
if [ "$?" -eq '0' ]; then
112+
bash hst-install-$type.sh $*
113+
exit
107114
else
108-
wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh -O hst-install-$type.sh
109-
if [ "$?" -eq '0' ]; then
110-
bash hst-install-$type.sh $*
111-
exit
112-
else
113-
echo "Error: hst-install-$type.sh download failed."
114-
exit 1
115-
fi
115+
echo "Error: hst-install-$type.sh download failed."
116+
exit 1
116117
fi
118+
# fi
117119
fi
118120

119121
# Check curl
120122
if [ -e '/usr/bin/curl' ]; then
121-
if [ -e '/etc/redhat-release' ]; then
122-
curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-rhel.sh
123-
if [ "$?" -eq '0' ]; then
124-
bash hst-install-rhel.sh $*
125-
exit
126-
else
127-
echo "Error: hst-install-rhel.sh download failed."
128-
exit 1
129-
fi
123+
# if [ -e '/etc/redhat-release' ]; then
124+
# curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-rhel.sh
125+
# if [ "$?" -eq '0' ]; then
126+
# bash hst-install-rhel.sh $*
127+
# exit
128+
# else
129+
# echo "Error: hst-install-rhel.sh download failed."
130+
# exit 1
131+
# fi
132+
# else
133+
curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh
134+
if [ "$?" -eq '0' ]; then
135+
bash hst-install-$type.sh $*
136+
exit
130137
else
131-
curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh
132-
if [ "$?" -eq '0' ]; then
133-
bash hst-install-$type.sh $*
134-
exit
135-
else
136-
echo "Error: hst-install-$type.sh download failed."
137-
exit 1
138-
fi
138+
echo "Error: hst-install-$type.sh download failed."
139+
exit 1
139140
fi
141+
# fi
140142
fi
141143
}
142144

143145
# Check for supported operating system before proceeding with download
144146
# of OS-specific installer, and throw error message if unsupported OS detected.
145147
if [[ "$release" =~ ^(10|11|12|20.04|22.04|24.04)$ ]]; then
146148
check_wget_curl $*
147-
elif [[ -e "/etc/redhat-release" ]] && [[ "$release" =~ ^(8|9)$ ]]; then
148-
check_wget_curl $*
149+
# elif [[ -e "/etc/redhat-release" ]] && [[ "$release" =~ ^(8|9)$ ]]; then
150+
# check_wget_curl $*
149151
else
150152
no_support_message
151153
fi

install/upgrade/upgrade.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ UPGRADE_RESTART_SERVICES='true'
3535
#######################################################################################
3636

3737
# Supported PHP versions
38-
multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2"."8.3")
38+
multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2" "8.3")
3939

4040
#######################################################################################
4141
####### 3rd Party Software Updates #######

0 commit comments

Comments
 (0)