README auf wesentliche Infos gestrafft, Link zur Bedienungsanleitung. BEDIENUNGSANLEITUNG deckt täglichen Betrieb, Update, Backup, Import/Export, User-Management und Troubleshooting ab. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
79 lines
3 KiB
Markdown
79 lines
3 KiB
Markdown
# n8n Stack
|
|
|
|
Produktionsnaher n8n-Stack auf Docker Compose mit PostgreSQL 16, Redis 7 und Queue-Mode.
|
|
|
|
## Architektur
|
|
|
|
```
|
|
Internet → n8n.linix.de:443
|
|
→ YunoHost (192.168.179.10) — TLS-Terminierung (Let's Encrypt)
|
|
→ nginx lokal :8088 (192.168.179.124)
|
|
→ n8n Docker :5678
|
|
↔ PostgreSQL (n8n-stack-postgres-1)
|
|
↔ Redis (n8n-stack-redis-1)
|
|
← n8n-worker (n8n-stack-n8n-worker-1)
|
|
```
|
|
|
|
YunoHost-SSOwat-Bypass: `my_webapp` als registrierter Platzhalter, nginx-Proxy-Block in
|
|
`/etc/nginx/conf.d/n8n.linix.de.d/my_webapp.conf` (wird durch Hook `99-n8n-proxy`
|
|
nach Upgrades automatisch wiederhergestellt).
|
|
|
|
## Verzeichnisstruktur
|
|
|
|
```
|
|
n8n_stack/
|
|
├── compose/docker-compose.yml # Stack-Definition
|
|
├── .env # Secrets (600, nie committen!)
|
|
├── .env.example # Vorlage
|
|
├── scripts/ # Hilfsskripte (700)
|
|
│ └── yunohost-hook-restore-n8n-proxy.sh # Hook-Vorlage für YunoHost
|
|
├── data/ # Docker-Volumes (gitignoriert)
|
|
├── backups/ # Backups, max. 2 (gitignoriert)
|
|
├── imports/workflows/ # Workflow-JSONs zum Importieren
|
|
├── imports/credentials/ # Credential-Exporte (unverschlüsselt!)
|
|
├── local-files/ # Dateien für n8n-Container (/files)
|
|
└── docs/ # nginx-Configs, Runbooks
|
|
```
|
|
|
|
## Schnellstart
|
|
|
|
```bash
|
|
# Stack starten
|
|
docker compose -f compose/docker-compose.yml up -d
|
|
|
|
# Status prüfen
|
|
docker compose -f compose/docker-compose.yml ps
|
|
|
|
# Logs
|
|
docker compose -f compose/docker-compose.yml logs -f n8n
|
|
```
|
|
|
|
Ausführliche Bedienungsanleitung: [BEDIENUNGSANLEITUNG.md](BEDIENUNGSANLEITUNG.md)
|
|
|
|
## Deployment auf neuem Host
|
|
|
|
1. Repo klonen
|
|
2. `.env.example` → `.env` kopieren, alle Werte ausfüllen
|
|
3. Neuen `N8N_ENCRYPTION_KEY` generieren: `openssl rand -base64 32`
|
|
4. `N8N_HOST` und `WEBHOOK_URL` auf neue Domain anpassen
|
|
5. Lokale nginx-Config aus `docs/nginx-local-n8n.conf` aktivieren (Port 8088)
|
|
6. Auf YunoHost: `my_webapp` installieren, nginx-Config durch Proxy ersetzen (siehe `docs/yunohost-nginx-n8n.conf`)
|
|
7. YunoHost-Hook deployen: `scripts/yunohost-hook-restore-n8n-proxy.sh` → `/etc/yunohost/hooks.d/post_app_upgrade/99-n8n-proxy`
|
|
8. `docker compose -f compose/docker-compose.yml up -d`
|
|
|
|
## Kritische Hinweise
|
|
|
|
- **`N8N_ENCRYPTION_KEY`** darf nach dem ersten Start **nie geändert** werden — macht alle gespeicherten Credentials unbrauchbar.
|
|
- **`.env`** nie committen (steht in `.gitignore`).
|
|
- Credential-Exporte enthalten Secrets im **Klartext** — nach Gebrauch löschen.
|
|
- Backup läuft automatisch vor jedem Update via `update-n8n.sh`.
|
|
|
|
## URLs
|
|
|
|
| Was | Wert |
|
|
|---|---|
|
|
| n8n Web-UI | https://n8n.linix.de |
|
|
| Secrets-Datei | `./.env` (Rechte 600) |
|
|
| nginx lokal | `/etc/nginx/sites-available/n8n` (Port 8088) |
|
|
| YunoHost nginx | `/etc/nginx/conf.d/n8n.linix.de.d/my_webapp.conf` |
|
|
| YunoHost Hook | `/etc/yunohost/hooks.d/post_app_upgrade/99-n8n-proxy` |
|