Просмотр исходного кода

Staging/1.8.1 (#3767)

* Fix issue with Debian 10 and exim update

* Update versions

* Update error messsage

* Fix custom port

* Fix remarks

* Revert ipv6 support changes

* Also in start script

* See remarkt @myrevery

* Do not rebuild users for 1.8.1 update

* Also update ipv6 even it is not yet active

* Update changelog

* Update readme
Jaap Marcus 2 лет назад
Родитель
Сommit
cbd42675cc

+ 6 - 0
CHANGELOG.md

@@ -2,6 +2,12 @@
 
 All notable changes to this project will be documented in this file.
 
+## [1.8.1] - Service releae
+
+- Fixed Debian 10 not working with ip adresses check
+- Fixed Exim4 update config via patch was unreliable added few safety checks and add notice if failed.
+- Fixed hestia-nginx not loading with custom port
+
 ## [1.8.0] - Feature / Major release
 
 ### Notes

+ 1 - 1
README.md

@@ -4,7 +4,7 @@
 
 <h2 align="center">Lightweight and powerful control panel for the modern web</h2>
 
-<p align="center"><strong>Latest stable release:</strong> Version 1.8.0 | <a href="https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md">View Changelog</a></p>
+<p align="center"><strong>Latest stable release:</strong> Version 1.8.1 | <a href="https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md">View Changelog</a></p>
 
 <p align="center">
 	<a href="https://www.hestiacp.com/">HestiaCP.com</a> |

+ 1 - 1
bin/v-change-sys-port

@@ -56,7 +56,7 @@ check_hestia_demo_mode
 
 # Get original port
 LISTEN_ROWS=$(cat ${NGINX_CONFIG} | grep -c "listen")
-ORIGINAL_PORT=$(cat ${NGINX_CONFIG} | grep -m 1 "listen" | sed 's/[^0-9]*//g')
+ORIGINAL_PORT=$(cat ${NGINX_CONFIG} | grep -m1 "listen" | sed 's/[^0-9]*//g')
 
 # Check if port is different to nginx.conf
 if [ "$ORIGINAL_PORT" = "$PORT" ]; then

+ 1 - 1
bin/v-update-sys-ip

@@ -46,7 +46,7 @@ if [ -z "$physical_nics" ]; then
 fi
 
 for nic in $physical_nics; do
-	nic_ipv4s="$(ip -4 -d -j addr show "$nic" | jq -r '.[].addr_info[] | if .scope == "global" then .local else empty end')"
+	nic_ipv4s="$(ip -4 -d -j addr show "$nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end')"
 	if [ -z "$ips" ]; then
 		ips="$nic_ipv4s"
 	else

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

@@ -31,7 +31,7 @@ HESTIA_COMMON_DIR="$HESTIA/install/common"
 VERBOSE='no'
 
 # Define software versions
-HESTIA_INSTALL_VER='1.8.0'
+HESTIA_INSTALL_VER='1.8.1'
 # Dependencies
 multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2")
 fpm_v="8.1"
@@ -2076,9 +2076,9 @@ $HESTIA/bin/v-update-sys-ip > /dev/null 2>&1
 # Get primary IP
 default_nic="$(ip -d -j route show | jq -r '.[] | if .dst == "default" then .dev else empty end')"
 # IPv4
-primary_ipv4="$(ip -4 -d -j addr show "$default_nic" | jq -r '.[].addr_info[] | if .scope == "global" then .local else empty end' | head -n1)"
+primary_ipv4="$(ip -4 -d -j addr show "$default_nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end' | head -n1)"
 # IPv6
-#primary_ipv6="$(ip -6 -d -j addr show "$default_nic" | jq -r '.[].addr_info[] | if .scope == "global" then .local else empty end' | head -n1)"
+#primary_ipv6="$(ip -6 -d -j addr show "$default_nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end' | head -n1)"
 ip="$primary_ipv4"
 local_ip="$primary_ipv4"
 

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

@@ -31,7 +31,7 @@ HESTIA_COMMON_DIR="$HESTIA/install/common"
 VERBOSE='no'
 
 # Define software versions
-HESTIA_INSTALL_VER='1.8.0'
+HESTIA_INSTALL_VER='1.8.1'
 # Dependencies
 multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2")
 fpm_v="8.1"

+ 1 - 1
install/upgrade/patch/3661-exim-srs-support.patch

@@ -1,5 +1,5 @@
 17a18,19
-> SRS_SECRET = readfile{/etc/exim4/srs.conf}
+> SRS_SECRET = ${readfile{/etc/exim4/srs.conf}}
 >   
 326a332,348
 > inbound_srs:

+ 17 - 2
install/upgrade/versions/1.8.0.sh

@@ -257,8 +257,23 @@ if [ "$MAIL_SYSTEM" = "exim4" ]; then
 			echo $srs > /etc/exim4/srs.conf
 			chmod 640 /etc/exim4/srs.conf
 			chown root:Debian-exim /etc/exim4/srs.conf
-			echo "[ * ] Update exim4.conf.template ..."
-			patch /etc/exim4/exim4.conf.template $HESTIA/install/upgrade/patch/3661-exim-srs-support.patch
+			cp /etc/exim4/exim4.conf.template /etc/exim4/exim4.conf.template.staging
+			patch /etc/exim4/exim4.conf.template.staging $HESTIA/install/upgrade/patch/3661-exim-srs-support.patch 2>&1
+			exim -C /etc/exim4/exim4.conf.template.staging 2>&1
+			if [ "$?" -ne 0 ]; then
+				add_upgrade_message "Unable to successfully aply the SRS update patch for Exim.\n If you use SMTP relay with the SRS feature use the exim config found in /usr/local/hestia/install/deb/exim/exim4.conf.4.95.template"
+				"$BIN"/v-add-user-notification admin "Unable to apply patch to Exim config" 'Unable to successfully apply the SRS update patch for Exim.<br /> If you use SMTP relay with the SRS feature use the exim config found in /usr/local/hestia/install/deb/exim/exim4.conf.4.95.template'
+				if grep -qw "IMPORTANT: Manual Action Required" "$HESTIA"/data/users/admin/notifications.conf 2> /dev/null; then
+					sed -i "s/""$(grep -m 1 "Unable to apply patch to Exim config" "$HESTIA"/data/users/admin/notifications.conf | awk '{print $1}')""/NID='3'/" "$HESTIA"/data/users/admin/notifications.conf
+				else
+					sed -i "s/""$(grep -m 1 "Unable to apply patch to Exim config" "$HESTIA"/data/users/admin/notifications.conf | awk '{print $1}')""/NID='2'/" "$HESTIA"/data/users/admin/notifications.conf
+				fi
+				echo "[ ! ] Unable to apply SRS update patch for SMTP relay"
+			else
+				echo "[ * ] Update exim4.conf.template ..."
+				cp /etc/exim4/exim4.conf.template.staging /etc/exim4/exim4.conf.template
+			fi
+			rm /etc/exim4/exim4.conf.template.staging*
 		else
 			sed -i "s/SRS_SECRET = readfile{\/etc\/exim4\/srs.conf}/SRS_SECRET = \${readfile{\/etc\/exim4\/srs.conf}}/g" /etc/exim4/exim4.conf.template
 			chown root:Debian-exim /etc/exim4/srs.conf

+ 34 - 0
install/upgrade/versions/1.8.1.sh

@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# Hestia Control Panel upgrade script for target version 1.8.0
+
+#######################################################################################
+#######                      Place additional commands below.                   #######
+#######################################################################################
+####### upgrade_config_set_value only accepts true or false.                    #######
+#######                                                                         #######
+####### Pass through information to the end user in case of a issue or problem  #######
+#######                                                                         #######
+####### Use add_upgrade_message "My message here" to include a message          #######
+####### in the upgrade notification email. Example:                             #######
+#######                                                                         #######
+####### add_upgrade_message "My message here"                                   #######
+#######                                                                         #######
+####### You can use \n within the string to create new lines.                   #######
+#######################################################################################
+
+upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'true'
+upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'false'
+upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'true'
+upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'false'
+upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false'
+
+if [ "$MAIL_SYSTEM" = "exim4" ]; then
+	exim_version=$(exim4 --version | head -1 | awk '{print $3}' | cut -f -2 -d .)
+	# if Exim version > 4.95 or greater!
+	if version_ge "$exim_version" "4.95"; then
+		sed -i "s/SRS_SECRET = readfile{\/etc\/exim4\/srs.conf}/SRS_SECRET = \${readfile{\/etc\/exim4\/srs.conf}}/g" /etc/exim4/exim4.conf.template
+		chown root:Debian-exim /etc/exim4/srs.conf
+		chown 644 /etc/exim4/srs.conf
+	fi
+fi

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
 	"name": "hestia",
 	"private": true,
-	"version": "1.8.0",
+	"version": "1.8.1",
 	"description": "An open-source Linux web server control panel.",
 	"repository": "https://github.com/hestiacp/hestiacp",
 	"license": "GPL-3.0-or-later",

+ 1 - 1
src/deb/hestia/control

@@ -1,7 +1,7 @@
 Source: hestia
 Package: hestia
 Priority: optional
-Version: 1.8.0
+Version: 1.8.1
 Section: admin
 Maintainer: HestiaCP <info@hestiacp.com>
 Homepage: https://www.hestiacp.com

+ 1 - 1
src/deb/nginx/control

@@ -1,7 +1,7 @@
 Source: hestia-nginx
 Package: hestia-nginx
 Priority: optional
-Version: 1.25.1-1
+Version: 1.25.1-2
 Section: admin
 Maintainer: HestiaCP <info@hestiacp.com>
 Homepage: https://www.hestiacp.com

+ 3 - 3
src/deb/nginx/hestia

@@ -39,10 +39,10 @@ adapt_nginx_config() {
 	fi
 	for nic in $physical_nics; do
 		if [ -z "$ipv4_scope_global" ]; then
-			ipv4_scope_global="$(ip -4 -d -j addr show "$nic" | jq -r '.[].addr_info[] | if .scope == "global" then .local else empty end')"
+			ipv4_scope_global="$(ip -4 -d -j addr show "$nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end')"
 		fi
 		if [ -z "$ipv6_scope_global" ]; then
-			ipv6_scope_global="$(ip -6 -d -j addr show "$nic" | jq -r '.[].addr_info[] | if .scope == "global" then .local else empty end')"
+			ipv6_scope_global="$(ip -6 -d -j addr show "$nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end')"
 		fi
 	done
 
@@ -77,7 +77,7 @@ update_nginx_resolver() {
 }
 
 start_nginx() {
-	adapt_nginx_config
+	#adapt_nginx_config
 	update_nginx_resolver
 	start-stop-daemon --start --quiet --pidfile $NGINX_PID \
 		--retry 5 --exec $NGINX_DAEMON --oknodo

+ 1 - 2
src/deb/nginx/nginx.conf

@@ -115,8 +115,7 @@ http {
 
 	# Vhost
 	server {
-#IPV4		listen              8083 ssl;
-#IPV6		listen              [::]:8083 ssl;
+		listen              8083 ssl;
 		server_name         _;
 		root                /usr/local/hestia/web;
 		# Fix error "The plain HTTP request was sent to HTTPS port"

+ 1 - 1
src/rpm/hestia/hestia.spec

@@ -2,7 +2,7 @@
 %global _hardened_build 1
 
 Name:           hestia
-Version:        1.8.0
+Version:        1.8.1
 Release:        1%{dist}
 Summary:        Hestia Control Panel
 Group:          System Environment/Base