diff --git a/accounts.html b/accounts.html index b3ea756..b0ed848 100644 --- a/accounts.html +++ b/accounts.html @@ -95,6 +95,11 @@ Security + +
  • + + Router +
  • diff --git a/configuration/auth.html b/configuration/auth.html index 3564a19..46f008b 100644 --- a/configuration/auth.html +++ b/configuration/auth.html @@ -95,6 +95,11 @@ Security + +

  • + + Router +
  • @@ -153,6 +158,9 @@ VALUES 'database' => 'filegator', ], ], +

    API authentication

    +

    Front-end will use session based authentication to authenticate and consume the back-end.

    +

    Note: The application will not correctly if cookies are disabled.

    diff --git a/configuration/basic.html b/configuration/basic.html index 7b2e0b4..8d6e332 100644 --- a/configuration/basic.html +++ b/configuration/basic.html @@ -95,6 +95,11 @@ Security + +
  • + + Router +
  • @@ -114,8 +119,9 @@

    Basic

    -

    You can edit configuration.php to change the basic things like logo image, title, language and upload restrictions.

    -

    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 configuration_sample.php to verify this.

    +

    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.

    +

    You can edit /configuration.php file to change the basic things like logo image, title, language and upload restrictions.

    +

    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 configuration_sample.php to put everything back to normal.

        'frontend_config' => [
             'app_name' => 'FileGator',
             'app_version' => APP_VERSION,
    diff --git a/configuration/logging.html b/configuration/logging.html
    index e136354..e452c46 100644
    --- a/configuration/logging.html
    +++ b/configuration/logging.html
    @@ -95,6 +95,11 @@
                                             
                                                 Security
                                             
    +                                    
    +                                                                    
  • + + Router +
  • diff --git a/configuration/router.html b/configuration/router.html new file mode 100644 index 0000000..97ef436 --- /dev/null +++ b/configuration/router.html @@ -0,0 +1,189 @@ + + + + + + + FileGator - Documentation + + + + + + + + +

    + +
    +
    + + + + + +
    +

    Router service

    +

    Router service is using well-known FastRoute library. There is no need to change this service unless you're extending the script.

    +

    The router uses unique query parameter ?r= to pass the route info. Because of this feature, this (single-page) application does not require rewrite rules, .htaccess or similar tweaks.

    +

    Example routes:

    +
      +
    • http://example.com/?r=/some/route&param1=val1&param2=val2
    • +
    • http://example.com/?r=/user/{user_id}&param1=val1
    • +
    +

    Routes file

    +

    Routes file is located here /backend/Controllers/routes.php. Each route in the routes array looks like this:

    +
        [
    +        'route' => [
    +            'GET', '/download/{path_encoded}', '\Filegator\Controllers\DownloadController@download',
    +        ],
    +        'roles' => [
    +            'guest', 'user', 'admin',
    +        ],
    +        'permissions' => [
    +            'download',
    +        ],
    +    ],
    +

    As you can in the example, you can assign required user roles and permissions for each route.

    +

    Controllers

    +

    Since FileGator is using an awesome dependency injection container you can type-hint dependencies directly in your controllers.

    +

    You can also mix route parameters and dependencies in any order like in this example:

    +
    
    +    public function __construct(Config $config, Session $session, AuthInterface $auth, Filesystem $storage)
    +    {
    +      // ...
    +    }
    +
    +    public function download($path_encoded, Request $request, Response $response, StreamedResponse $streamedResponse)
    +    {
    +      // ...
    +    }
    +
    + +
    +
    + + + + + + + + + + + + + + diff --git a/configuration/security.html b/configuration/security.html index 7ccb524..3c379d7 100644 --- a/configuration/security.html +++ b/configuration/security.html @@ -95,6 +95,11 @@ Security + +
  • + + Router +
  • @@ -116,7 +121,7 @@

    Configuring Security service

    Simple security service is included in the script by default. This service provides:

      -
    • Basic CSRF protection
    • +
    • Basic session-based CSRF protection
    • IP whitelisting
    • IP blacklisting
    diff --git a/configuration/session.html b/configuration/session.html index fb446f5..b5c031f 100644 --- a/configuration/session.html +++ b/configuration/session.html @@ -95,6 +95,11 @@ Security + +
  • + + Router +
  • diff --git a/configuration/storage.html b/configuration/storage.html index 8ede77e..d1df234 100644 --- a/configuration/storage.html +++ b/configuration/storage.html @@ -95,6 +95,11 @@ Security + +

  • + + Router +
  • diff --git a/demo.html b/demo.html index 6b9170f..a9e5273 100644 --- a/demo.html +++ b/demo.html @@ -95,6 +95,11 @@ Security + +

  • + + Router +
  • diff --git a/development.html b/development.html index 0b80a9d..acb4a57 100644 --- a/development.html +++ b/development.html @@ -95,6 +95,11 @@ Security + +

  • + + Router +
  • diff --git a/index.html b/index.html index b024f0d..d144fc6 100644 --- a/index.html +++ b/index.html @@ -95,6 +95,11 @@ Security + +

  • + + Router +
  • diff --git a/install.html b/install.html index 565adae..c421e15 100644 --- a/install.html +++ b/install.html @@ -95,6 +95,11 @@ Security + +

  • + + Router +
  • diff --git a/translations/default.html b/translations/default.html index f5a4f34..1695341 100644 --- a/translations/default.html +++ b/translations/default.html @@ -95,6 +95,11 @@ Security + +

  • + + Router +