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

@@ -13,7 +13,7 @@ module Recordings
return @recording unless @recording.expires_at <= WINDOW_DAYS.days.from_now
recipients.each do |user|
Recordings::ReplayMailer.replay_expiring_soon(recording: @recording, recipient: user).deliver_now
deliver_expiring_soon(user)
end
@recording.update!(expiry_warning_sent_at: Time.current)
@@ -22,6 +22,12 @@ module Recordings
private
def deliver_expiring_soon(user)
Recordings::ReplayMailer.replay_expiring_soon(recording: @recording, recipient: user).deliver_now
rescue EOFError => e
Rails.logger.warn("[Recordings::NotifyExpiring] SMTP EOF on close for #{user.email}: #{e.message}")
end
def recipients
club = @recording.team.club
owner = club.owner

View File

@@ -9,7 +9,7 @@ module Recordings
return @recording unless @recording.ready?
recipients.each do |user|
Recordings::ReplayMailer.replay_ready(recording: @recording, recipient: user).deliver_now
deliver_replay_ready(user)
end
@recording.update!(ready_notified_at: Time.current)
@@ -18,6 +18,13 @@ module Recordings
private
def deliver_replay_ready(user)
Recordings::ReplayMailer.replay_ready(recording: @recording, recipient: user).deliver_now
rescue EOFError => e
# Aruba SMTP (465/SSL) chiude la socket prima del QUIT: la mail è già partita.
Rails.logger.warn("[Recordings::NotifyReady] SMTP EOF on close for #{user.email}: #{e.message}")
end
def recipients
club = @recording.team.club
owner = club.owner

View File

@@ -54,13 +54,18 @@ Rails.application.configure do
if ENV["SMTP_ADDRESS"].present?
config.action_mailer.delivery_method = :smtp
smtp_port = ENV.fetch("SMTP_PORT", 587).to_i
smtp_ssl = ENV.fetch("SMTP_SSL", smtp_port == 465 ? "true" : "false") == "true"
config.action_mailer.smtp_settings = {
address: ENV["SMTP_ADDRESS"],
port: ENV.fetch("SMTP_PORT", 587).to_i,
port: smtp_port,
user_name: ENV["SMTP_USERNAME"],
password: ENV["SMTP_PASSWORD"],
authentication: ENV.fetch("SMTP_AUTH", "plain"),
enable_starttls_auto: ENV.fetch("SMTP_STARTTLS", "true") == "true"
ssl: smtp_ssl,
enable_starttls_auto: !smtp_ssl && ENV.fetch("SMTP_STARTTLS", "true") == "true",
open_timeout: ENV.fetch("SMTP_OPEN_TIMEOUT", "15").to_i,
read_timeout: ENV.fetch("SMTP_READ_TIMEOUT", "60").to_i
}
end
config.i18n.fallbacks = true

View File

@@ -90,7 +90,7 @@ module MatchLiveTv
end
def mail_from
ENV.fetch("MAILER_FROM", "Match Live TV <noreply@matchlive.it>")
ENV.fetch("MAILER_FROM", "Match Live TV <noreply@matchlivetv.it>")
end
def password_reset_expiry_hours