Browse Source

Fix PhpMyAdmin bug, add RHEL to not supported os and fix typo in upgrade.conf (#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>
Wildy Sheverando 1 year ago
parent
commit
7d9e1bf138

+ 3 - 3
install/hst-install-debian.sh

@@ -1859,14 +1859,14 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
 	cp -f $HESTIA_INSTALL_DIR/phpmyadmin/config.inc.php /etc/phpmyadmin/
 	cp -f $HESTIA_INSTALL_DIR/phpmyadmin/config.inc.php /etc/phpmyadmin/
 	mkdir -p /var/lib/phpmyadmin/tmp
 	mkdir -p /var/lib/phpmyadmin/tmp
 	chmod 770 /var/lib/phpmyadmin/tmp
 	chmod 770 /var/lib/phpmyadmin/tmp
-	chown root:hestiamail /usr/share/phpmyadmin/tmp
+	chown -R root:www-data /usr/share/phpmyadmin/tmp/
 
 
 	# Set config and log directory
 	# Set config and log directory
 	sed -i "s|'configFile' => ROOT_PATH . 'config.inc.php',|'configFile' => '/etc/phpmyadmin/config.inc.php',|g" /usr/share/phpmyadmin/libraries/vendor_config.php
 	sed -i "s|'configFile' => ROOT_PATH . 'config.inc.php',|'configFile' => '/etc/phpmyadmin/config.inc.php',|g" /usr/share/phpmyadmin/libraries/vendor_config.php
 
 
 	# Create temporary folder and change permission
 	# Create temporary folder and change permission
 	chmod 770 /usr/share/phpmyadmin/tmp
 	chmod 770 /usr/share/phpmyadmin/tmp
-	chown root:hestiamail /usr/share/phpmyadmin/tmp
+	chown -R root:www-data /usr/share/phpmyadmin/tmp/
 
 
 	# Generate blow fish
 	# Generate blow fish
 	blowfish=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)
 	blowfish=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)
@@ -1886,7 +1886,7 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
 
 
 	# Limit access to /etc/phpmyadmin/
 	# Limit access to /etc/phpmyadmin/
 	chown -R root:www-data /etc/phpmyadmin/
 	chown -R root:www-data /etc/phpmyadmin/
-	chmod -R 640 /etc/phpmyadmin/*
+	chmod 640 /etc/phpmyadmin/config.inc.php
 	chmod 750 /etc/phpmyadmin/conf.d/
 	chmod 750 /etc/phpmyadmin/conf.d/
 fi
 fi
 
 

+ 3 - 3
install/hst-install-ubuntu.sh

@@ -1888,14 +1888,14 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
 	cp -f $HESTIA_INSTALL_DIR/phpmyadmin/config.inc.php /etc/phpmyadmin/
 	cp -f $HESTIA_INSTALL_DIR/phpmyadmin/config.inc.php /etc/phpmyadmin/
 	mkdir -p /var/lib/phpmyadmin/tmp
 	mkdir -p /var/lib/phpmyadmin/tmp
 	chmod 770 /var/lib/phpmyadmin/tmp
 	chmod 770 /var/lib/phpmyadmin/tmp
-	chown root:hestiamail /usr/share/phpmyadmin/tmp
+	chown -R root:www-data /usr/share/phpmyadmin/tmp/
 
 
 	# Set config and log directory
 	# Set config and log directory
 	sed -i "s|'configFile' => ROOT_PATH . 'config.inc.php',|'configFile' => '/etc/phpmyadmin/config.inc.php',|g" /usr/share/phpmyadmin/libraries/vendor_config.php
 	sed -i "s|'configFile' => ROOT_PATH . 'config.inc.php',|'configFile' => '/etc/phpmyadmin/config.inc.php',|g" /usr/share/phpmyadmin/libraries/vendor_config.php
 
 
 	# Create temporary folder and change permission
 	# Create temporary folder and change permission
 	chmod 770 /usr/share/phpmyadmin/tmp
 	chmod 770 /usr/share/phpmyadmin/tmp
-	chown root:hestiamail /usr/share/phpmyadmin/tmp
+	chown -R root:www-data /usr/share/phpmyadmin/tmp/
 
 
 	# Generate blow fish
 	# Generate blow fish
 	blowfish=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)
 	blowfish=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)
@@ -1915,7 +1915,7 @@ if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
 
 
 	# Limit access to /etc/phpmyadmin/
 	# Limit access to /etc/phpmyadmin/
 	chown -R root:www-data /etc/phpmyadmin/
 	chown -R root:www-data /etc/phpmyadmin/
-	chmod -R 640 /etc/phpmyadmin/*
+	chmod 640 /etc/phpmyadmin/config.inc.php
 	chmod 750 /etc/phpmyadmin/conf.d/
 	chmod 750 /etc/phpmyadmin/conf.d/
 fi
 fi
 
 

+ 53 - 51
install/hst-install.sh

@@ -55,22 +55,24 @@ if [ -e "/etc/os-release" ] && [ ! -e "/etc/redhat-release" ]; then
 	elif [ "$type" = "debian" ]; then
 	elif [ "$type" = "debian" ]; then
 		release=$(cat /etc/debian_version | grep -o "[0-9]\{1,2\}" | head -n1)
 		release=$(cat /etc/debian_version | grep -o "[0-9]\{1,2\}" | head -n1)
 		VERSION='debian'
 		VERSION='debian'
+	else
+		type="NoSupport"
 	fi
 	fi
-elif [ -e "/etc/os-release" ] && [ -e "/etc/redhat-release" ]; then
-	type=$(grep "^ID=" /etc/os-release | cut -f 2 -d '"')
-	if [ "$type" = "rhel" ]; then
-		release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
-		VERSION='rhel'
-	elif [ "$type" = "almalinux" ]; then
-		release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
-		VERSION='almalinux'
-	elif [ "$type" = "eurolinux" ]; then
-		release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
-		VERSION='eurolinux'
-	elif [ "$type" = "rocky" ]; then
-		release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
-		VERSION='rockylinux'
-	fi
+# elif [ -e "/etc/os-release" ] && [ -e "/etc/redhat-release" ]; then
+# 	type=$(grep "^ID=" /etc/os-release | cut -f 2 -d '"')
+# 	if [ "$type" = "rhel" ]; then
+# 		release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
+# 		VERSION='rhel'
+# 	elif [ "$type" = "almalinux" ]; then
+# 		release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
+# 		VERSION='almalinux'
+# 	elif [ "$type" = "eurolinux" ]; then
+# 		release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
+# 		VERSION='eurolinux'
+# 	elif [ "$type" = "rocky" ]; then
+# 		release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
+# 		VERSION='rockylinux'
+# 	fi
 else
 else
 	type="NoSupport"
 	type="NoSupport"
 fi
 fi
@@ -95,48 +97,48 @@ fi
 check_wget_curl() {
 check_wget_curl() {
 	# Check wget
 	# Check wget
 	if [ -e '/usr/bin/wget' ]; then
 	if [ -e '/usr/bin/wget' ]; then
-		if [ -e '/etc/redhat-release' ]; then
-			wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-rhel.sh -O hst-install-rhel.sh
-			if [ "$?" -eq '0' ]; then
-				bash hst-install-rhel.sh $*
-				exit
-			else
-				echo "Error: hst-install-rhel.sh download failed."
-				exit 1
-			fi
+		# if [ -e '/etc/redhat-release' ]; then
+		# 	wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-rhel.sh -O hst-install-rhel.sh
+		# 	if [ "$?" -eq '0' ]; then
+		# 		bash hst-install-rhel.sh $*
+		# 		exit
+		# 	else
+		# 		echo "Error: hst-install-rhel.sh download failed."
+		# 		exit 1
+		# 	fi
+		# else
+		wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh -O hst-install-$type.sh
+		if [ "$?" -eq '0' ]; then
+			bash hst-install-$type.sh $*
+			exit
 		else
 		else
-			wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh -O hst-install-$type.sh
-			if [ "$?" -eq '0' ]; then
-				bash hst-install-$type.sh $*
-				exit
-			else
-				echo "Error: hst-install-$type.sh download failed."
-				exit 1
-			fi
+			echo "Error: hst-install-$type.sh download failed."
+			exit 1
 		fi
 		fi
+		# fi
 	fi
 	fi
 
 
 	# Check curl
 	# Check curl
 	if [ -e '/usr/bin/curl' ]; then
 	if [ -e '/usr/bin/curl' ]; then
-		if [ -e '/etc/redhat-release' ]; then
-			curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-rhel.sh
-			if [ "$?" -eq '0' ]; then
-				bash hst-install-rhel.sh $*
-				exit
-			else
-				echo "Error: hst-install-rhel.sh download failed."
-				exit 1
-			fi
+		# if [ -e '/etc/redhat-release' ]; then
+		# 	curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-rhel.sh
+		# 	if [ "$?" -eq '0' ]; then
+		# 		bash hst-install-rhel.sh $*
+		# 		exit
+		# 	else
+		# 		echo "Error: hst-install-rhel.sh download failed."
+		# 		exit 1
+		# 	fi
+		# else
+		curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh
+		if [ "$?" -eq '0' ]; then
+			bash hst-install-$type.sh $*
+			exit
 		else
 		else
-			curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh
-			if [ "$?" -eq '0' ]; then
-				bash hst-install-$type.sh $*
-				exit
-			else
-				echo "Error: hst-install-$type.sh download failed."
-				exit 1
-			fi
+			echo "Error: hst-install-$type.sh download failed."
+			exit 1
 		fi
 		fi
+		# fi
 	fi
 	fi
 }
 }
 
 
@@ -144,8 +146,8 @@ check_wget_curl() {
 # of OS-specific installer, and throw error message if unsupported OS detected.
 # of OS-specific installer, and throw error message if unsupported OS detected.
 if [[ "$release" =~ ^(10|11|12|20.04|22.04|24.04)$ ]]; then
 if [[ "$release" =~ ^(10|11|12|20.04|22.04|24.04)$ ]]; then
 	check_wget_curl $*
 	check_wget_curl $*
-elif [[ -e "/etc/redhat-release" ]] && [[ "$release" =~ ^(8|9)$ ]]; then
-	check_wget_curl $*
+# elif [[ -e "/etc/redhat-release" ]] && [[ "$release" =~ ^(8|9)$ ]]; then
+# 	check_wget_curl $*
 else
 else
 	no_support_message
 	no_support_message
 fi
 fi

+ 1 - 1
install/upgrade/upgrade.conf

@@ -35,7 +35,7 @@ UPGRADE_RESTART_SERVICES='true'
 #######################################################################################
 #######################################################################################
 
 
 # Supported PHP versions
 # Supported PHP versions
-multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2"."8.3")
+multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2" "8.3")
 
 
 #######################################################################################
 #######################################################################################
 #######                        3rd Party Software Updates                       #######
 #######                        3rd Party Software Updates                       #######