Go to file
2025-10-22 14:21:47 +01:00
2025-10-22 14:21:47 +01:00
2025-10-22 14:20:51 +01:00
2025-10-21 20:42:35 +01:00

📸 Embedded Gallery

Badge Label Build Status License

A lightweight, responsive single-page photo gallery built for embedded Linux systems (e.g., OpenWrt).

This project provides a modern web interface for browsing, uploading, and managing photos directly on your embedded device — optimized for low-resource environments with PHP-FPM and Nginx.


🚀 Features

  • Single Page Application (SPA) navigation — no full page reloads (except login/out)
  • Dynamic gallery with infinite scroll and lazy loading
  • GLightbox integration for fullscreen previews and image metadata
  • EXIF caching system — stores camera data, lens, aperture, ISO, shutter speed, etc.
  • Drag & drop uploads with progress bars and live updates
  • Dark / Light themes with persistent preference
  • System stats dashboard (CPU, memory, disk, uptime, swap)
  • Web shell interface (optional, secure)
  • Admin mode with session-based authentication
  • Optimized for low RAM and embedded devices

🧱 Directory Structure

/var/www/
├── index.php
├── includes/
│ ├── config.php
│ ├── api.php
│ └── admin_auth.php
├── pages/
│ ├── home.php
│ ├── gallery.php
│ ├── upload.php
│ ├── stats.php
│ ├── shell.php
│ └── admin.php
├── css/
│ ├── style.css
│ ├── home.css
│ ├── upload.css
│ ├── dashboard.css
├── js/
│ ├── app.js
│ ├── home.js
│ ├── gallery.js
│ ├── upload.js
│ ├── stats.js
│ ├── shell.js
│ ├── admin.js
├── cache/
├── thumbs/
└── uploads/

⚙️ Requirements

  • OpenWrt / Linux
  • PHP 8.4+ with:
    • php-fpm
    • php-session
    • php-exif
    • php-gd
    • php-json
  • Nginx (configured to serve /srv/www/)
  • ImageMagick (optional) for RAW → JPEG conversion
  • Filesystem access to /srv/www/a77ii/sorted/jpg and /srv/www/thumbs/

🔧 Installation

  1. Copy or extract the ZIP:
    sudo unzip srv_www_final.zip -d /srv/
    
  2. Set permissions:
    sudo chown -R www-data:www-data /srv/www
    sudo chmod -R 755 /srv/www
    
  3. Check PHP-FPM session support:
    php -m | grep session
    
  4. Open your browser:
    https://<device-ip>/
    

🔐 Admin Login

To enable upload and admin features:

  1. Generate a password hash:
     php -r "echo password_hash('YourPassword', PASSWORD_BCRYPT);"
    
  2. Paste the result into includes/config.php:
    [
        'upload_password' => '$2y$10$replaceThisWithYourOwnHash',
    ]
    

Performance Tips

  1. Enable Gzip and Brotli in Nginx for faster page loads:
    gzip on;
    gzip_types text/plain text/css application/javascript application/json;
    brotli on;
    brotli_types text/plain text/css application/javascript application/json;
    
  2. Tune PHP-FPM memory usage for small devices (256MB RAM, 4GB swap):
    pm = dynamic
    pm.max_children = 5
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 3
    memory_limit = 64M
    

📦 Updating

  1. Use the included helper script:
    sh update-www.sh srv_www_final.zip
    

It will back up the old site, extract the new one, and fix permissions automatically.


🧑‍💻 Author

James Blackmore (reclusejay)

Built with ❤️ and PHP for embedded systems.


📜 License

This project is license is Pending (all rights reserved until specified).


Description
Embedded Gallery SPA A lightweight, responsive single-page photo gallery built for embedded Linux systems (e.g., OpenWrt).
Readme 134 KiB
Languages
PHP 40.7%
JavaScript 28.7%
Shell 17.3%
CSS 12.8%
Hack 0.5%