Lightweight PHP application for browsing and downloading files with authentication. Ideal for sharing files from NAS, local storage, or other directories.
- PHP 7.4 or higher
- Webserver with
mod_rewriteallowed
-
Clone or download the project and copy it to your website
-
Set permissions
chmod 755 -R <your_web_dir> chmod 644 <your_web_dir>/index.php chmod 644 <your_web_dir>/config/config.php
-
Adjust settings according to your needs at
config/config.php -
Enjoy :)
Edit config/config.php to configure your application:
[
'base_url' => 'https://share.example.com/',
'timezone' => 'Europe/Bratislava',
'roots' => [
'local' => [
'label' => 'Local Files',
'path' => '/mnt/shared/',
'password' => 'your-password', // '' - no password check
'enabled' => true,
'visible' => true,
],
],
];You can add multiple roots in two ways:
Add roots directly in config/config.php:
'roots' => [
'private' => [
'label' => 'Private Files',
'path' => '/mnt/private/',
'password' => 'secret-password',
'enabled' => true,
'visible' => false,
],
'public' => [
'label' => 'Public Files',
'path' => '/var/public',
'password' => '', // No password
'enabled' => true,
'visible' => true,
],
],For dynamically loading roots from a directory, specify a path string:
'roots' => [
// Standard static roots
'public' => [
'label' => 'Public Files',
'path' => '/var/public/',
'password' => '',
'enabled' => true,
'visible' => true,
],
// Dynamic loading - will load .share_config.php from this directory
'/mnt/nas/',
],Then create a .share_config.php file in /mnt/nas/:
<?php
// /mnt/nas/.share_config.php
return [
'photos' => [
'label' => 'Photo Gallery',
'path' => 'photos/', // Relative to /mnt/nas/
'password' => '',
'enabled' => true,
'visible' => true,
],
'documents' => [
'label' => 'Documents',
'path' => 'docs/', // Relative to /mnt/nas/
'password' => 'secret123',
'enabled' => true,
'visible' => true,
],
'backup' => [
'label' => 'Backups',
'path' => '/absolute/path/to/backups/', // Or absolute paths
'password' => 'backup2024',
'enabled' => true,
'visible' => false, // Hidden from root list
],
];This approach is useful for:
- NAS directories where you want to maintain separate configs
- Multi-tenant setups
- Keeping sensitive root configs outside the main application
- Dynamically adding/removing roots without editing main config
'security' => [
'session_timeout' => 3600, // 1 hour
'max_login_attempts' => 5, // Max attempts
'lockout_time' => 300, // 5 minutes lockout
],'display' => [
'date_format' => 'Y-m-d H:i',
'show_hidden_files' => false,
'items_per_page' => 0, // 0 = unlimited
],This project is open source. Feel free to use and modify as needed.