add forgejo, add jupyter

This commit is contained in:
Aron Petau 2025-11-05 14:32:21 +01:00
parent a6d498bda0
commit 98417edd8b
23 changed files with 562 additions and 261 deletions

View file

@ -11,17 +11,21 @@
## 🎯 Features
### Core Application
- **📄 PDF Cost Calculator**: Automated ink coverage analysis with color/B&W detection
- **🖼️ Course Management**: Dynamic course list with image gallery and modal viewer
- **📊 Cost Estimation**: Per-page breakdown with configurable rates (€/m²)
- **💬 Matrix Integration**: Automatic order submission to Matrix room
### Integrated Services
- **📚 BookStack Wiki**: Documentation and knowledge base (port 6875)
- **🤖 Ollama + Open WebUI**: Local LLM chatbot interface (port 8080)
- **📨 Matrix Synapse**: Print order collection and payment tracking (port 8008)
- **🐳 Portainer**: Container management dashboard (port 9000)
- **🔄 Watchtower**: Automatic container updates every 24 hours
- **<EFBFBD> JupyterHub**: Multi-user Jupyter notebook server for drone programming (port 8001)
- **🦊 Forgejo**: Self-hosted Git service for code collaboration (port 3003)
- **<EFBFBD>🔄 Watchtower**: Automatic container updates every 24 hours
---
@ -74,35 +78,55 @@ graph TB
OpenWebUI[💭 Open WebUI<br/>:8080]
Portainer[🐳 Portainer<br/>:9000]
Synapse[📨 Matrix Synapse<br/>:8008]
JupyterHub[📓 JupyterHub<br/>:8001<br/>Drone Programming]
Forgejo[🦊 Forgejo Git<br/>:3003<br/>Code Collaboration]
LP -.-> BookStack
LP -.-> OpenWebUI
LP -.-> Portainer
LP -.-> JupyterHub
LP -.-> Forgejo
OpenWebUI --> Ollama
MatrixRoom --> Synapse
end
subgraph "Educational Stack"
Notebooks[📒 Jupyter Notebooks<br/>Python Drone Code]
GitRepos[📦 Git Repositories<br/>Project Source Code]
DronePackages[🚁 djitellopy<br/>Tello SDK]
JupyterHub --> Notebooks
Forgejo --> GitRepos
Notebooks -.-> DronePackages
end
subgraph "Data Persistence"
Uploads[📁 data/uploads/<br/>PDF Files]
Courses[📋 data/courses.csv<br/>Course List]
MatrixDB[(🗄️ Matrix DB<br/>homeserver.db)]
BookDB[(🗄️ BookStack DB<br/>MariaDB)]
JupyterVolumes[(💾 Jupyter Volumes<br/>User Workspaces)]
ForgejoData[(📚 Forgejo Data<br/>Git Repos)]
Upload --> Uploads
CSV --> Courses
Synapse --> MatrixDB
BookStack --> BookDB
JupyterHub --> JupyterVolumes
Forgejo --> ForgejoData
end
classDef webapp fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef service fill:#fff3e0,stroke:#f57c00,stroke-width:2px
classDef data fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef matrix fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef edu fill:#fce4ec,stroke:#c2185b,stroke-width:2px
class LP,About,Cost,Upload,Analysis,Quote webapp
class BookStack,Ollama,OpenWebUI,Portainer,Synapse service
class Uploads,Courses,MatrixDB,BookDB data
class BookStack,Ollama,OpenWebUI,Portainer,Synapse,JupyterHub,Forgejo service
class Uploads,Courses,MatrixDB,BookDB,JupyterVolumes,ForgejoData data
class MatrixRoom,PDF_Upload,Summary,CSV,Images,Modal matrix
class Notebooks,GitRepos,DronePackages edu
```
---
@ -113,47 +137,55 @@ graph TB
- **Docker** & **Docker Compose** installed
- **Poppler** (for pdf2image - included in Docker)
- **Port availability**: 80, 8008, 8080, 6875, 9000, 11434
- **Port availability**: 80, 3003, 6875, 8001, 8008, 8080, 9000, 11434
### Installation
1. **Clone the repository:**
```bash
git clone https://github.com/arontaupe/124-webapp.git
cd 124-webapp
```
2. **Configure environment:**
```bash
cp .env.example .env
nano .env # Update SERVER_HOSTNAME and passwords
```
3. **Start the stack:**
```bash
docker compose up -d --build
```
4. **Access services:**
- Web App: http://localhost (or http://your-server)
- BookStack: http://localhost:6875
- Open WebUI: http://localhost:8080
- Portainer: http://localhost:9000
- Matrix: http://localhost:8008
- Web App: <http://localhost> (or <http://your-server>)
- BookStack: <http://localhost:6875>
- Open WebUI: <http://localhost:8080>
- Portainer: <http://localhost:9000>
- Matrix: <http://localhost:8008>
- JupyterHub: <http://localhost:8001>
- Forgejo: <http://localhost:3003>
### First-Time Setup
1. **Get Matrix Room ID:**
```bash
python get_room_id.py
```
2. **Update .env with room ID:**
```bash
MATRIX_ROOM="!YourRoomID:${SERVER_HOSTNAME}"
```
3. **Restart web container:**
```bash
docker compose restart web
```
@ -167,12 +199,14 @@ Courses are managed via CSV file with optional images:
### Add a Course
1. **Edit `data/courses.csv`:**
```csv
title,description,dates,offen_fuer,image
My Course,Learn cool stuff,"Oct '25",Grade 10,/static/images/courses/my-course.jpg
```
2. **Add course image (optional):**
```bash
cp my-image.jpg static/images/courses/my-course.jpg
```
@ -180,6 +214,7 @@ Courses are managed via CSV file with optional images:
3. **Changes apply immediately** (no restart needed)
### Course Image Features
- **Thumbnail view**: 80x80px next to course info
- **Hover zoom**: Expands to 200x200px on hover
- **Click to enlarge**: Opens full-size modal viewer
@ -215,6 +250,11 @@ OLLAMA_PORT=11434
OPENWEBUI_PORT=8080
BOOKSTACK_PORT=6875
PORTAINER_PORT=9000
JUPYTER_PORT=8001
FORGEJO_PORT=3003
# JupyterHub Authentication
JUPYTER_PASSWORD=einszwo4
```
See [.env.example](.env.example) for full configuration.
@ -231,12 +271,15 @@ See [.env.example](.env.example) for full configuration.
| **open-webui** | ghcr.io/open-webui/open-webui | 8080 | LLM chat UI | 2 CPU, 2GB RAM |
| **bookstack** | lscr.io/linuxserver/bookstack | 6875 | Documentation wiki | Default |
| **bookstack-mariadb** | lscr.io/linuxserver/mariadb | 3306 | Database for BookStack | Default |
| **jupyterhub** | Custom (Python 3.13) | 8001 | Multi-user Jupyter notebooks | 2 CPU, 2GB RAM |
| **forgejo** | codeberg.org/forgejo/forgejo:11 | 3003, 222 | Git service (web, SSH) | Default |
| **portainer** | portainer/portainer-ce | 9000, 9443 | Container management | Default |
| **watchtower** | containrrr/watchtower | - | Auto-updates (24h) | Default |
### Health Checks
All services have health checks configured:
- **web**: `curl http://localhost:8000/`
- **synapse**: `curl http://localhost:8008/_matrix/static/`
- **ollama**: `curl http://localhost:11434/`
@ -283,6 +326,7 @@ See [SECURITY.md](SECURITY.md) for comprehensive security guidelines.
```
Creates timestamped backups of:
- BookStack database & files
- Matrix homeserver data
- PDF uploads
@ -302,11 +346,13 @@ Creates timestamped backups of:
This application is designed to be **fully portable**. To move to a new server:
1. **On old server:**
```bash
./backup.sh
```
2. **On new server:**
```bash
git clone <repo-url>
cd 124-webapp
@ -393,7 +439,7 @@ This project is part of Studio EinsZwoVier educational initiative.
Gabriele-von-Bülow-Gymnasium
Tile-Brügge-Weg 63, 13509 Berlin (Tegel)
- **Email**: einszwovier@gvb-gymnasium.de
- **Email**: <einszwovier@gvb-gymnasium.de>
- **Team**: Aron Petau & Friedrich Weber
- **Hours**: Tuesday - Thursday, 11:00 - 16:00
- **Location**: Room 124