Skip to content

patrikcelko/Celkos-Share

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Celko's Share

Lightweight PHP application for browsing and downloading files with authentication. Ideal for sharing files from NAS, local storage, or other directories.

Version PHP

Screenshot_20251201_105252

Requirements

  • PHP 7.4 or higher
  • Webserver with mod_rewrite allowed

Installation

  1. Clone or download the project and copy it to your website

  2. Set permissions

    chmod 755 -R <your_web_dir>
    chmod 644 <your_web_dir>/index.php
    chmod 644 <your_web_dir>/config/config.php
  3. Adjust settings according to your needs at config/config.php

  4. Enjoy :)

Configuration

Basic Setup

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,
        ],
    ],
];

Adding More Roots

You can add multiple roots in two ways:

1. Static Configuration (Traditional)

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,
    ],
],

2. Dynamic Configuration (From Directory)

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 Settings

'security' => [
    'session_timeout' => 3600, // 1 hour
    'max_login_attempts' => 5, // Max attempts
    'lockout_time' => 300, // 5 minutes lockout
],

Display Settings

'display' => [
    'date_format' => 'Y-m-d H:i',
    'show_hidden_files' => false,
    'items_per_page' => 0, // 0 = unlimited
],

License

This project is open source. Feel free to use and modify as needed.

About

Lightweight PHP application for browsing and downloading files with authentication.

Topics

Resources

Stars

Watchers

Forks

Contributors