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

Merge branch 'main' into feature/user-roles

Kristan Kenney 5 лет назад
Родитель
Сommit
70f282a4fc

+ 3 - 0
CHANGELOG.md

@@ -45,7 +45,10 @@ All notable changes to this project will be documented in this file.
 - Disabled changing backup folder via Web UI because it used symbolic link instead of mount causing issues with restore mail / user files.
 - Fixed XSS vulnerability in `v-add-sys-ip` and user history log (thanks **@numanturle**).
 - Fixed remote code execution vulnerability which could occur when deleting SSH keys (thanks **@numanturle**).
+- Fixed vulnerability in v-update-sys-hestia (thanks **@numanturle**)
 - Improve how Quick install of web apps are handled and allow users added apps to be maintained in list view. 
+- Add Drupal quick installer
+- Add Nextcloud quick installer
 
 ## [1.3.5] - Service Release
 ### Features

+ 23 - 9
install/deb/filemanager/filegator/composer.lock

@@ -629,16 +629,16 @@
         },
         {
             "name": "phpseclib/phpseclib",
-            "version": "2.0.27",
+            "version": "2.0.31",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpseclib/phpseclib.git",
-                "reference": "34620af4df7d1988d8f0d7e91f6c8a3bf931d8dc"
+                "reference": "233a920cb38636a43b18d428f9a8db1f0a1a08f4"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/34620af4df7d1988d8f0d7e91f6c8a3bf931d8dc",
-                "reference": "34620af4df7d1988d8f0d7e91f6c8a3bf931d8dc",
+                "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/233a920cb38636a43b18d428f9a8db1f0a1a08f4",
+                "reference": "233a920cb38636a43b18d428f9a8db1f0a1a08f4",
                 "shasum": ""
             },
             "require": {
@@ -646,8 +646,7 @@
             },
             "require-dev": {
                 "phing/phing": "~2.7",
-                "phpunit/phpunit": "^4.8.35|^5.7|^6.0",
-                "sami/sami": "~2.0",
+                "phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4",
                 "squizlabs/php_codesniffer": "~2.0"
             },
             "suggest": {
@@ -731,7 +730,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-04-04T23:17:33+00:00"
+            "time": "2021-04-06T13:56:45+00:00"
         },
         {
             "name": "psr/container",
@@ -2930,6 +2929,20 @@
                 "MIT"
             ],
             "description": "PHPStan - PHP Static Analysis Tool",
+            "funding": [
+                {
+                    "url": "https://github.com/ondrejmirtes",
+                    "type": "github"
+                },
+                {
+                    "url": "https://www.patreon.com/phpstan",
+                    "type": "patreon"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
+                    "type": "tidelift"
+                }
+            ],
             "time": "2019-10-22T20:20:22+00:00"
         },
         {
@@ -3182,6 +3195,7 @@
             "keywords": [
                 "tokenizer"
             ],
+            "abandoned": true,
             "time": "2019-09-17T06:23:10+00:00"
         },
         {
@@ -4266,12 +4280,12 @@
             "version": "1.8.0",
             "source": {
                 "type": "git",
-                "url": "https://github.com/webmozart/assert.git",
+                "url": "https://github.com/webmozarts/assert.git",
                 "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
+                "url": "https://api.github.com/repos/webmozarts/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
                 "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
                 "shasum": ""
             },

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

@@ -85,7 +85,8 @@ http {
     set_real_ip_from 103.21.244.0/22;
     set_real_ip_from 103.22.200.0/22;
     set_real_ip_from 103.31.4.0/22;
-    set_real_ip_from 104.16.0.0/12;
+    set_real_ip_from 104.16.0.0/13;
+    set_real_ip_from 104.24.0.0/14;
     set_real_ip_from 108.162.192.0/18;
     set_real_ip_from 131.0.72.0/22;
     set_real_ip_from 141.101.64.0/18;

+ 16 - 1
install/upgrade/versions/1.4.0.sh

@@ -15,6 +15,11 @@ if [ -e "/etc/nginx/nginx.conf" ]; then
     fi
 fi
 
+if [ -e "/etc/nginx/nginx.conf" ]; then
+    echo "[ * ] Update Nginx.conf with changes to Cloudflare IP addresses"
+    sed  -i 's/    set_real_ip_from 104.16.0.0\/12;/    set_real_ip_from 104.16.0.0\/13;\n    set_real_ip_from 104.24.0.0\/14;/g' /etc/nginx/nginx.conf
+fi
+
 # Populating HELO/SMTP Banner for existing IPs
 if [ "$MAIL_SYSTEM" == "exim4" ]; then
 
@@ -38,7 +43,7 @@ if [ "$MAIL_SYSTEM" == "exim4" ]; then
         echo "[ * ] Updating exim4 configuration..."
 
         # Add new smtp_active_hostname variable to exim config
-        sed -i '/^smtp_banner = \$smtp_active_hostname$/a smtp_active_hostname = ${if exists {\/etc\/exim4\/mailhelo.conf}{${lookup{$interface_address}lsearch{\/etc\/exim4\/mailhelo.conf}{$value}{$primary_hostname}}}{$primary_hostname}}"' /etc/exim4/exim4.conf.template
+        sed -i '/^smtp_banner = \$smtp_active_hostname$/a smtp_active_hostname = ${if exists {\/etc\/exim4\/mailhelo.conf}{${lookup{$interface_address}lsearch{\/etc\/exim4\/mailhelo.conf}{$value}{$primary_hostname}}}{$primary_hostname}}' /etc/exim4/exim4.conf.template
 
         # Lookup HELO address by sending ip instead of sending domain
         sed -i 's/helo_data = \${if exists {\/etc\/exim4\/mailhelo.conf}{${lookup{\$sender_address_domain}lsearch\*{\/etc\/exim4\/mailhelo.conf}{\$value}{\$primary_hostname}}}{\$primary_hostname}}/helo_data = ${if exists {\/etc\/exim4\/mailhelo.conf}{${lookup{$sending_ip_address}lsearch{\/etc\/exim4\/mailhelo.conf}{$value}{$primary_hostname}}}{$primary_hostname}}/' /etc/exim4/exim4.conf.template
@@ -151,6 +156,16 @@ rm -rf $HESTIA/data/templates/web/nginx/php-fpm/drupal8.*tpl
 rm -rf $HESTIA/data/templates/web/nginx/php-fpm/codeigniter2.*tpl
 rm -rf $HESTIA/data/templates/web/nginx/php-fpm/codeigniter3.*tpl
 
+# Clean up old Hestia controled webapps
+if [ -d "$HESTIA/web/images/webapps/" ]; then 
+    echo "[ * ] Clean up old web apps code..."
+    rm -rf $HESTIA/web/images/webapps/
+    rm -rf $HESTIA/web/src/app/WebApp/Installers/LaravelSetup.php
+    rm -rf $HESTIA/web/src/app/WebApp/Installers/OpencartSetup.php
+    rm -rf $HESTIA/web/src/app/WebApp/Installers/PrestashopSetup.php
+    rm -rf $HESTIA/web/src/app/WebApp/Installers/SymfonySetup.php
+    rm -rf $HESTIA/web/src/app/WebApp/Installers/WordpressSetup.php
+fi
 
 
 ##### COMMANDS FOR V1.5.X

+ 9 - 10
web/list/server/index.php

@@ -19,7 +19,7 @@ if (isset($_GET['cpu'])) {
     foreach($output as $file) {
         echo $file . "\n";
     }
-    echo "    </pre>\n</body>\n</html>\n";
+    echo "  </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -31,7 +31,7 @@ if (isset($_GET['mem'])) {
     foreach($output as $file) {
         echo $file . "\n";
     }
-    echo "    </pre>\n</body>\n</html>\n";
+    echo "  </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -43,7 +43,7 @@ if (isset($_GET['disk'])) {
     foreach($output as $file) {
         echo $file . "\n";
     }
-    echo "    </pre>\n</body>\n</html>\n";
+    echo "  </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -55,7 +55,7 @@ if (isset($_GET['net'])) {
     foreach($output as $file) {
         echo $file . "\n";
     }
-    echo "    </pre>\n</body>\n</html>\n";
+    echo "  </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -68,14 +68,13 @@ if (isset($_GET['web'])) {
         $file=str_replace('border="0"', 'border="1"', $file);
         $file=str_replace('bgcolor="#ffffff"', '', $file);
         $file=str_replace('bgcolor="#000000"', 'bgcolor="#282828"', $file);
-        
+
         echo $file . "\n";
     }
-    echo "    </pre>\n</body>\n</html>\n";
+    echo "  </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
-
 // DNS info
 if (isset($_GET['dns'])) {
     $TAB = 'DNS';
@@ -84,7 +83,7 @@ if (isset($_GET['dns'])) {
     foreach($output as $file) {
         echo $file . "\n";
     }
-    echo "    </pre>\n</body>\n</html>\n";
+    echo "  </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -98,7 +97,7 @@ if (isset($_GET['mail'])) {
             echo $file . "\n";
         }
     }
-    echo "    </pre>\n</body>\n</html>\n";
+    echo "  </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -112,7 +111,7 @@ if (isset($_GET['db'])) {
             echo $file . "\n";
         }
     }
-    echo "    </pre>\n</body>\n</html>\n";
+    echo "  </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 

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

@@ -11,22 +11,38 @@ class DrupalSetup extends BaseSetup {
     protected $appInfo = [ 
         'name' => 'Drupal',
         'group' => 'cms',
-        'enabled' => false,
+        'enabled' => 'yes',
         'version' => 'latest',
         'thumbnail' => 'drupal-thumb.png'
     ];
     
     protected $config = [
         'form' => [
+            'username' => ['type'=>'text', 'value'=>'admin'],
+            'password' => 'password',
+            'email' => 'text'
         ],
         'database' => true,
         'resources' => [
-           
+           'composer' => [ 'src' => 'drupal/recommended-project', 'dst' => '/' ],
         ],
     ];
 
     public function install(array $options=null) : bool
     {
-        exit( "Installer missing" );
+        parent::install($options);
+        $this->appcontext->runComposer(["require", "-d " . $this->getDocRoot(), "drush/drush:^10"], $result);
+        
+        $this -> appcontext -> runUser('v-run-cli-cmd', [
+            'php',
+            $this -> getDocRoot('/vendor/drush/drush/drush'), 
+            'site-install',
+            'standard',
+            '--db-url=mysql://'.$this->appcontext->user() . '_' . $options['database_user'].':' . $options['database_password'].'@localhost:3306/'.$this->appcontext->user() . '_' . $options['database_name'].'',
+            '--account-name='.$options['username'].' --account-pass='.$options['password'],
+            '--site-name=Drupal',
+            '--site-mail='.$options['email']
+            ], $status);
+        return ($status->code === 0);
     }
 }