Sfoglia il codice sorgente

Merge remote-tracking branch 'upstream/main' into ipv6

asmcc 3 anni fa
parent
commit
5574c064a0

+ 2 - 0
CHANGELOG.md

@@ -64,6 +64,8 @@ All notable changes to this project will be documented in this file.
 - Fixed an issue with domain redirect and idn2 domains (#3323 #3325)
 - Fixed an issue in Dokuwiki due to changing repository owner (#3327)
 - Fixed an issue with B2 and changing access keys
+- Fixed an issue with Drupal install via Quick installer (#3353 #3352)
+- Fixed issues with default state jQuery UI modals (#3344)
 
 ### Dependencies
 

+ 8 - 1
bin/v-check-user-password

@@ -85,7 +85,14 @@ if [ -z "$salt" ]; then
 fi
 
 if [ "$method" = "yescrypt" ]; then
-	hash=$(mkpasswd "$password" "$shadow")
+	if which python3 > /dev/null; then
+		export PASS="$password" SALT="$shadow"
+		hash=$(python3 -c 'import crypt, os; print(crypt.crypt(os.getenv("PASS"), os.getenv("SALT")))')
+	else
+		# Fall back to mkpasswd as fallback
+		hash=$(mkpasswd "$password" "$shadow")
+	fi
+
 	if [ $? -ne 0 ]; then
 		echo "Error: password missmatch"
 		echo "$date $time $user $ip46 failed to login" >> $HESTIA/log/auth.log

+ 2 - 1
bin/v-list-sys-config

@@ -100,7 +100,8 @@ json_list() {
         "SERVER_SMTP_SECURITY": "'$SERVER_SMTP_SECURITY'",
         "SERVER_SMTP_USER": "'$SERVER_SMTP_USER'",
         "SERVER_SMTP_PASSWD": "'$SERVER_SMTP_PASSWD'",
-        "SERVER_SMTP_ADDR": "'$SERVER_SMTP_ADDR'"
+        "SERVER_SMTP_ADDR": "'$SERVER_SMTP_ADDR'",
+		"DISABLE_IP_CHECK": "'$DISABLE_IP_CHECK'"
     }
     }'
 }

+ 6 - 2
func/syshealth.sh

@@ -198,7 +198,7 @@ function syshealth_update_system_config_format() {
 	# SYSTEM CONFIGURATION
 	# Create array of known keys in configuration file
 	system="system"
-	known_keys="ANTISPAM_SYSTEM ANTIVIRUS_SYSTEM API_ALLOWED_IP API BACKEND_PORT BACKUP_GZIP BACKUP_MODE BACKUP_SYSTEM CRON_SYSTEM DB_PMA_ALIAS DB_SYSTEM DISK_QUOTA DNS_SYSTEM ENFORCE_SUBDOMAIN_OWNERSHIP FILE_MANAGER FIREWALL_EXTENSION FIREWALL_SYSTEM FTP_SYSTEM IMAP_SYSTEM INACTIVE_SESSION_TIMEOUT LANGUAGE LOGIN_STYLE MAIL_SYSTEM PROXY_PORT PROXY_SSL_PORT PROXY_SYSTEM RELEASE_BRANCH STATS_SYSTEM THEME UPDATE_HOSTNAME_SSL UPGRADE_SEND_EMAIL UPGRADE_SEND_EMAIL_LOG WEB_BACKEND WEBMAIL_ALIAS WEBMAIL_SYSTEM WEB_PORT WEB_RGROUPS WEB_SSL WEB_SSL_PORT WEB_SYSTEM VERSION"
+	known_keys="ANTISPAM_SYSTEM ANTIVIRUS_SYSTEM API_ALLOWED_IP API BACKEND_PORT BACKUP_GZIP BACKUP_MODE BACKUP_SYSTEM CRON_SYSTEM DB_PMA_ALIAS DB_SYSTEM DISK_QUOTA DNS_SYSTEM ENFORCE_SUBDOMAIN_OWNERSHIP FILE_MANAGER FIREWALL_EXTENSION FIREWALL_SYSTEM FTP_SYSTEM IMAP_SYSTEM INACTIVE_SESSION_TIMEOUT LANGUAGE LOGIN_STYLE MAIL_SYSTEM PROXY_PORT PROXY_SSL_PORT PROXY_SYSTEM RELEASE_BRANCH STATS_SYSTEM THEME UPDATE_HOSTNAME_SSL UPGRADE_SEND_EMAIL UPGRADE_SEND_EMAIL_LOG WEB_BACKEND WEBMAIL_ALIAS WEBMAIL_SYSTEM WEB_PORT WEB_RGROUPS WEB_SSL WEB_SSL_PORT WEB_SYSTEM VERSION DISABLE_IP_CHECK"
 	write_kv_config_file
 	unset system
 	unset known_keys
@@ -476,9 +476,13 @@ function syshealth_repair_system_config() {
 		$BIN/v-change-sys-config-value "POLICY_CSRF_STRICTNESS" "1"
 	fi
 	if [[ -z $(check_key_exists 'DNS_CLUSTER_SYSTEM') ]]; then
-		echo "[ ! ] Adding missing variable to hestia.conf: DNS_CLUSTER_SYSTEM ('')"
+		echo "[ ! ] Adding missing variable to hestia.conf: DNS_CLUSTER_SYSTEM ('hestia')"
 		$BIN/v-change-sys-config-value "DNS_CLUSTER_SYSTEM" "hestia"
 	fi
+	if [[ -z $(check_key_exists 'DISABLE_IP_CHECK') ]]; then
+		echo "[ ! ] Adding missing variable to hestia.conf: DISABLE_IP_CHECK ('no')"
+		$BIN/v-change-sys-config-value "DISABLE_IP_CHECK" "no"
+	fi
 
 	touch $HESTIA/conf/hestia.conf.new
 	while IFS='= ' read -r lhs rhs; do

+ 1 - 0
install/hst-install-debian.sh

@@ -2137,6 +2137,7 @@ write_config_value "SERVER_SMTP_USER" ""
 write_config_value "SERVER_SMTP_PASSWD" ""
 write_config_value "SERVER_SMTP_ADDR" ""
 write_config_value "POLICY_CSRF_STRICTNESS" "1"
+write_config_value "DISABLE_IP_CHECK" "no"
 
 # Add /usr/local/hestia/bin/ to path variable
 echo 'if [ "${PATH#*/usr/local/hestia/bin*}" = "$PATH" ]; then

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

@@ -2227,6 +2227,7 @@ write_config_value "SERVER_SMTP_USER" ""
 write_config_value "SERVER_SMTP_PASSWD" ""
 write_config_value "SERVER_SMTP_ADDR" ""
 write_config_value "POLICY_CSRF_STRICTNESS" "1"
+write_config_value "DISABLE_IP_CHECK" "no"
 
 # Add /usr/local/hestia/bin/ to path variable
 echo 'if [ "${PATH#*/usr/local/hestia/bin*}" = "$PATH" ]; then

+ 1 - 1
src/deb/php/control

@@ -1,7 +1,7 @@
 Source: hestia-php
 Package: hestia-php
 Priority: optional
-Version: 8.2.3
+Version: 8.2.4
 Section: admin
 Maintainer: HestaCP <info@hestiacp.com>
 Homepage: https://www.hestiacp.com

+ 1 - 1
src/hst_autocompile.sh

@@ -224,7 +224,7 @@ if [ -e "/etc/redhat-release" ]; then
 else
 	HESTIA_V="${BUILD_VER}_${BUILD_ARCH}"
 fi
-OPENSSL_V='3.0.8'
+OPENSSL_V='3.1.0'
 PCRE_V='10.42'
 ZLIB_V='1.2.13'
 

+ 6 - 3
src/lxd_build_all.sh

@@ -13,7 +13,8 @@
 #
 
 # Configs:
-oslist=('debian=9,10' 'ubuntu=18.04,20.04')
+# Use focal and jammy instead of "20.04 an 22.04"
+oslist=('debian=10,11' 'ubuntu=18.04,focal,jammy')
 branch='main'
 
 function setup_container() {
@@ -42,8 +43,10 @@ if [ -z "$user" ] || [ -z "$user_id" ] || [ -z "$user_gid" ] || [ "$user" = 'roo
 	echo "Script must be run with sudo, not directly as root" && exit 1
 fi
 
-if ! dpkg-query -s lxd > /dev/null 2>&1; then
-	apt -y install lxd
+if ! which lxd > /dev/null 2>&1; then
+	# Use snapd instead
+	apt -y install snapd
+	snap install lxd
 	lxd init --auto
 
 	echo "root:$user_id:1" | sudo tee -a /etc/subuid

+ 4 - 4
src/lxd_compile.sh

@@ -4,22 +4,22 @@ branch=${1-main}
 
 apt -y install curl wget
 
-curl https://raw.githubusercontent.com/hestiacp/hestiacp/main/src/hst_autocompile.sh > /tmp/hst_autocompile.sh
+curl https://raw.githubusercontent.com/hestiacp/hestiacp/$branch/src/hst_autocompile.sh > /tmp/hst_autocompile.sh
 chmod +x /tmp/hst_autocompile.sh
 
 mkdir -p /opt/hestiacp
 
 # Building Hestia
 if bash /tmp/hst_autocompile.sh --hestia --noinstall --keepbuild $branch; then
-	cp /tmp/hestiacp-src/debs/*.deb /opt/hestiacp/
+	cp /tmp/hestiacp-src/deb/*.deb /opt/hestiacp/
 fi
 
 # Building PHP
 if bash /tmp/hst_autocompile.sh --php --noinstall --keepbuild $branch; then
-	cp /tmp/hestiacp-src/debs/*.deb /opt/hestiacp/
+	cp /tmp/hestiacp-src/deb/*.deb /opt/hestiacp/
 fi
 
 # Building NGINX
 if bash /tmp/hst_autocompile.sh --nginx --noinstall --keepbuild $branch; then
-	cp /tmp/hestiacp-src/debs/*.deb /opt/hestiacp/
+	cp /tmp/hestiacp-src/deb/*.deb /opt/hestiacp/
 fi

+ 5 - 1
web/inc/main.php

@@ -66,7 +66,11 @@ if (!isset($_SESSION["user_combined_ip"])) {
 }
 
 // Checking user to use session from the same IP he has been logged in
-if ($_SESSION["user_combined_ip"] != $user_combined_ip && isset($_SESSION["user"])) {
+if (
+	$_SESSION["user_combined_ip"] != $user_combined_ip &&
+	isset($_SESSION["user"]) &&
+	$_SESSION["DISABLE_IP_CHECK"] != "yes"
+) {
 	$v_user = quoteshellarg($_SESSION["user"]);
 	$v_session_id = quoteshellarg($_SESSION["token"]);
 	exec(HESTIA_CMD . "v-log-user-logout " . $v_user . " " . $v_session_id, $output, $return_var);

+ 8 - 6
web/src/app/System/HestiaApp.php

@@ -117,7 +117,7 @@ class HestiaApp {
 		$this->runUser("v-run-cli-cmd", ["composer", "selfupdate", "--$version"]);
 	}
 
-	public function runComposer($args, &$cmd_result = null, $version = 2): bool {
+	public function runComposer($args, &$cmd_result = null, $data = []): bool {
 		$composer =
 			$this->getUserHomeDir() .
 			DIRECTORY_SEPARATOR .
@@ -125,15 +125,17 @@ class HestiaApp {
 			DIRECTORY_SEPARATOR .
 			"composer";
 		if (!is_file($composer)) {
-			$this->installComposer($version);
+			$this->installComposer($data["version"]);
 		} else {
-			$this->updateComposer($version);
+			$this->updateComposer($data["version"]);
+		}
+		if (empty($data["php_version"])) {
+			$data["php_version"] = "";
 		}
-
 		if (!empty($args) && is_array($args)) {
-			array_unshift($args, "composer");
+			array_unshift($args, "php" . $data["php_version"], $composer);
 		} else {
-			$args = ["composer", $args];
+			$args = ["php" . $data["php_version"], $composer, $args];
 		}
 
 		return $this->runUser("v-run-cli-cmd", $args, $cmd_result);

+ 7 - 1
web/src/app/WebApp/Installers/BaseSetup.php

@@ -104,7 +104,13 @@ abstract class BaseSetup implements InstallerInterface {
 			}
 
 			if ($res_type === "composer") {
-				new ComposerResource($this->appcontext, $res_data, $resource_destination);
+				$res_data["php_version"] = $options["php_version"];
+				new ComposerResource(
+					$this->appcontext,
+					$res_data,
+					$resource_destination,
+					$options["php_version"],
+				);
 			} elseif ($res_type === "wp") {
 				new WpResource(
 					$this->appcontext,

+ 5 - 2
web/src/app/WebApp/Installers/Drupal/DrupalSetup.php

@@ -38,8 +38,11 @@ class DrupalSetup extends BaseSetup {
 	public function install(array $options = null): bool {
 		parent::install($options);
 		parent::setup($options);
-
-		$this->appcontext->runComposer(["require", "-d " . $this->getDocRoot(), "drush/drush:^10"]);
+		$this->appcontext->runComposer(
+			["require", "-d " . $this->getDocRoot(), "drush/drush"],
+			$status2,
+			["version" => 2, "php_version" => $options["php_version"]],
+		);
 
 		$htaccess_rewrite = '
 <IfModule mod_rewrite.c>

+ 1 - 1
web/src/app/WebApp/Installers/Resources/ComposerResource.php

@@ -27,7 +27,7 @@ class ComposerResource {
 				$this->project,
 			],
 			$status,
-			$data["version"],
+			$data,
 		);
 
 		if ($status->code !== 0) {

+ 9 - 8
web/templates/pages/edit_mail_acc.php

@@ -94,6 +94,15 @@
 							</label>
 						</div>
 					</div>
+
+					<div id="v-fwd-opt">
+						<div class="u-mb10">
+							<label for="v_fwd" class="form-label">
+								<?= _("Forward to") ?> <span class="optional">(<?= _("one or more email addresses") ?>)</span>
+							</label>
+							<textarea class="form-control" name="v_fwd" id="v_fwd" <?php if($v_blackhole == 'yes') echo "disabled";?>><?=htmlentities(trim($v_fwd, "'"))?></textarea>
+						</div>
+					</div>
 					<div class="form-check u-mb10">
 						<input x-model="hasAutoReply" class="form-check-input" type="checkbox" name="v_autoreply" id="v_autoreply">
 						<label for="v_autoreply">
@@ -106,14 +115,6 @@
 							<textarea class="form-control" name="v_autoreply_message" id="v_autoreply_message"><?= htmlentities(trim($v_autoreply_message, "'")) ?></textarea>
 						</div>
 					</div>
-					<div id="v-fwd-opt">
-						<div class="u-mb10">
-							<label for="v_fwd" class="form-label">
-								<?= _("Forward to") ?> <span class="optional">(<?= _("one or more email addresses") ?>)</span>
-							</label>
-							<textarea class="form-control" name="v_fwd" id="v_fwd" <?php if($v_blackhole == 'yes') echo "disabled";?>><?=htmlentities(trim($v_fwd, "'"))?></textarea>
-						</div>
-					</div>
 					<div class="u-mb20">
 						<label for="v_rate" class="form-label">
 							<?= _("Rate limit") ?> <span class="optional">(<?= _("Email / hour") ?>)</span>

+ 5 - 1
web/templates/pages/list_dns.php

@@ -142,7 +142,11 @@
 				</div>
 				<!-- END QUICK ACTION TOOLBAR AREA -->
 				<div class="clearfix l-unit__stat-col--left u-text-center compact">
-					<?php if ($data[$key]['RECORDS']) echo '<span>'.$data[$key]['RECORDS'].'</span>';?>
+					<?php if ($data[$key]['RECORDS']){
+						echo '<span>'.$data[$key]['RECORDS'].'</span>';
+					}else{
+						echo '<span>0</span>';
+					}?>
 				</div>
 				<div class="clearfix l-unit__stat-col--left u-text-center"><b><?=$data[$key]['TPL']?></b></div>
 				<div class="clearfix l-unit__stat-col--left u-text-center compact"><?=$data[$key]['TTL']?></div>