Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Commit

Permalink
Installer: Enable Cabins by default
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Jun 28, 2016
1 parent 027ae82 commit ce26bf1
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Version 1.0.2 - 2016-06-28

* Fixed a default configuration issue which caused Cabins to be disabled.
* Improved the UX of the Installer. Populate more default settings.

## Version 1.0.1 - 2016-06-27

* Fixed a syntax error that snuck into our installer SQL code.
Expand Down
2 changes: 1 addition & 1 deletion src/Cabin/Hull/Landing/IndexPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function index()
}

$blogRoll = $this->blog->recentFullPosts(
$this->config('homepage.blog-posts') ?? 5
(int) ($this->config('homepage.blog-posts') ?? 5)
);
$mathJAX = false;
foreach ($blogRoll as $i => $blog) {
Expand Down
4 changes: 4 additions & 0 deletions src/Installer/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
};
use \Airship\Engine\Security\CSRF;
use \GuzzleHttp\Client;
use ParagonIE\ConstantTime\Base64UrlSafe;
use \ParagonIE\Halite\Password;
use \ParagonIE\ConstantTime\Base64;

Expand Down Expand Up @@ -611,9 +612,11 @@ protected function databaseFinalPgsql()
*/
protected function finalProcessAdminAccount()
{
$sessionCanary = Base64UrlSafe::encode(\random_bytes(33));
$this->db->insert('airship_users', [
'username' => $this->data['admin']['username'],
'password' => $this->data['admin']['passphrase'],
'session_canary' => $sessionCanary,
'uniqueid' => \Airship\uniqueId()
]);

Expand All @@ -632,6 +635,7 @@ protected function finalProcessAdminAccount()

// Log in as the user
$_SESSION['userid'] = $userid;
$_SESSION['session_canary'] = $sessionCanary;
}

/**
Expand Down
54 changes: 47 additions & 7 deletions src/Installer/skins/cabins.twig
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,42 @@
"enabled": true,
"captcha": true
},
"editor": {
"default-format": "Markdown"
},
"file": {
"cache": 900
"cache": 3600
},
"password-reset": {
"enabled": true,
"logout": true,
"ttl": 30
},
"recaptcha": {
"secret-key": "",
"site-key": ""
},
"two-factor": {
"issuer": "",
"label": "",
"length": 6,
"period": 30
},
"user-directory": {
"per-page": 20
}
} %}
{% set motifs =
{
"name": {
"config": {
"display_name": "Airship Classic (You can change this later)",
"name": "airship-classic",
"supplier": "paragonie",
}
}
}
%}
{% set twig_vars = {
"title": "Airship Blog",
"tagline": "Even the sky shall not limit you."
Expand All @@ -94,8 +122,14 @@
<label for="hull_url">
Canon URL (for hyperlinks from other Cabins):
</label>
<input id="hull_url" class="pure-input-1" type="text" name="cabin[Hull][canon_url]" value="http://{{ SERVER.HTTP_HOST|e('html_attr') }}" />

<input
id="hull_url"
class="pure-input-1"
type="text"
name="cabin[Hull][canon_url]"
value="http://{{ SERVER.HTTP_HOST|e('html_attr') }}"
/>

<div>
<input id="hull_https" class="inblock" type="checkbox" name="cabin[Hull][https]" value="1" checked="checked" />
<label for="hull_https" class="inblock">
Expand All @@ -122,18 +156,24 @@
{% set config_extra = {
"blog": {
"cachelists": false,
"per_page": "20",
"comments": {
"depth_max": 5,
"enabled": true,
"guests": true,
"recaptcha": true
}
},
"per_page": 20
},
"cache-secret": "",
"file": {
"cache": 900
"cache": 3600
},
"homepage": {
"blog-posts": 5
"blog-posts": 3
},
"recaptcha": {
"secret-key": "",
"site-key": ""
}
} %}
{% set twig_vars = {
Expand Down

0 comments on commit ce26bf1

Please sign in to comment.