Skip to content

Commit 51a03db

Browse files
authored
Fix Quick installer issues (hestiacp#2921)
* Some rare cases version might be empty * Remove debug info * If admin is not created status is not set * Return correct status code * Fix docuwiki installer Install dir got changed due to new version * Update to 2022-07-31a See CVE-2022-3123 * Update opencart * Use correct folder * Update prestashop
1 parent 08c3c16 commit 51a03db

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

web/src/app/System/HestiaApp.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function run(string $cmd, $args, &$cmd_result=null): bool
2828
$cli_arguments = '';
2929
if (!empty($args) && is_array($args)) {
3030
foreach ($args as $arg) {
31-
var_dump($arg);
3231
$cli_arguments .= quoteshellarg((string)$arg) . ' ';
3332
}
3433
} else {
@@ -195,12 +194,17 @@ public function databaseAdd(string $dbname, string $dbuser, string $dbpass, stri
195194
public function getCurrentBackendTemplate(string $domain){
196195
$status = $this->runUser('v-list-web-domain', [$domain, 'json'],$return_message);
197196
$version = $return_message -> json[$domain]['BACKEND'];
198-
if($version != "default"){
199-
$test= preg_match('/^.*PHP-([0-9])\_([0-9])/',$version, $match);
200-
return $match[1].'.'.$match[2];
197+
if (!empty($version)){
198+
if($version != "default"){
199+
$test= preg_match('/^.*PHP-([0-9])\_([0-9])/',$version, $match);
200+
return $match[1].'.'.$match[2];
201+
}else{
202+
$supported = $this -> run('v-list-sys-php', 'json', $result);
203+
return $this -> $supported -> json[0];
204+
}
201205
}else{
202206
$supported = $this -> run('v-list-sys-php', 'json', $result);
203-
return $this -> $supported -> json[0];
207+
return $this -> $supported -> json[0];
204208
}
205209
}
206210

web/src/app/WebApp/Installers/DokuWiki/DokuWikiSetup.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class DokuWikiSetup extends BaseSetup {
1111
'name' => 'DokuWiki',
1212
'group' => 'wiki',
1313
'enabled' => true,
14-
'version' => 'stable_2022-07-31',
14+
'version' => 'stable_2022-07-31a',
1515
'thumbnail' => 'dokuwiki-logo.svg'
1616
];
1717

@@ -48,7 +48,7 @@ class DokuWikiSetup extends BaseSetup {
4848
],
4949
],
5050
'resources' => [
51-
'archive' => [ 'src' => 'https://github.com/splitbrain/dokuwiki/archive/refs/tags/release_stable_2022-07-31.zip' ],
51+
'archive' => [ 'src' => 'https://github.com/splitbrain/dokuwiki/archive/refs/tags/release_stable_2022-07-31a.zip' ],
5252
],
5353
'server' => [
5454
'nginx' => [
@@ -72,7 +72,7 @@ public function install(array $options = null, &$status=null)
7272
$webDomain = ($sslEnabled ? "https://" : "http://") . $this->domain . "/";
7373

7474
$this->appcontext->runUser('v-copy-fs-directory',[
75-
$this->getDocRoot($this->extractsubdir . "/dokuwiki-release_stable_2020-07-29/."),
75+
$this->getDocRoot($this->extractsubdir . "/dokuwiki-release_stable_2022-07-31a/."),
7676
$this->getDocRoot()], $status);
7777

7878
// enable htaccess
@@ -100,7 +100,6 @@ public function install(array $options = null, &$status=null)
100100
if($return_var > 0){
101101
throw new \Exception(implode( PHP_EOL, $output));
102102
}
103-
104103
// remove temp folder
105104
$this->appcontext->runUser('v-delete-fs-file', [$this->getDocRoot("install.php")], $status);
106105
$this->cleanup();

web/src/app/WebApp/Installers/Grav/GravSetup.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ public function install(array $options = null)
6060
'-N '.$options['username'],
6161
'-l en'
6262
], $status);
63+
return ($status -> code === 0);
64+
}else{
65+
return true;
6366
}
64-
return ($status -> code === 1);
67+
6568
}
6669
}

web/src/app/WebApp/Installers/Opencart/OpencartSetup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class OpencartSetup extends BaseSetup
1010
'name' => 'Opencart',
1111
'group' => 'ecommerce',
1212
'enabled' => true,
13-
'version' => '4.0.0.0',
13+
'version' => '4.0.1.1',
1414
'thumbnail' => 'opencart-thumb.png'
1515
];
1616

@@ -25,7 +25,7 @@ class OpencartSetup extends BaseSetup
2525
],
2626
'database' => true,
2727
'resources' => [
28-
'archive' => [ 'src' => 'https://github.com/opencart/opencart/releases/download/4.0.0.0/opencart-4.0.0.0.zip' ],
28+
'archive' => [ 'src' => 'https://github.com/opencart/opencart/releases/download/4.0.1.1/opencart-4.0.1.1.zip' ],
2929
],
3030
'server' => [
3131
'nginx' => [

web/src/app/WebApp/Installers/Prestashop/PrestashopSetup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class PrestashopSetup extends BaseSetup
1010
'name' => 'Prestashop',
1111
'group' => 'ecommerce',
1212
'enabled' => true,
13-
'version' => '1.7.8.6',
13+
'version' => '1.7.8.7',
1414
'thumbnail' => 'prestashop-thumb.png'
1515
];
1616

@@ -26,7 +26,7 @@ class PrestashopSetup extends BaseSetup
2626
],
2727
'database' => true,
2828
'resources' => [
29-
'archive' => [ 'src' => 'https://github.com/PrestaShop/PrestaShop/releases/download/1.7.8.6/prestashop_1.7.8.6.zip' ],
29+
'archive' => [ 'src' => 'https://github.com/PrestaShop/PrestaShop/releases/download/1.7.8.7/prestashop_1.7.8.7.zip' ],
3030
],
3131
'server' => [
3232
'nginx' => [

0 commit comments

Comments
 (0)