fixed md layout

This commit is contained in:
2025-10-21 20:30:20 +01:00
parent a09d4818b5
commit 7f44a19c51

110
README.md
View File

@@ -1,9 +1,13 @@
# 📸 Embedded Gallery SPA # 📸 Embedded Gallery SPA
![Badge Label](https://img.shields.io/badge/dev,branch-working-color.svg)
![Build Status](https://img.shields.io/badge/compile-pass-brightgreen.svg)
![License](https://img.shields.io/badge/License:-copyright,©2025-darkred)
---
A lightweight, responsive single-page photo gallery built for embedded Linux systems (e.g., OpenWrt). 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. 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 ## 🚀 Features
@@ -22,8 +26,8 @@ This project provides a modern web interface for browsing, uploading, and managi
--- ---
## 🧱 Directory Structure ## 🧱 Directory Structure
```
/srv/www/ /var/www/
├── index.php ├── index.php
├── includes/ ├── includes/
│ ├── config.php │ ├── config.php
@@ -51,16 +55,15 @@ This project provides a modern web interface for browsing, uploading, and managi
│ ├── admin.js │ ├── admin.js
├── cache/ ├── cache/
├── thumbs/ ├── thumbs/
── uploads/ ── uploads/
└── logs/ ```
--- ---
## ⚙️ Requirements ## ⚙️ Requirements
- **OpenWrt / Linux** - **OpenWrt / Linux**
- **PHP 8+** with: - **PHP 8.4+** with:
- `php-fpm` - `php-fpm`
- `php-session` - `php-session`
- `php-exif` - `php-exif`
@@ -77,62 +80,73 @@ This project provides a modern web interface for browsing, uploading, and managi
1. **Copy or extract the ZIP:** 1. **Copy or extract the ZIP:**
```bash ```bash
sudo unzip srv_www_final.zip -d /srv/ sudo unzip srv_www_final.zip -d /srv/
```
Set permissions: 2. **Set permissions:**
```bash
sudo chown -R www-data:www-data /srv/www sudo chown -R www-data:www-data /srv/www
sudo chmod -R 755 /srv/www sudo chmod -R 755 /srv/www
```
Check PHP-FPM session support: 3. **Check PHP-FPM session support:**
```bash
php -m | grep session php -m | grep session
```
Open your browser: 4. **Open your browser:**
```
https://<device-ip>/ https://<device-ip>/
```
🔐 Admin Login ---
## 🔐 Admin Login
To enable upload and admin features: To enable upload and admin features:
Generate a password hash: 1. **Generate a password hash:**
```php
php -r "echo password_hash('YourPassword', PASSWORD_BCRYPT);" php -r "echo password_hash('YourPassword', PASSWORD_BCRYPT);"
```
Paste the result into includes/config.php: 2. **Paste the result into includes/config.php:**
```json
[
'upload_password' => '$2y$10$replaceThisWithYourOwnHash', 'upload_password' => '$2y$10$replaceThisWithYourOwnHash',
]
```
---
## ⚡ Performance Tips
⚡ Performance Tips 1. **Enable Gzip and Brotli in Nginx for faster page loads:**
```
Enable Gzip and Brotli in Nginx for faster page loads: gzip on;
gzip_types text/plain text/css application/javascript application/json;
gzip on; brotli on;
gzip_types text/plain text/css application/javascript application/json; brotli_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):**
```
Tune PHP-FPM memory usage for small devices (256MB RAM, 4GB swap):
pm = dynamic pm = dynamic
pm.max_children = 5 pm.max_children = 5
pm.start_servers = 2 pm.start_servers = 2
pm.min_spare_servers = 1 pm.min_spare_servers = 1
pm.max_spare_servers = 3 pm.max_spare_servers = 3
memory_limit = 64M memory_limit = 64M
```
---
## 📦 Updating
📦 Updating 1. **Use the included helper script:**
```bash
sh update-www.sh srv_www_final.zip
```
**It will back up the old site, extract the new one, and fix permissions automatically.**
Use the included helper script: ---
## 🧑‍💻 Author
sh update-www.sh srv_www_final.zip ### James Blackmore (reclusejay)
It will back up the old site, extract the new one, and fix permissions automatically. #### Built with ❤️ and PHP for embedded systems.
🧑‍💻 Author
James Blackmore (reclusejay) ---
Built with ❤️ and PHP for embedded systems. ## 📜 License
📜 License
This project is released under the MIT License. **This project is license is Pending (all rights reserved until specified).**
Feel free to modify, extend, and use it in your own projects.
---