Skip to content

Commit 84e604d

Browse files
fix ssl issue & fix grav installer
fixes an issue where the install wouldn't work as expected when ssl was disabled
1 parent e62509d commit 84e604d

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,26 @@ class DokuWikiSetup extends BaseSetup {
5555
public function install(array $options = null)
5656
{
5757
parent::install($options);
58+
59+
//check if ssl is enabled
60+
$this->appcontext->run('v-list-web-domain', [$this->appcontext->user(), $this->domain, 'json'], $status);
61+
62+
if($status->code !== 0) {
63+
throw new \Exception("Cannot list domain");
64+
}
65+
66+
$sslEnabled = ($status->json[$this->domain]['SSL'] == 'no' ? 0 : 1);
5867

59-
$webDomain = "https://" . $this->domain . "/";
60-
68+
$webDomain = ($sslEnabled ? "https://" : "http://") . $this->domain . "/";
69+
6170
$this->appcontext->runUser('v-copy-fs-directory',[
6271
$this->getDocRoot($this->extractsubdir . "/dokuwiki-release_stable_2020-07-29/."),
6372
$this->getDocRoot()], $result);
6473

6574
$installUrl = $webDomain . "install.php";
6675

6776
$cmd = "curl --request POST "
77+
. ($sslEnabled ? "" : "--insecure " )
6878
. "--url $installUrl "
6979
. "--header 'Content-Type: application/x-www-form-urlencoded' "
7080
. "--data l=en "

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ class GravSetup extends BaseSetup {
1818
protected $appname = 'grav';
1919

2020
protected $config = [
21-
'form' => [],
21+
'form' => [
22+
"ignore this"=>"text",
23+
],
2224
'database' => false,
2325
'resources' => [
2426
'composer' => [ 'src' => 'getgrav/grav', 'dst' => '/']

web/src/app/WebApp/Installers/MediaWiki/MediaWikiSetup.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,21 @@ public function install(array $options = null)
3535
{
3636
parent::install($options);
3737

38-
$webAddresss = "https://" . $this->domain;
38+
//check if ssl is enabled
39+
$this->appcontext->run('v-list-web-domain', [$this->appcontext->user(), $this->domain, 'json'], $status);
40+
41+
if($status->code !== 0) {
42+
throw new \Exception("Cannot list domain");
43+
}
44+
45+
$sslEnabled = ($status->json[$this->domain]['SSL'] == 'no' ? 0 : 1);
46+
47+
$webDomain = ($sslEnabled ? "https://" : "http://") . $this->domain . "/";
3948

4049
$this->appcontext->runUser('v-copy-fs-directory',[
4150
$this->getDocRoot($this->extractsubdir . "/mediawiki-1.36.1/."),
4251
$this->getDocRoot()], $result);
4352

44-
$this->cleanup();
45-
4653
$this->appcontext->runUser('v-run-cli-cmd', ['/usr/bin/php',
4754
$this->getDocRoot('maintenance/install.php'),
4855
'--dbserver=localhost',
@@ -58,7 +65,9 @@ public function install(array $options = null)
5865
"MediaWiki", // A Space here would trigger the next argument and preemptively set the admin username
5966
$options['admin_username'],
6067
], $status);
61-
68+
69+
$this->cleanup();
70+
6271
return ($status->code === 0);
6372
}
6473
}

0 commit comments

Comments
 (0)