mirror of
https://github.com/filegator/filegator.git
synced 2025-08-13 06:04:16 +02:00
Website generation with Couscous
This commit is contained in:
@@ -95,6 +95,11 @@
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
|
@@ -95,6 +95,11 @@
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
@@ -153,6 +158,9 @@ VALUES
|
||||
'database' => 'filegator',
|
||||
],
|
||||
],</code></pre>
|
||||
<h2 id="api-authentication">API authentication</h2>
|
||||
<p>Front-end will use session based authentication to authenticate and consume the back-end.</p>
|
||||
<p>Note: The application will not correctly if cookies are disabled.</p>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
@@ -95,6 +95,11 @@
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
@@ -114,8 +119,9 @@
|
||||
|
||||
<section class="col-sm-offset-3 col-lg-offset-2 col-sm-9 col-lg-10">
|
||||
<h2 id="basic">Basic</h2>
|
||||
<p>You can edit <code>configuration.php</code> to change the basic things like logo image, title, language and upload restrictions.</p>
|
||||
<p>NOTE: if you've made a mistake in configuration file, forgot to close a quote, the script will throw an error. Please use provided default <code>configuration_sample.php</code> to verify this.</p>
|
||||
<p>All services are set with reasonable defaults. For regular users there is no need to change anything. The script should work out of the box.</p>
|
||||
<p>You can edit <code>/configuration.php</code> file to change the basic things like logo image, title, language and upload restrictions.</p>
|
||||
<p>Note: if you've made a mistake in configuration file (forgot to close a quote?) the script will fail to load or throw an error. Please use provided default <code>configuration_sample.php</code> to put everything back to normal.</p>
|
||||
<pre><code> 'frontend_config' => [
|
||||
'app_name' => 'FileGator',
|
||||
'app_version' => APP_VERSION,
|
||||
|
@@ -95,6 +95,11 @@
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
|
189
configuration/router.html
Normal file
189
configuration/router.html
Normal file
@@ -0,0 +1,189 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>FileGator - Documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="https://docs.filegator.io/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://docs.filegator.io/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://docs.filegator.io/css/highlight.tomorrow-night.css">
|
||||
<link rel="stylesheet" href="https://docs.filegator.io/css/main.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="navbar navbar-default navbar-fixed-top">
|
||||
|
||||
<a class="navbar-brand" href="https://docs.filegator.io/">
|
||||
FileGator
|
||||
<small class="hidden-xs hidden-sm">
|
||||
Documentation
|
||||
</small>
|
||||
</a>
|
||||
|
||||
</header>
|
||||
|
||||
<main class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<nav id="sidebar" class="col-sm-3 col-lg-2" role="navigation">
|
||||
|
||||
<p class="text-muted">
|
||||
Getting Started
|
||||
</p>
|
||||
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/index.html">
|
||||
What is FileGator
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/install.html">
|
||||
Installation
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/accounts.html">
|
||||
Users
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/development.html">
|
||||
Development
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/demo.html">
|
||||
Demo
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
Configuration
|
||||
</p>
|
||||
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/basic.html">
|
||||
Basic
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/auth.html">
|
||||
Auth
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/session.html">
|
||||
Session
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/storage.html">
|
||||
Storage
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/logging.html">
|
||||
Logging
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
Languages
|
||||
</p>
|
||||
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/translations/default.html">
|
||||
Translations
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<section class="col-sm-offset-3 col-lg-offset-2 col-sm-9 col-lg-10">
|
||||
<h2 id="router-service">Router service</h2>
|
||||
<p>Router service is using well-known <a href="https://github.com/nikic/FastRoute">FastRoute</a> library. There is no need to change this service unless you're extending the script.</p>
|
||||
<p>The router uses unique query parameter <code>?r=</code> to pass the route info. Because of this feature, this (single-page) application does not require rewrite rules, .htaccess or similar tweaks.</p>
|
||||
<p>Example routes:</p>
|
||||
<ul>
|
||||
<li><code>http://example.com/?r=/some/route&param1=val1&param2=val2</code></li>
|
||||
<li><code>http://example.com/?r=/user/{user_id}&param1=val1</code></li>
|
||||
</ul>
|
||||
<h2 id="routes-file">Routes file</h2>
|
||||
<p>Routes file is located here <code>/backend/Controllers/routes.php</code>. Each route in the routes array looks like this:</p>
|
||||
<pre><code> [
|
||||
'route' => [
|
||||
'GET', '/download/{path_encoded}', '\Filegator\Controllers\DownloadController@download',
|
||||
],
|
||||
'roles' => [
|
||||
'guest', 'user', 'admin',
|
||||
],
|
||||
'permissions' => [
|
||||
'download',
|
||||
],
|
||||
],</code></pre>
|
||||
<p>As you can in the example, you can assign required user roles and permissions for each route.</p>
|
||||
<h2 id="controllers">Controllers</h2>
|
||||
<p>Since FileGator is using an awesome dependency injection <a href="https://github.com/PHP-DI/PHP-DI">container</a> you can type-hint dependencies directly in your controllers. </p>
|
||||
<p>You can also mix route parameters and dependencies in any order like in this example:</p>
|
||||
<pre><code>
|
||||
public function __construct(Config $config, Session $session, AuthInterface $auth, Filesystem $storage)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
public function download($path_encoded, Request $request, Response $response, StreamedResponse $streamedResponse)
|
||||
{
|
||||
// ...
|
||||
}</code></pre>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
|
||||
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
|
||||
<script src="//yandex.st/highlightjs/7.5/highlight.min.js"></script>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("section>h1").wrap('<div class="page-header" />');
|
||||
// Syntax highlighting
|
||||
hljs.initHighlightingOnLoad();
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Ticksel analytics v1.0 -->
|
||||
<script type="text/javascript">
|
||||
var _tcfg = _tcfg || [];
|
||||
(function() {
|
||||
_tcfg.push(["tags", "filegator-io,filegator-io-docs"]);
|
||||
var u="https://cdn.ticksel.com/js/analytics_v1.0.js"; _tcfg.push(["account_id", 8348834]);
|
||||
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
|
||||
g.type="text/javascript"; g.async=true; g.src=u; g.setAttribute("crossorigin", "anonymous");
|
||||
g.setAttribute("integrity", "sha256-7grd8jMivCG0iCcJ7m/Ny4gvWb0mPVpFhRQovLkaUl8=");
|
||||
s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<noscript><img src="https://beacon.ticksel.com/beam?account_id=8348834&referrer=&tags=filegator-io,filegator-io-docs" style="border:0;" width="0" height="0" alt="" /></noscript>
|
||||
<!-- End Ticksel Code -->
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -95,6 +95,11 @@
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
@@ -116,7 +121,7 @@
|
||||
<h2 id="configuring-security-service">Configuring Security service</h2>
|
||||
<p>Simple security service is included in the script by default. This service provides:</p>
|
||||
<ul>
|
||||
<li>Basic <a href="https://en.wikipedia.org/wiki/Cross-site_request_forgery">CSRF</a> protection</li>
|
||||
<li>Basic session-based <a href="https://en.wikipedia.org/wiki/Cross-site_request_forgery">CSRF</a> protection</li>
|
||||
<li>IP whitelisting</li>
|
||||
<li>IP blacklisting</li>
|
||||
</ul>
|
||||
|
@@ -95,6 +95,11 @@
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
|
@@ -95,6 +95,11 @@
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
|
@@ -95,6 +95,11 @@
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
|
@@ -95,6 +95,11 @@
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
|
@@ -95,6 +95,11 @@
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
|
@@ -95,6 +95,11 @@
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
|
@@ -95,6 +95,11 @@
|
||||
<a href="https://docs.filegator.io/configuration/security.html">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="https://docs.filegator.io/configuration/router.html">
|
||||
Router
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="text-muted">
|
||||
|
Reference in New Issue
Block a user