Doku: notify_push umgesetzt, Docker-NAT für iptables=false.

Sidecar statt Docker Mod, manuelles MASQUERADE via docker-nat-rules.service dokumentiert.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
root
2026-06-28 10:45:59 +02:00
parent 3b12324d4e
commit e0f3953979
3 changed files with 102 additions and 85 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ Schritt-für-Schritt-Anleitungen für Updates und Optimierungen — **noch nicht
|----------|--------|
| [nextcloud-optimierung-und-updates.md](nextcloud-optimierung-und-updates.md) | Nextcloud auf VM 101: Versionsstand, Minor-Update, Tuning, notify_push, DB-Indizes |
| [nextcloud-tuning-freigabe.md](nextcloud-tuning-freigabe.md) | **Umgesetzt:** PHP-FPM, APCu, Cron (2026-06-28) |
| [nextcloud-notify-push-freigabe.md](nextcloud-notify-push-freigabe.md) | **Zur Absegnung:** notify_push via Linuxserver Docker Mod |
| [nextcloud-notify-push-freigabe.md](nextcloud-notify-push-freigabe.md) | **Umgesetzt:** notify_push via Sidecar (Mod nicht nutzbar) |
**Ist-Doku (Status quo):** [../pve1/06_ubuntu-vm-nextcloud.md](../pve1/06_ubuntu-vm-nextcloud.md)
+73 -75
View File
@@ -1,8 +1,8 @@
# Freigabe: notify_push (Client Push / Rust HPB)
**Status:** **Zur Absegnung — noch nicht umgesetzt**
**Status:** **Umgesetzt (2026-06-28)** — Sidecar statt Docker Mod (Mod scheiterte an fehlendem Container-Internet)
**Erstellt:** 2026-06-28
**Betrifft:** VM 101 ubuntu · Container `nextcloud` · NPM · **kein** NC-Version-Upgrade
**Betrifft:** VM 101 ubuntu · Container `nextcloud` + `nextcloud-notify-push` · NPM · **kein** NC-Version-Upgrade
Dieses Dokument beschreibt den geplanten Rollout von **notify_push** (High Performance Backend für Files, Rust-Daemon). Ziel: weniger Client-Polling (`index.php/204`, `status.php`) → weniger PHP-FPM-Last.
@@ -20,12 +20,13 @@ Dieses Dokument beschreibt den geplanten Rollout von **notify_push** (High Perfo
## Kurzfassung
| Was | Empfehlung |
| Was | Umsetzung |
|-----|------------|
| **Deploy-Methode** | **Linuxserver Docker Mod** (nicht separater Sidecar) |
| **Compose-Änderung** | 1 Zeile: `DOCKER_MODS=linuxserver/mods:nextcloud-notify-push` |
| **Deploy-Methode** | **Sidecar** `ghcr.io/nextcloud/notify_push:latest` mit `network_mode: service:nextcloud` |
| **Compose-Änderung** | Neuer Service `notify_push` (Docker Mod **nicht** nutzbar — siehe unten) |
| **NPM-Änderung** | **Keine**`/push/` wird im Nextcloud-Container terminiert |
| **App** | `notify_push` v1.3.3 (NC 34 kompatibel) |
| **App** | `notify_push` v1.3.3 manuell in `apps/` (App Store aus Container nicht erreichbar) |
| **`trusted_proxies`** | `127.0.0.1` ergänzt (Index 3) |
| **Erwarteter Effekt** | Deutlich weniger Polling-Requests in Nginx-Logs |
---
@@ -57,7 +58,7 @@ NPM (10.2.2.254) ← TLS, WebSocket-Upgrade (bereits konfiguriert)
Nextcloud-Container (10.2.2.253)
├── Nginx location ^~ /push/ → 127.0.0.1:7867
└── notify_push (Rust) ← via Docker Mod, Port 7867 intern
└── notify_push (Sidecar) ← `network_mode: service:nextcloud`, Port 7867 intern
├── Redis (nextcloud-redis-1) ← Pub/Sub
└── MariaDB (nextcloud-db-1)
@@ -67,73 +68,77 @@ Nextcloud-Container (10.2.2.253)
---
## Empfohlene Methode: Linuxserver Docker Mod
## Geplante Methode vs. tatsächliche Umsetzung
Ihr nutzt `lscr.io/linuxserver/nextcloud:latest`. Linuxserver bietet dafür einen **offiziellen Mod** an — der passt besser als ein separater Sidecar-Container:
**Geplant war:** Linuxserver Docker Mod (`DOCKER_MODS=linuxserver/mods:nextcloud-notify-push`).
| | Docker Mod (empfohlen) | Separater Sidecar |
**Ergebnis beim Test:** Mod blieb bei `[mod-init] Running Docker Modification Logic` hängen — der Nextcloud-Container hatte **kein ausgehendes Internet**. Ursache: `iptables: false` in Docker (absichtlich für docbr0-Fest-IPs) ohne manuelles NAT. **Behoben 2026-06-28** via `docker-nat-rules.service` auf VM 101. Mod zurückgenommen, Sidecar deployed (Sidecar bleibt produktiv).
| | Docker Mod (geplant) | Sidecar (umgesetzt) |
|--|------------------------|-------------------|
| Wartung | offiziell von Linuxserver | manuell (Binary-Version, Netzwerk) |
| Nginx `/push/` | bereits in `default.conf` | NPM Custom Location nötig |
| `trusted_proxies`-Probleme | selten (Push lokal im Container) | häufig (GitHub #663) |
| Compose-Änderung | 1 Env-Variable | neuer Service + Netzwerk |
| Wartung | offiziell von Linuxserver | Image `ghcr.io/nextcloud/notify_push` |
| Nginx `/push/` | bereits in `default.conf` | gleich — kein NPM nötig |
| `trusted_proxies` | selten nötig | `127.0.0.1` ergänzt |
| Compose | 1 Env-Variable | eigener Service + `network_mode: service:nextcloud` |
Mod-Doku: https://github.com/linuxserver/docker-mods/tree/nextcloud-notify-push
Mod-Doku (Referenz): https://github.com/linuxserver/docker-mods/tree/nextcloud-notify-push
---
## Geplante Änderungen (Detail)
## Umgesetzte Änderungen (Detail)
### 1. `/opt/stacks/nextcloud/compose.yml`
**Nur** beim Service `nextcloud` unter `environment` ergänzen:
### 1. `/opt/stacks/nextcloud/compose.yml` — Sidecar-Service
```yaml
nextcloud:
# … bestehende Einträge …
environment:
- PUID=33
- PGID=33
- TZ=Etc/UTC
- DOCKER_MODS=linuxserver/mods:nextcloud-notify-push # NEU
notify_push:
logging: *default-logging
image: ghcr.io/nextcloud/notify_push:latest
container_name: nextcloud-notify-push
restart: unless-stopped
network_mode: "service:nextcloud"
depends_on:
- nextcloud
volumes:
- ./config/www/nextcloud/config/config.php:/config/config.php:ro
command: ["/notify_push", "--port", "7867", "--nextcloud-url", "http://127.0.0.1", "/config/config.php"]
```
**Nicht ändern:** `db`, `redis`, `collabora`, Volumes, Netzwerke, Image-Tag.
`network_mode: service:nextcloud` teilt den Netzwerk-Namespace — Daemon lauscht auf `127.0.0.1:7867`, Nginx `/push/` funktioniert ohne NPM-Änderung.
### 2. Container neu erstellen (nur `nextcloud`)
`--nextcloud-url http://127.0.0.1` umgeht TLS-Fehler beim internen Self-Test (`CaUsedAsEndEntity` gegen `https://cloud.jeanavril.com`).
### 2. Sidecar starten
```bash
cd /opt/stacks/nextcloud
docker compose pull nextcloud
docker compose up -d --force-recreate nextcloud
sudo docker compose up -d notify_push
```
**Hinweis:** Wie beim PHP-FPM-Tuning reicht `docker restart` **nicht** — Mod wird beim Container-**Erstellen** geladen.
**Erwartete Unterbrechung:** ~1030 s für Nextcloud (Clients reconnecten automatisch).
### 3. App installieren & aktivieren
### 3. App manuell installieren (App Store aus Container nicht erreichbar)
```bash
docker exec -u abc nextcloud php /app/www/public/occ app:install notify_push
docker exec -u abc nextcloud php /app/www/public/occ app:enable notify_push
# GitHub-Tarball v1.3.3 auf Host mit Internet laden, nach VM kopieren:
curl -sL "https://api.github.com/repos/nextcloud/notify_push/tarball/v1.3.3" -o /tmp/notify_push-src.tar.gz
# Entpacken nach /opt/stacks/nextcloud/config/www/nextcloud/apps/notify_push
# (custom_apps wurde vom Scanner nicht erkannt — apps/ nutzen)
sudo chown -R www-data:www-data .../apps/notify_push
sudo docker exec -u abc nextcloud php /app/www/public/occ app:enable notify_push
```
(Falls App-Store nicht erreichbar: manuell v1.3.3 von https://apps.nextcloud.com/apps/notify_push)
### 4. Setup-Wizard
### 4. Setup + trusted_proxies
```bash
docker exec -u abc nextcloud php /app/www/public/occ notify_push:setup https://cloud.jeanavril.com/push
sudo docker exec -u abc nextcloud php /app/www/public/occ config:system:set trusted_proxies 3 --value=127.0.0.1
sudo docker exec -u abc nextcloud php /app/www/public/occ notify_push:setup https://cloud.jeanavril.com/push
```
Der Wizard prüft automatisch: Erreichbarkeit, WebSocket, Reverse Proxy, Redis.
Der Wizard prüft automatisch: Erreichbarkeit, WebSocket, Reverse Proxy, Redis. **Ergebnis 2026-06-28:** alle Checks grün, `configuration saved`.
### 5. Logs prüfen
### 5. Logs / Metriken prüfen
```bash
docker logs nextcloud 2>&1 | grep -i notify
# Erwartet: "**** Starting notify-push ****"
docker logs nextcloud-notify-push 2>&1 | tail -20
docker exec -u abc nextcloud php /app/www/public/occ notify_push:metrics
```
---
@@ -252,10 +257,10 @@ docker exec nextcloud tail -f /config/log/nginx/access.log | grep -E 'status\.ph
**Erfolgskriterien:**
- [ ] `notify_push:setup` ohne Fehler
- [ ] Log: „Starting notify-push“
- [ ] `notify_push:metrics` zeigt Verbindungen (sobald Clients online)
- [ ] Weniger `index.php/204` / `status.php` in Access-Log vs. vorher
- [x] `notify_push:setup` ohne Fehler (2026-06-28)
- [x] Sidecar lauscht auf Port 7867 (`ss -tlnp` im nextcloud-Netzns)
- [x] `notify_push:metrics` erreichbar (Verbindungen steigen sobald Clients online)
- [ ] Weniger `index.php/204` / `status.php` in Access-Log vs. vorher (24h Beobachtung)
- [ ] Kein erneuter PHP-FPM-Auslastungs-Incident unter Normal-Last
---
@@ -277,41 +282,34 @@ docker exec nextcloud tail -f /config/log/nginx/access.log | grep -E 'status\.ph
---
## Umsetzungs-Befehle (nach Freigabe)
## Umsetzungs-Befehle (Referenz — ausgeführt 2026-06-28)
```bash
# Auf VM 101 (als jean mit sudo) oder via SSH
# A) compose.yml editieren — DOCKER_MODS Zeile hinzufügen (siehe oben)
# B) Deploy
# Sidecar in compose.yml (siehe oben), dann:
cd /opt/stacks/nextcloud
sudo docker compose pull nextcloud
sudo docker compose up -d --force-recreate nextcloud
sleep 15
sudo docker logs nextcloud 2>&1 | tail -30
sudo docker compose up -d notify_push
# C) App + Setup
sudo docker exec -u abc nextcloud php /app/www/public/occ app:install notify_push
# App manuell + Setup
sudo docker exec -u abc nextcloud php /app/www/public/occ app:enable notify_push
sudo docker exec -u abc nextcloud php /app/www/public/occ config:system:set trusted_proxies 3 --value=127.0.0.1
sudo docker exec -u abc nextcloud php /app/www/public/occ notify_push:setup https://cloud.jeanavril.com/push
# D) Metriken
sudo docker exec -u abc nextcloud php /app/www/public/occ notify_push:metrics
```
**Snapshot vor Umsetzung:** `pre-notify-push-20260628` auf VM 101.
---
## Alternative (nicht empfohlen): Separater Sidecar-Container
## Alternative: Docker Mod (nicht nutzbar ohne Container-Internet)
Falls der Docker Mod Probleme macht, wäre ein separater Container mit `ghcr.io/nextcloud/notify_push` möglich — erfordert dann:
Der Linuxserver Mod wäre wartungsärmer, scheiterte aber am fehlenden ausgehenden Internet im Nextcloud-Container. **Falls Container-Netzwerk repariert wird**, Mod erneut testen:
- neuen Service in `compose.yml` mit `DATABASE_URL`, `REDIS_URL`, `NEXTCLOUD_URL`
- NPM Custom Location `/push` → Sidecar-IP:7867
- `trusted_proxies` für Sidecar-Subnetz
- Netzwerk-Anbindung an `nextcloud_default` + ggf. `docbr0`
```yaml
environment:
- DOCKER_MODS=linuxserver/mods:nextcloud-notify-push
```
**Für euren Stack nicht empfohlen** — Mod ist der offizielle Linuxserver-Weg und vermeidet die meisten Proxy-Probleme.
Dann Sidecar entfernen und `docker compose up -d --force-recreate nextcloud`.
---
@@ -319,13 +317,13 @@ Falls der Docker Mod Probleme macht, wäre ein separater Container mit `ghcr.io/
| | |
|---|---|
| | **Freigegeben**Docker Mod wie beschrieben umsetzen |
| ☐ | **Anpassung** — z. B. Sidecar statt Mod, oder erst Snapshot |
| | **Freigegeben & umgesetzt**Sidecar (Mod wegen fehlendem Container-Internet verworfen) |
| ☐ | **Anpassung** |
| ☐ | **Abgelehnt / später** |
**Freigegeben von:** _______________
**Datum:** _______________
**Anmerkungen:** _______________
**Freigegeben von:** Jean
**Datum:** 2026-06-28
**Anmerkungen:** Docker Mod getestet, Sidecar mit `network_mode: service:nextcloud` produktiv.
---