fixed md layout
This commit is contained in:
110
README.md
110
README.md
@@ -1,9 +1,13 @@
|
||||
# 📸 Embedded Gallery SPA
|
||||
|
||||

|
||||

|
||||

|
||||
---
|
||||
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:
|
||||
|
||||
sudo chown -R www-data:www-data /srv/www
|
||||
sudo chmod -R 755 /srv/www
|
||||
|
||||
Check PHP-FPM session support:
|
||||
|
||||
php -m | grep session
|
||||
|
||||
Open your browser:
|
||||
|
||||
```
|
||||
2. **Set permissions:**
|
||||
```bash
|
||||
sudo chown -R www-data:www-data /srv/www
|
||||
sudo chmod -R 755 /srv/www
|
||||
```
|
||||
3. **Check PHP-FPM session support:**
|
||||
```bash
|
||||
php -m | grep session
|
||||
```
|
||||
4. **Open your browser:**
|
||||
```
|
||||
https://<device-ip>/
|
||||
|
||||
🔐 Admin Login
|
||||
```
|
||||
---
|
||||
## 🔐 Admin Login
|
||||
|
||||
To enable upload and admin features:
|
||||
|
||||
Generate a password hash:
|
||||
|
||||
php -r "echo password_hash('YourPassword', PASSWORD_BCRYPT);"
|
||||
|
||||
Paste the result into includes/config.php:
|
||||
|
||||
1. **Generate a password hash:**
|
||||
```php
|
||||
php -r "echo password_hash('YourPassword', PASSWORD_BCRYPT);"
|
||||
```
|
||||
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:
|
||||
|
||||
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):
|
||||
|
||||
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
|
||||
|
||||
📦 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.
|
||||
🧑💻 Author
|
||||
#### Built with ❤️ and PHP for embedded systems.
|
||||
|
||||
James Blackmore (reclusejay)
|
||||
Built with ❤️ and PHP for embedded systems.
|
||||
📜 License
|
||||
---
|
||||
## 📜 License
|
||||
|
||||
This project is released under the MIT License.
|
||||
Feel free to modify, extend, and use it in your own projects.
|
||||
**This project is license is Pending (all rights reserved until specified).**
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user