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>
19 lines
483 B
Bash
19 lines
483 B
Bash
#!/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"]
|