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

Merge branch 'main' into release

Jaap Marcus 3 лет назад
Родитель
Сommit
3a9638fbbd

+ 8 - 0
CHANGELOG.md

@@ -1,6 +1,14 @@
 # Changelog
 All notable changes to this project will be documented in this file.
 
+## [1.6.4] - Service release 
+
+### Bugfixes
+
+- Fixed an issue with downloading log files ()
+- Fixed an issue with installing Quick Installers (#2762, #2760, @divinity76)
+- Fixed an issue with Apache Access / Awstats logs IP after using v-update-sys-ip (#2759 @adion-gorani)
+
 ## [1.6.3] - Service release 
 
 ### Features

+ 1 - 1
README.md

@@ -2,7 +2,7 @@
 
 [Hestia Control Panel](https://www.hestiacp.com/)
 ==================================================
-**Latest stable release:** Version 1.6.3 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md) | [![Build Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp) <br>
+**Latest stable release:** Version 1.6.4 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md) | [![Build Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp) <br>
 
 **Web:** [www.hestiacp.com](https://www.hestiacp.com/)<br>
 **Documentation:** [docs.hestiacp.com](https://docs.hestiacp.com/)<br>

+ 9 - 0
bin/v-update-sys-ip

@@ -72,6 +72,15 @@ if [ ! -z "$new" ]; then
             sed -i "s/$old/$new/g" $HESTIA/data/users/$user/web.conf
             $BIN/v-rebuild-web-domains "$user" no
         done
+        
+        if [ -e "/etc/apache2/mods-available/remoteip.conf" ]; then
+           sed -i "s/$old/$new/g" /etc/apache2/mods-available/remoteip.conf
+        fi
+        
+        if [ -e "/etc/apache2/mods-enabled/rpaf.conf" ]; then
+           sed -i "s/$old/$new/g" /etc/apache2/mods-enabled/rpaf.conf
+        fi
+        
         $BIN/v-restart-proxy
         $BIN/v-restart-web
     fi

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

@@ -31,7 +31,7 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
 VERBOSE='no'
 
 # Define software versions
-HESTIA_INSTALL_VER='1.6.3'
+HESTIA_INSTALL_VER='1.6.4'
 # Dependencies
 multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1")
 fpm_v="8.0"

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

@@ -31,7 +31,7 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
 VERBOSE='no'
 
 # Define software versions
-HESTIA_INSTALL_VER='1.6.3'
+HESTIA_INSTALL_VER='1.6.4'
 # Dependencies
 multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1")
 fpm_v="8.0"

+ 1 - 1
src/deb/hestia/control

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

+ 1 - 0
web/api/index.php

@@ -1,5 +1,6 @@
 <?php
 //die("Error: Disabled");
+define('HESTIA_DIR_BIN', '/usr/local/hestia/bin/');
 define('HESTIA_CMD', '/usr/bin/sudo /usr/local/hestia/bin/');
 
 include($_SERVER['DOCUMENT_ROOT']."/inc/helpers.php");

+ 2 - 1
web/download/web-log/index.php

@@ -26,12 +26,13 @@ if ($_GET['type'] == 'error') {
     $type = 'error';
 }
 $cmd = implode(" ", array(
-    escapeshellarg(HESTIA_CMD . "v-list-web-domain-" . $type . "log"),
+    '/usr/bin/sudo ' . escapeshellarg(HESTIA_DIR_BIN . "v-list-web-domain-" . $type . "log"),
     // $user is already shell-escaped
     $user,
     escapeshellarg($v_domain),
     "5000",
 ));
+
 passthru($cmd, $return_var);
 if ($return_var != 0) {
     $errstr = "Internal server error: command returned non-zero: {$return_var}: {$cmd}";

+ 1 - 0
web/inc/main.php

@@ -15,6 +15,7 @@ if (!file_exists(dirname(__FILE__).'/vendor/autoload.php')) {
 
 require 'vendor/autoload.php';
 
+define('HESTIA_DIR_BIN', '/usr/local/hestia/bin/');
 define('HESTIA_CMD', '/usr/bin/sudo /usr/local/hestia/bin/');
 define('DEFAULT_PHP_VERSION', 'php-' . exec('php -r "echo substr(phpversion(),0,3);"'));
 

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

@@ -16,14 +16,15 @@ class HestiaApp
 
     public function run(string $cmd, $args, &$cmd_result=null): bool
     {
-        $cli_script = realpath(HESTIA_CMD . '/' . $cmd);
-        if(!str_starts_with((string)$cli_script, HESTIA_CMD."/" )){
-            $errstr = "$cmd is trying to traverse outside of " .HESTIA_CMD;
+        $cli_script = realpath(HESTIA_DIR_BIN . $cmd);
+        if (!str_starts_with((string) $cli_script, HESTIA_DIR_BIN)) {
+            $errstr = "$cmd is trying to traverse outside of " . HESTIA_DIR_BIN;
             trigger_error($errstr);
-            throw new \Exception($errstr);   
+            throw new \Exception($errstr);
         }
-        $cli_script = escapeshellarg($cli_script);
-
+        $cli_script = '/usr/bin/sudo ' . escapeshellarg($cli_script);
+        
+        $cli_arguments = '';
         if (!empty($args) && is_array($args)) {
             foreach ($args as $arg) {
                 $cli_arguments .= escapeshellarg((string)$arg) . ' ';

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

@@ -52,9 +52,9 @@ class DrupalSetup extends BaseSetup {
         $tmp_configpath = $this->saveTempFile($htaccess_rewrite);
         $this->appcontext->runUser('v-move-fs-file',[$tmp_configpath, $this->getDocRoot(".htaccess")], $result);
         
-        $php_version = $this -> appcontext -> getSupportedPHP($this -> config['server']['php']['supported']);
+       
         $this -> appcontext -> runUser('v-run-cli-cmd', [
-            "/usr/bin/php$php_version",
+            "/usr/bin/php".$options['php_version'],
             $this -> getDocRoot('/vendor/drush/drush/drush'), 
             'site-install',
             'standard',

+ 5 - 4
web/src/app/WebApp/Installers/Grav/GravSetup.php

@@ -45,19 +45,20 @@ class GravSetup extends BaseSetup {
 			
 		if ( $options['admin'] == true ){
 			chdir($this->getDocRoot());
-			$php_version = $this -> appcontext -> getSupportedPHP($this -> config['server']['php']['supported']);
-			$this -> appcontext -> runUser('v-run-cli-cmd', ["/usr/bin/php$php_version", 
+			
+			$this -> appcontext -> runUser('v-run-cli-cmd', ["/usr/bin/php".$options['php_version'], 
 			$this->getDocRoot('/bin/gpm'),
 				'install admin'
 		    ], $status);
-			$this -> appcontext -> runUser('v-run-cli-cmd', ["/usr/bin/php$php_version", 
+			$this -> appcontext -> runUser('v-run-cli-cmd', ["/usr/bin/php".$options['php_version'], 
 				$this->getDocRoot('/bin/plugin'),
 				'login new-user',
 				'-u '.$options['username'],
 				'-p '.$options['password'],
 				'-e '.$options['email'],
 				'-P a',
-				'-N '.$options['username']
+				'-N '.$options['username'],
+				'-l en'
 			 ], $status);
 		}
 		return ($status -> code === 1);

+ 2 - 2
web/src/app/WebApp/Installers/MediaWiki/MediaWikiSetup.php

@@ -58,8 +58,8 @@ class MediaWikiSetup extends BaseSetup
         $this->appcontext->runUser('v-copy-fs-directory', [
             $this->getDocRoot($this->extractsubdir . "/mediawiki-1.37.2/."),
             $this->getDocRoot()], $result);
-        $php_version = $this -> appcontext -> getSupportedPHP($this -> config['server']['php']['supported']);
-        $this->appcontext->runUser('v-run-cli-cmd', ["/usr/bin/php$php_version",
+
+        $this->appcontext->runUser('v-run-cli-cmd', ["/usr/bin/php".$options['php_version'],
             $this->getDocRoot('maintenance/install.php'),
             '--dbserver=localhost',
             '--dbname=' . $this->appcontext->user() . '_' . $options['database_name'],

+ 3 - 2
web/src/app/WebApp/Installers/Nextcloud/NextcloudSetup.php

@@ -42,7 +42,8 @@ class NextcloudSetup extends BaseSetup
         
         // install nextcloud
         $php_version = $this -> appcontext -> getSupportedPHP($this -> config['server']['php']['supported']);
-        $this->appcontext->runUser('v-run-cli-cmd', ["/usr/bin/php$php_version",
+    
+        $this->appcontext->runUser('v-run-cli-cmd', ["/usr/bin/php".$options['php_version'],
             $this->getDocRoot('occ'),
             'maintenance:install',
             '--database mysql',
@@ -55,7 +56,7 @@ class NextcloudSetup extends BaseSetup
 
         $this->appcontext->runUser(
             'v-run-cli-cmd',
-            ['/usr/bin/php',
+            ["/usr/bin/php".$options['php_version'],
                 $this->getDocRoot('occ'),
                 'config:system:set',
                 'trusted_domains 2 --value='.$this->domain

+ 1 - 2
web/src/app/WebApp/Installers/Opencart/OpencartSetup.php

@@ -61,10 +61,9 @@ class OpencartSetup extends BaseSetup
             $protocol = 'https://';
         }
         
-        $php_version = $this -> appcontext -> getSupportedPHP($this -> config['server']['php']['supported']);
         
         $this->appcontext->runUser('v-run-cli-cmd', [
-            "/usr/bin/php$php_version",
+           "/usr/bin/php".$options['php_version'],
             $this->getDocRoot("/install/cli_install.php"),
             "install",
             "--db_username " . $this->appcontext->user() . '_' .$options['database_user'],

+ 1 - 1
web/src/app/WebApp/Installers/Prestashop/PrestashopSetup.php

@@ -61,7 +61,7 @@ class PrestashopSetup extends BaseSetup
         $php_version = $this -> appcontext -> getSupportedPHP($this -> config['server']['php']['supported']);
         
         $this->appcontext->runUser('v-run-cli-cmd', [
-            "/usr/bin/php$php_version",
+            "/usr/bin/php".$options['php_version'],
             $this->getDocRoot("/install/index_cli.php"),
             "--db_user=" . $this->appcontext->user() . '_' .$options['database_user'],
             "--db_password=" . $options['database_password'],

+ 1 - 2
web/src/app/WebApp/Installers/Wordpress/WordpressSetup.php

@@ -119,10 +119,9 @@ class WordpressSetup extends BaseSetup
             . "&admin_email="    . rawurlencode($options['wordpress_account_email'])
             ), $output, $return_var);
         
-        if ( strpos(implode(PHP_EOL,$output),'Error establishing a database connection' !== false)){
+        if ( strpos(implode(PHP_EOL,$output),'Error establishing a database connection') !== false){
            throw new \Exception('Error establishing a database connection'); 
         }
-
         if ($return_var > 0) {
             throw new \Exception(implode(PHP_EOL, $output));
         }