Aggiunge monitoraggio ops: health check, log scanner, dashboard e notifiche.

Introduce incidenti con dedup, job Sidekiq ogni 3 min, scan log cron, /up/deep,
dashboard /admin/ops e push ntfy; include Sentry opzionale e fix test suite.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-12 08:16:47 +02:00
parent ce8939fffb
commit 52cfffb83f
44 changed files with 1396 additions and 24 deletions

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Scansiona log Docker recenti e invia pattern sospetti a Rails ops:ingest_logs.
set -euo pipefail
ROOT="${MATCHLIVETV_INFRA:-/opt/matchlivetv/infra}"
SINCE="${OPS_LOG_SCAN_SINCE:-10m}"
TMP="$(mktemp)"
trap 'rm -f "$TMP"' EXIT
cd "$ROOT"
docker compose -f docker-compose.prod.yml logs --since "$SINCE" rails sidekiq mediamtx 2>/dev/null > "$TMP" || true
if [[ ! -s "$TMP" ]]; then
exit 0
fi
"${ROOT}/scripts/cron/run_rails_task.sh" ops:ingest_logs["$TMP"]