Documenta l'architettura completa del sistema.

Aggiunge docs/ARCHITECTURE.md con topologia rete, edge nginx, flussi HLS/replay e monitoraggio ops; allinea i documenti esistenti.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-14 21:26:35 +02:00
parent a44d9fbadd
commit 498f6069d0
5 changed files with 436 additions and 14 deletions

View File

@@ -2,7 +2,9 @@
**Server:** `eminux@192.168.1.146` (Debian 13)
**Path deploy:** `~/matchlivetv` (dopo bootstrap opzionale: `/opt/matchlivetv`)
**Ultimo aggiornamento:** 2026-05-27
**Ultimo aggiornamento:** 2026-06-14
> Architettura completa: [ARCHITECTURE.md](../ARCHITECTURE.md)
---
@@ -11,12 +13,15 @@
```
Internet
├──► Router WAN :443 ──► Nginx Proxy Manager (LAN) ──► http://192.168.1.146:3000 (Rails API + Action Cable)
├──► Router WAN :443 ──► Nginx Proxy Manager (LAN) ──► http://192.168.1.146:3000 (edge nginx)
│ ├── /hls/ → MediaMTX :8888
│ ├── /media/ → Garage :3900
│ └── / → Rails (API + web)
└──► Router WAN :1935 ──► MediaMTX RTMP (telefoni, ingest video diretto)
```
Il flusso video **non passa da Rails**: telefono → RTMP :1935 → MediaMTX → relay ffmpeg → YouTube.
Il flusso video live e replay **non passa da Puma**: HLS e MP4 sono serviti da edge verso MediaMTX e Garage; Rails fa auth e redirect.
---
@@ -68,11 +73,7 @@ Il flusso video **non passa da Rails**: telefono → RTMP :1935 → MediaMTX →
Durante i rilasci Rails viene mostrata una **pagina di cortesia** invece del 502 bianco di NPM.
2. **Websockets:** ON (obbligatorio per `/cable`)
3. **Custom location HLS** (spettatori):
- Location: `/hls`
- Forward: `http://192.168.1.146:8888` (in NPM usare proxy pass che **rimuove** il prefisso `/hls`, così MediaMTX riceve `/live/match_{uuid}/index.m3u8`)
- Scheme: http
- URL pubblico: `https://www.matchlivetv.it/hls/live/match_{uuid}/index.m3u8`
3. **HLS:** nessuna custom location necessaria — edge instrada `/hls/` verso MediaMTX internamente. Un solo Proxy Host verso `:3000` basta.
4. SSL Let's Encrypt su NPM
5. Aggiorna `infra/.env` sul server:
- `APP_PUBLIC_URL=https://www.matchlivetv.it`