module MatchLiveTv class << self def jwt_secret ENV.fetch("JWT_SECRET", Rails.application.secret_key_base) end def mediamtx_api_url ENV.fetch("MEDIAMTX_API_URL", "http://localhost:9997") end def mediamtx_rtmp_url ENV.fetch("MEDIAMTX_RTMP_URL", "rtmp://localhost:1935") end def mediamtx_webhook_secret ENV.fetch("MEDIAMTX_WEBHOOK_SECRET", "change_me") end def reconnect_timeout_seconds ENV.fetch("RECONNECT_TIMEOUT_SECONDS", "300").to_i end def hls_public_url ENV.fetch("HLS_PUBLIC_URL", "http://localhost:8888") end def mediamtx_hls_url ENV.fetch("MEDIAMTX_HLS_URL", "http://mediamtx:8888") end def app_public_url ENV.fetch("APP_PUBLIC_URL", "http://localhost:3000") end def stripe_secret_key ENV["STRIPE_SECRET_KEY"].presence end def stripe_webhook_secret ENV["STRIPE_WEBHOOK_SECRET"].presence end def stripe_premium_light_yearly_price_id ENV["STRIPE_PREMIUM_LIGHT_YEARLY_PRICE_ID"].presence || ENV["STRIPE_PREMIUM_LIGHT_PRICE_ID"].presence || ENV["STRIPE_PREMIUM_PRICE_ID"].presence end def stripe_premium_light_monthly_price_id ENV["STRIPE_PREMIUM_LIGHT_MONTHLY_PRICE_ID"].presence end def stripe_premium_full_yearly_price_id ENV["STRIPE_PREMIUM_FULL_YEARLY_PRICE_ID"].presence || ENV["STRIPE_PREMIUM_FULL_PRICE_ID"].presence || ENV["STRIPE_PREMIUM_PRICE_ID"].presence end def stripe_premium_full_monthly_price_id ENV["STRIPE_PREMIUM_FULL_MONTHLY_PRICE_ID"].presence end # Retrocompatibilità def stripe_premium_light_price_id stripe_premium_light_yearly_price_id.to_s end def stripe_premium_full_price_id stripe_premium_full_yearly_price_id.to_s end def stripe_enabled? stripe_secret_key.present? end def privacy_controller_name ENV.fetch("PRIVACY_CONTROLLER_NAME", "Emiliano Frascaro") end def privacy_controller_email ENV.fetch("PRIVACY_CONTACT_EMAIL", "privacy@matchlive.it") end def privacy_controller_address ENV.fetch("PRIVACY_CONTROLLER_ADDRESS", "Via Guido De Ruggiero, 89 - 20142 - Milano (MI)") end def privacy_controller_vat ENV["PRIVACY_CONTROLLER_VAT"].presence end def mail_from ENV.fetch("MAILER_FROM", "Match Live TV ") end def password_reset_expiry_hours ENV.fetch("PASSWORD_RESET_EXPIRY_HOURS", "2").to_i end def replay_storage_configured? replay_storage_endpoint.present? || replay_storage_local? end def replay_storage_endpoint ENV["REPLAY_STORAGE_ENDPOINT"].presence end def replay_storage_bucket ENV.fetch("REPLAY_STORAGE_BUCKET", "matchlivetv-replays") end def replay_storage_region ENV.fetch("REPLAY_STORAGE_REGION", "garage") end def replay_storage_access_key_id ENV["REPLAY_STORAGE_ACCESS_KEY_ID"].presence end def replay_storage_secret_access_key ENV["REPLAY_STORAGE_SECRET_ACCESS_KEY"].presence end def replay_storage_force_path_style? ENV.fetch("REPLAY_STORAGE_FORCE_PATH_STYLE", "true") == "true" end def replay_storage_local? replay_storage_endpoint.blank? end def recordings_local_path ENV.fetch("RECORDINGS_PATH", "/recordings") end def replay_presigned_url_ttl_seconds ENV.fetch("REPLAY_PRESIGNED_URL_TTL_SECONDS", "7200").to_i end def replay_download_url_ttl_seconds ENV.fetch("REPLAY_DOWNLOAD_URL_TTL_SECONDS", "900").to_i end end end