Sposta storage video su disco dedicato e completa ops/SMTP in produzione.

Recordings e Garage usano bind mount su /media/videos; aggiunge ntfy self-hosted,
notifiche critical+warning, SMTP Aruba SSL/465 e fix cron replay.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-12 23:13:08 +02:00
parent 52cfffb83f
commit da75582dae
14 changed files with 278 additions and 44 deletions

View File

@@ -14,25 +14,63 @@ Sistema integrato per health check continui, analisi log, dashboard incidenti e
| `/admin/ops` | Dashboard incidenti |
| `GET /up/deep` | Health check esteso (JSON) |
## Setup notifiche ntfy (telefono)
## Setup notifiche ntfy self-hosted (telefono)
1. Installa l'app [ntfy](https://ntfy.sh) su Android/iOS
2. Scegli un topic segreto (es. `matchlivetv-ops-eminux-a8f3b2`)
3. Iscriviti al topic nell'app
4. Sul server, in `infra/.env`:
Le push **ops** (disco pieno, Sidekiq, servizi giù) non passano da Firebase: Rails invia un POST al server **ntfy** incluso in `docker-compose.prod.yml`.
### 1. Server (Docker)
```bash
OPS_NTFY_URL=https://ntfy.sh/matchlivetv-ops-eminux-a8f3b2
OPS_NOTIFY_SEVERITIES=critical
cd /opt/matchlivetv/infra
docker compose -f docker-compose.prod.yml --env-file .env up -d ntfy
```
Servizio in ascolto su **LAN** `http://192.168.1.146:8090` (non esporre 8090 su Internet).
### 2. HTTPS (Nginx Proxy Manager)
Crea un **Proxy Host** (consigliato sottodominio dedicato):
| Campo | Valore |
|-------|--------|
| Domain | `ntfy.matchlivetv.it` |
| Forward | `http://192.168.1.146:8090` |
| WebSockets | **ON** |
| SSL | Let's Encrypt |
In `infra/.env`:
```bash
NTFY_PUBLIC_URL=https://ntfy.matchlivetv.it
OPS_NTFY_TOPIC=matchlivetv-ops-eminux-a8f3b2 # topic segreto, a piacere
OPS_NTFY_URL=http://ntfy:80/matchlivetv-ops-eminux-a8f3b2
OPS_NOTIFY_SEVERITIES=critical,warning
OPS_NOTIFY_COOLDOWN_MINUTES=30
```
5. Test:
`OPS_NTFY_URL` usa il nome Docker `ntfy` (rete interna). Il telefono usa invece `NTFY_PUBLIC_URL`.
### 3. App sul telefono
1. Installa [ntfy](https://ntfy.sh) (Android/iOS)
2. **Impostazioni → Default server** (o «Usa altro server») → `https://ntfy.matchlivetv.it`
In casa, in alternativa: `http://192.168.1.146:8090`
3. **+** → iscriviti al topic `OPS_NTFY_TOPIC` (es. `matchlivetv-ops-eminux-a8f3b2`)
4. Abilita notifiche per quel topic
### 4. Test
```bash
docker compose -f docker-compose.prod.yml exec -T rails bundle exec rails ops:test_notify
```
Dovresti ricevere una push «Test notifica ops» sul telefono.
### Sicurezza
- Il topic è la «password»: usa un nome lungo e casuale, non pubblicarlo
- Opzionale: abilita auth su ntfy (`OPS_NTFY_TOKEN` + utente in `user.db`) per topic protetti
## Variabili ambiente
Vedi [`infra/.env.production.example`](../infra/.env.production.example).