From 6ad39e776e0dc03a5f5dfa2fa53907e7544e1340 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 7 Jun 2026 17:44:59 +0100 Subject: [PATCH] Add Idunn Raven capture mux watchdog --- docs/idunn.md | 8 +++++++- scripts/health-raven-capture-mux.cmd | 2 ++ scripts/health-raven-capture-mux.ps1 | 9 +++++++++ scripts/restart-raven-capture-mux.cmd | 2 ++ scripts/restart-raven-capture-mux.ps1 | 28 +++++++++++++++++++++++++++ scripts/start-idunn-local.ps1 | 7 +++++++ 6 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 scripts/health-raven-capture-mux.cmd create mode 100644 scripts/health-raven-capture-mux.ps1 create mode 100644 scripts/restart-raven-capture-mux.cmd create mode 100644 scripts/restart-raven-capture-mux.ps1 diff --git a/docs/idunn.md b/docs/idunn.md index 7c8e569..96f087c 100644 --- a/docs/idunn.md +++ b/docs/idunn.md @@ -49,7 +49,9 @@ Idunn now shares Odin's Rust body: - `src/Idunn/README.md` is the user-facing introduction for developers, operators, and daemon authors. - `scripts/start-idunn-local.ps1` starts resident local watchdogs, including - VoidBot through `health-voidbot.cmd` and `restart-voidbot.cmd`. + VoidBot through `health-voidbot.cmd` and `restart-voidbot.cmd`, and Raven's + capture mux through `health-raven-capture-mux.cmd` and + `restart-raven-capture-mux.cmd`. - `scripts/notify-idunn-operator-alarm.ps1` is the local operator crossing: Idunn invokes it only after raising an operator alarm, and it asks Bifrost to publish a typed `gamecult.operator_dm_request.v1` CultMesh command document @@ -102,6 +104,10 @@ idunn.operator_alarm.v1 environment variables to `E:\Projects\Bifrost\tools\operator-notification.mjs publish-idunn-alarm`. Bifrost publishes the typed CultMesh command document; Idunn only decides that an alarm exists. +- Raven capture continuity is a remote keepalive path. Idunn probes + `http://127.0.0.1:8801/health` through SSH to Raven's WireGuard address + `10.77.0.4` and restarts through Mimir's `start-raven-daemon.ps1` with + Mimir and OBS SRT targets declared separately. ## First Runtime Direction diff --git a/scripts/health-raven-capture-mux.cmd b/scripts/health-raven-capture-mux.cmd new file mode 100644 index 0000000..97b8482 --- /dev/null +++ b/scripts/health-raven-capture-mux.cmd @@ -0,0 +1,2 @@ +@echo off +powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\health-raven-capture-mux.ps1 diff --git a/scripts/health-raven-capture-mux.ps1 b/scripts/health-raven-capture-mux.ps1 new file mode 100644 index 0000000..3386206 --- /dev/null +++ b/scripts/health-raven-capture-mux.ps1 @@ -0,0 +1,9 @@ +param( + [string] $RavenHost = "10.77.0.4", + [string] $HealthUrl = "http://127.0.0.1:8801/health" +) + +$ErrorActionPreference = "Stop" + +& ssh.exe -o BatchMode=yes -o ConnectTimeout=5 $RavenHost "curl.exe -fsS $HealthUrl >NUL" +exit $LASTEXITCODE diff --git a/scripts/restart-raven-capture-mux.cmd b/scripts/restart-raven-capture-mux.cmd new file mode 100644 index 0000000..bab354c --- /dev/null +++ b/scripts/restart-raven-capture-mux.cmd @@ -0,0 +1,2 @@ +@echo off +powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\restart-raven-capture-mux.ps1 diff --git a/scripts/restart-raven-capture-mux.ps1 b/scripts/restart-raven-capture-mux.ps1 new file mode 100644 index 0000000..7f477cb --- /dev/null +++ b/scripts/restart-raven-capture-mux.ps1 @@ -0,0 +1,28 @@ +param( + [string] $RavenHost = "10.77.0.4", + [string] $MimirRepo = "E:\Projects\Mimir", + [string] $TargetHost = "10.77.0.2", + [int] $Port = 5200, + [string] $ObsTargetHost = "10.77.0.2", + [int] $ObsPort = 5204 +) + +$ErrorActionPreference = "Stop" + +$remoteScript = @" +`$ErrorActionPreference = "Stop" +`$startScript = Join-Path "$MimirRepo" "scripts\start-raven-daemon.ps1" +if (-not (Test-Path -LiteralPath `$startScript)) { + throw "Raven Mimir start script not found at `$startScript" +} +Get-CimInstance Win32_Process | + Where-Object { `$_.Name -ieq "dotnet.exe" -and `$_.CommandLine -like "*Mimir.RavenDaemon*" } | + ForEach-Object { + & taskkill.exe /PID `$_.ProcessId /T /F | Out-Null + } +& powershell.exe -NoProfile -ExecutionPolicy Bypass -File `$startScript -TargetHost "$TargetHost" -Port $Port -ObsTargetHost "$ObsTargetHost" -ObsPort $ObsPort +"@ + +$encoded = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($remoteScript)) +& ssh.exe -o BatchMode=yes -o ConnectTimeout=10 $RavenHost "powershell.exe -NoProfile -EncodedCommand $encoded" +exit $LASTEXITCODE diff --git a/scripts/start-idunn-local.ps1 b/scripts/start-idunn-local.ps1 index fc0dfec..51de1b6 100644 --- a/scripts/start-idunn-local.ps1 +++ b/scripts/start-idunn-local.ps1 @@ -55,6 +55,13 @@ $watchdogs = @( Restart = "$repoRoot\scripts\restart-voidbot.cmd" IntervalSeconds = 300 }, + [pscustomobject]@{ + Id = "raven-capture-mux" + Name = "Raven capture mux" + Verse = "raven.local" + Health = "$repoRoot\scripts\health-raven-capture-mux.cmd" + Restart = "$repoRoot\scripts\restart-raven-capture-mux.cmd" + }, [pscustomobject]@{ Id = "nightwing-gjallar" Name = "Nightwing Gjallar framebuffer compositor"