Mantiene la copertina YouTube se il telefono cade e avvia ffmpeg sul nodo, non via SSH.

Il relay HLS→RTMPS resta sul worker/agent del nodo assegnato, così tre dirette contemporanee restano in onda sul sito e sul canale della società senza schermo nero.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-16 20:41:46 +02:00
co-authored by Cursor
parent bfb3115a64
commit baa6283a15
36 changed files with 1444 additions and 141 deletions
@@ -27,7 +27,8 @@ RSpec.describe Streams::NodeProvisioner do
"MEDIAMTX_API_URL" => "http://mtx-home:9997",
"MEDIAMTX_RTMP_URL" => "rtmp://ingest-home.example:1935",
"HLS_PUBLIC_URL" => "https://ingest-home.example/hls",
"STREAM_LAB_MAX_PUBLISHERS" => "2"
"STREAM_LAB_MAX_PUBLISHERS" => "2",
"MEDIAMTX_LAB_API_URL" => nil
) do
provisioner = described_class.new
node = provisioner.provision_lab!
@@ -45,13 +46,35 @@ RSpec.describe Streams::NodeProvisioner do
end
end
it "attaches a dedicated lab MediaMTX when MEDIAMTX_LAB_API_URL is set" do
with_env(
"STREAM_CLOUD_PROVIDER" => "local_lab",
"STREAM_DNS_PROVIDER" => "lab",
"MEDIAMTX_API_URL" => "http://mtx-home:9997",
"MEDIAMTX_RTMP_URL" => "rtmp://ingest-home.example:1935",
"HLS_PUBLIC_URL" => "https://ingest-home.example/hls",
"MEDIAMTX_LAB_API_URL" => "http://mediamtx_lab:9997",
"MEDIAMTX_LAB_HLS_URL" => "http://mediamtx_lab:8888",
"MEDIAMTX_LAB_INTERNAL_RTMP_URL" => "rtmp://mediamtx_lab:1935",
"MEDIAMTX_LAB_RTMP_URL" => "rtmp://127.0.0.1:11935"
) do
node = described_class.new.provision_lab!
expect(node.api_base_url).to eq("http://mediamtx_lab:9997")
expect(node.internal_rtmp_url).to eq("rtmp://mediamtx_lab:1935")
expect(node.internal_hls_url).to eq("http://mediamtx_lab:8888")
expect(node.rtmp_base_url).to eq("rtmp://127.0.0.1:11935")
expect(node.hls_base_url).to eq("https://ingest-home.example/hls")
end
end
it "refuses to decommission a busy node" do
with_env(
"STREAM_CLOUD_PROVIDER" => "local_lab",
"STREAM_DNS_PROVIDER" => "lab",
"MEDIAMTX_API_URL" => "http://mtx-home:9997",
"MEDIAMTX_RTMP_URL" => "rtmp://ingest-home.example:1935",
"HLS_PUBLIC_URL" => "https://ingest-home.example/hls"
"HLS_PUBLIC_URL" => "https://ingest-home.example/hls",
"MEDIAMTX_LAB_API_URL" => nil
) do
node = described_class.new.provision_lab!
user = User.create!(email: "lab@example.com", name: "L", password: "Password123", role: "coach")