Website generation with Couscous

This commit is contained in:
Milos Stojanovic
2019-06-18 13:16:48 +02:00
parent caaf5f9bc0
commit 13ade60e94

View File

@@ -66,7 +66,40 @@
<section id="content" class="col-sm-offset-3 col-lg-offset-2 col-sm-9 col-lg-10">
<h3 id="configuration-options">Configuration options:</h3>
<h3 id="configuring-filegator">Configuring FileGator</h3>
<p>All configuration options are stored inside <code>configuration.php</code> file.
In this file you can configure all the options, services and their handlers.</p>
<h3 id="configuring-auth-service-to-use-database">Configuring Auth service to use database</h3>
<p>You can store your users inside mysql database (default is json file).</p>
<p>First, create a table <code>users</code> with this sql:</p>
<pre><code>CREATE TABLE `users` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`role` varchar(20) NOT NULL,
`permissions` varchar(200) NOT NULL,
`homedir` varchar(2000) NOT NULL,
`password` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `username` (`username`)
) CHARSET=utf8 COLLATE=utf8_bin;</code></pre>
<p>Then, import default users with this query:</p>
<pre><code>INSERT INTO `users` (`username`, `name`, `role`, `permissions`, `homedir`, `password`)
VALUES
('guest', 'Guest', 'guest', '', '/', ''),
('admin', 'Admin', 'admin', 'read|write|upload|download|batchdownload|zip', '/', '$2y$10$Nu35w4pteLfc7BDCIkDPkecjw8wsH8Y2GMfIewUbXLT7zzW6WOxwq');</code></pre>
<p>Ath the end, open <code>configuration.php</code> and update Auth handler under section <code>services</code> to something like this:</p>
<pre><code> 'Filegator\Services\Auth\AuthInterface' =&gt; [
'handler' =&gt; '\Filegator\Services\Auth\Adapters\Database',
'config' =&gt; [
'driver' =&gt; 'mysqli',
'host' =&gt; 'localhost',
'username' =&gt; 'root',
'password' =&gt; 'password',
'database' =&gt; 'filegator',
],
],</code></pre>
<h3 id="default-configuration-options">Default Configuration options</h3>
<pre><code> 'public_path' =&gt; APP_PUBLIC_PATH,
'public_dir' =&gt; APP_PUBLIC_DIR,