129 lines
3.6 KiB
Markdown
129 lines
3.6 KiB
Markdown
|
|
|
|||
|
|
# 🧠 MentalNet Funnies
|
|||
|
|
|
|||
|
|
**A lightweight PHP + SQLite web app for hosting MentalNet Original comic strips.**
|
|||
|
|
Built for simplicity, security, and self-hosting — no external dependencies, just pure PHP, HTML, and CSS.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 🚀 Overview
|
|||
|
|
|
|||
|
|
**MentalNet Funnies** is a micro-comic CMS that serves as the home for *Debian Osaka*, *Tux*, *Miku*, and other MentalNet.xyz comics.
|
|||
|
|
It’s designed for local hosting on Apache + PHP setups and includes a tiny password-protected admin panel for uploads.
|
|||
|
|
|
|||
|
|
### ✨ Features
|
|||
|
|
|
|||
|
|
* 🖼 Upload, title, and describe new comics via a web form
|
|||
|
|
* 💾 SQLite database — no external DB needed
|
|||
|
|
* 🔐 Password-protected admin area
|
|||
|
|
* 📱 Mobile-friendly front page (`index.php`)
|
|||
|
|
* 🪶 Compact iframe version (`funnies-frame.php`) for embedding
|
|||
|
|
* ⚙️ One-click database initializer (`init_db.php`)
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 📁 Directory Structure
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
/var/www/html/funnies/
|
|||
|
|
├── index.php # Main public comic viewer
|
|||
|
|
├── funnies-frame.php # Small-width iframe-friendly viewer
|
|||
|
|
├── uploads/ # Comic image storage
|
|||
|
|
├── mentalnet_funnies.db # SQLite database file
|
|||
|
|
├── admin/
|
|||
|
|
│ ├── auth.php # Login handler
|
|||
|
|
│ ├── config.php # Config & DB setup
|
|||
|
|
│ ├── upload.php # Upload interface
|
|||
|
|
│ ├── init_db.php # Manual DB table initializer
|
|||
|
|
└── README.md # This file
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## ⚙️ Installation
|
|||
|
|
|
|||
|
|
1. **Create directory & set permissions**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
sudo mkdir -p /var/www/html/funnies/uploads
|
|||
|
|
sudo chown -R www-data:www-data /var/www/html/funnies
|
|||
|
|
sudo chmod -R 755 /var/www/html/funnies
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
2. **Set up the admin password**
|
|||
|
|
Generate a bcrypt hash:
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
php -r 'echo password_hash("YourStrongPassword", PASSWORD_DEFAULT), PHP_EOL;'
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
Then place that hash inside `admin/config.php` under:
|
|||
|
|
|
|||
|
|
```php
|
|||
|
|
$ADMIN_PASS_HASH = '$2y$10$replace_with_real_hash';
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
3. **Initialize the database**
|
|||
|
|
Visit:
|
|||
|
|
`https://yourdomain.com/funnies/admin/init_db.php`
|
|||
|
|
Or run the init script via command-line:
|
|||
|
|
`php init_db.php`
|
|||
|
|
It will create the `comics` table or confirm if it already exists.
|
|||
|
|
|
|||
|
|
4. **Upload a comic**
|
|||
|
|
Visit:
|
|||
|
|
`https://yourdomain.com/funnies/admin/auth.php`
|
|||
|
|
Log in and use the form to upload images and descriptions.
|
|||
|
|
|
|||
|
|
5. **View your comics**
|
|||
|
|
|
|||
|
|
* Main gallery: `https://yourdomain.com/funnies/`
|
|||
|
|
* Iframe feed: `https://yourdomain.com/funnies/funnies-frame.php`
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 🪄 Embedding the Funnies Frame
|
|||
|
|
|
|||
|
|
The iframe viewer (`funnies-frame.php`) is optimized for small layouts (≈ 325 px).
|
|||
|
|
Example embed:
|
|||
|
|
|
|||
|
|
```html
|
|||
|
|
<iframe src="https://mentalnet.xyz/funnies/funnies-frame.php"
|
|||
|
|
width="325"
|
|||
|
|
height="500"
|
|||
|
|
frameborder="0"
|
|||
|
|
scrolling="yes"
|
|||
|
|
style="border-radius:8px;overflow:hidden;">
|
|||
|
|
</iframe>
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
> 💡 You can adjust image width inside `funnies-frame.php` (default: 250 px for compact display).
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 🛡 Security Notes
|
|||
|
|
|
|||
|
|
* Only the admin section (`/admin/`) requires authentication.
|
|||
|
|
* Use strong passwords and HTTPS.
|
|||
|
|
* The upload form restricts to images only.
|
|||
|
|
* SQLite DB and uploads folder should be owned by `www-data` with 755 perms.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 🧩 Customization Ideas
|
|||
|
|
|
|||
|
|
* Add a “View All Comics →” link inside the iframe version.
|
|||
|
|
* Include navigation buttons (Next / Previous comic).
|
|||
|
|
* Implement tags or short titles for categorization.
|
|||
|
|
* Add a JSON API endpoint for future integration with other MentalNet services.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 🧰 License
|
|||
|
|
|
|||
|
|
MIT License — free to modify and self-host.
|
|||
|
|
Created by **MarkMental** as part of the **mentalnet.xyz** web ecosystem.
|
|||
|
|
|
|||
|
|
> “In the MentalNet, Tux is root — and Miku too.” 🐧🎤
|
|||
|
|
|
|||
|
|
|