fixed md layout

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

View File

@@ -1,9 +1,13 @@
# 📸 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).
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
@@ -22,8 +26,8 @@ This project provides a modern web interface for browsing, uploading, and managi
---
## 🧱 Directory Structure
/srv/www/
```
/var/www/
├── index.php
├── includes/
│ ├── config.php
@@ -51,16 +55,15 @@ This project provides a modern web interface for browsing, uploading, and managi
│ ├── admin.js
├── cache/
├── thumbs/
── uploads/
└── logs/
── uploads/
```
---
## ⚙️ Requirements
- **OpenWrt / Linux**
- **PHP 8+** with:
- **PHP 8.4+** with:
- `php-fpm`
- `php-session`
- `php-exif`
@@ -77,62 +80,73 @@ This project provides a modern web interface for browsing, uploading, and managi
1. **Copy or extract the ZIP:**
```bash
sudo unzip srv_www_final.zip -d /srv/
Set permissions:
```
2. **Set permissions:**
```bash
sudo chown -R www-data:www-data /srv/www
sudo chmod -R 755 /srv/www
Check PHP-FPM session support:
```
3. **Check PHP-FPM session support:**
```bash
php -m | grep session
Open your browser:
```
4. **Open your browser:**
```
https://<device-ip>/
🔐 Admin Login
```
---
## 🔐 Admin Login
To enable upload and admin features:
Generate a password hash:
1. **Generate a password hash:**
```php
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',
]
```
---
## ⚡ Performance Tips
⚡ Performance Tips
Enable Gzip and Brotli in Nginx for faster page loads:
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;
Tune PHP-FPM memory usage for small devices (256MB RAM, 4GB swap):
```
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
📦 Updating
Use the included helper script:
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.**
It will back up the old site, extract the new one, and fix permissions automatically.
🧑‍💻 Author
---
## 🧑‍💻 Author
James Blackmore (reclusejay)
Built with ❤️ and PHP for embedded systems.
📜 License
### James Blackmore (reclusejay)
This project is released under the MIT License.
Feel free to modify, extend, and use it in your own projects.
#### Built with ❤️ and PHP for embedded systems.
---
## 📜 License
**This project is license is Pending (all rights reserved until specified).**
---