diagnostics(voice/pathfinding): trace Firestorm fallback and add deployment preflight (#130)
* fix(voice): make missing WebRTC provider and Vivox fallback diagnosable without advertising false CAPS * diagnostics(pathfinding): report true native A-star readiness and missing Firestorm NavMesh contract * tools: add safe read-only Firestorm voice and native pathfinding deployment preflight * test(diagnostics): cover voice fallback, safe gateway URLs and honest pathfinding capability status * ci: regression-test deployment preflight against missing Voice and NavMesh capabilities * docs: precise Firestorm NavMesh and Vivox fallback remediation and deployment preflight * docs(release): keep Voice and Firestorm NavMesh blockers open after runtime diagnostics * diagnostics(voice): log trusted provider readiness transitions without secrets * ci: guard voice discovery diagnostics and prevent fake Firestorm navmesh caps * ci: guard voice discovery diagnostics and prevent fake Firestorm navmesh caps * fix(preflight): distinguish placeholder tokens from valid syntactic hostnames
This commit is contained in:
1 parent
28ddb4e211
commit
965471452c
10 files changed
+447
-1
No files matched your search
@@ -310,6 +310,10 @@ jobs:
|
||||
shell: bash
|
||||
run: python3 tools/ci/verify_ogl_terrain_navigation.py
|
||||
|
||||
- name: Regression-test Voice and Pathfinding deployment preflight
|
||||
shell: bash
|
||||
run: python3 -m unittest discover -s tools/diagnostics -p 'test_ogl_voice_pathfinding_preflight.py' -v
|
||||
|
||||
- name: Regression-test OGL terrain heightfield navigation
|
||||
shell: bash
|
||||
run: dotnet run --configuration Release --project tools/ci/OglTerrainNavigationRegression/OglTerrainNavigationRegression.csproj
|
||||
|
||||
@@ -71,7 +71,11 @@ namespace NexVerse.RegionModules.Pathfinding
|
||||
{
|
||||
IConfig config = source.Configs["OGLPathfinding"];
|
||||
m_Enabled = config?.GetBoolean("Enabled", false) ?? false;
|
||||
if (!m_Enabled) return;
|
||||
if (!m_Enabled)
|
||||
{
|
||||
m_Log.Info("[OGL-PATH]: Terrain A* disabled by [OGLPathfinding] (Enabled=false). Firestorm RetrieveNavMeshSrc requires a separate Second Life-compatible NavMesh implementation.");
|
||||
return;
|
||||
}
|
||||
m_CellMeters = Math.Clamp(config.GetInt("CellMeters", 4), 1, 32);
|
||||
m_MaxSlope = Math.Clamp(config.GetFloat("MaxSlopePerMeter", 0.65f), 0.05f, 2.0f);
|
||||
m_MaxExpanded = Math.Clamp(config.GetInt("MaxExpandedNodes", 20000), 128, 100000);
|
||||
@@ -87,6 +91,9 @@ namespace NexVerse.RegionModules.Pathfinding
|
||||
return;
|
||||
scene.EventManager.OnTerrainTainted += state.Listener;
|
||||
scene.RegisterModuleInterface<IOglTerrainNavigationRegion>(state);
|
||||
m_Log.InfoFormat(
|
||||
"[OGL-PATH]: Region {0} native terrain A* configured (cell={1}m, maxExpanded={2}). Firestorm RetrieveNavMeshSrc intentionally not advertised: Havok-compatible mesh payload/status not implemented.",
|
||||
scene.Name, m_CellMeters, m_MaxExpanded);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
@@ -154,6 +161,9 @@ namespace NexVerse.RegionModules.Pathfinding
|
||||
// Invalidation can arrive while building. In that case the
|
||||
// freshly built candidate remains unavailable until next refresh.
|
||||
Volatile.Write(ref state.Snapshot, snapshot);
|
||||
if (Volatile.Read(ref state.Dirty) == 0)
|
||||
m_Log.InfoFormat("[OGL-PATH]: Terrain navigation ready for region {0} ({1}x{2}, cell {3}m). This is NOT a Firestorm NavMesh.",
|
||||
state.Scene.Name, width, height, m_CellMeters);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -54,6 +54,8 @@ namespace NexVerse.RegionModules.Voice
|
||||
private Timer m_PositionTimer;
|
||||
private int m_PositionUpdateRunning;
|
||||
private bool m_Enabled;
|
||||
// Only one operational warning per region until discovery recovers.
|
||||
private int m_ProviderUnavailableLogged;
|
||||
private string m_NodeId;
|
||||
private string m_Key;
|
||||
|
||||
@@ -64,7 +66,10 @@ namespace NexVerse.RegionModules.Voice
|
||||
{
|
||||
IConfig options = source.Configs["OGLVoiceViewer"];
|
||||
if (options?.GetBoolean("Enabled", true) == false)
|
||||
{
|
||||
m_Log.Info("[OGL-VOICE]: Firestorm WebRTC adapter explicitly disabled by [OGLVoiceViewer].");
|
||||
return;
|
||||
}
|
||||
IConfig node = source.Configs["NexVerseNodeAgent"];
|
||||
IConfig ogl = source.Configs["OGLVoice"];
|
||||
bool grid = node?.GetBoolean("Enabled", false) == true;
|
||||
@@ -72,7 +77,10 @@ namespace NexVerse.RegionModules.Voice
|
||||
string.Equals(ogl.GetString("Mode", ""), "Standalone",
|
||||
StringComparison.OrdinalIgnoreCase);
|
||||
if (!grid && !standalone)
|
||||
{
|
||||
m_Log.Info("[OGL-VOICE]: Firestorm WebRTC not enabled: no active NexVerseNodeAgent or standalone OGLVoice. Firestorm can fall back to Vivox; an empty Vivox provision URL is not an OGLVoice media connection.");
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
m_NodeId = grid
|
||||
@@ -173,7 +181,17 @@ namespace NexVerse.RegionModules.Voice
|
||||
private void RegisterCaps(UUID avatar, Caps caps)
|
||||
{
|
||||
if (ReadyProvider() == null)
|
||||
{
|
||||
if (Interlocked.Exchange(ref m_ProviderUnavailableLogged, 1) == 0)
|
||||
{
|
||||
m_Log.WarnFormat(
|
||||
"[OGL-VOICE]: No authenticated Firestorm WebRTC media provider ready for region {0}; voice CAPS and VoiceServerType cannot be advertised. Check Robust [OGLVoice] EnableFirestormGateway/MediaGatewayUrl, NodeAgent trusted discovery, and actual Pion/LiveKit bridge. Firestorm may try legacy Vivox with an empty provision URL.",
|
||||
m_Scene?.Name ?? "<unknown>");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (Interlocked.Exchange(ref m_ProviderUnavailableLogged, 0) != 0)
|
||||
m_Log.Info("[OGL-VOICE]: Firestorm WebRTC provider recovered. Existing viewer sessions may need relog to receive the newly advertised CAPS.");
|
||||
caps.RegisterSimpleHandler("ProvisionVoiceAccountRequest",
|
||||
new SimpleStreamHandler("/" + UUID.Random(),
|
||||
(req, resp) => Handle(req, resp, avatar, "provision")));
|
||||
|
||||
@@ -33,6 +33,8 @@ namespace NexVerse.RegionModules.Voice
|
||||
private bool m_GridManaged;
|
||||
private int m_Refreshing;
|
||||
private int m_Disposed;
|
||||
// Log readiness transitions only, not every periodic discovery poll.
|
||||
private int m_ViewerProviderState = -1;
|
||||
private OglVoiceProviderDescriptor m_Current;
|
||||
private DateTimeOffset m_LastRefresh;
|
||||
|
||||
@@ -196,6 +198,7 @@ namespace NexVerse.RegionModules.Voice
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
Volatile.Write(ref m_Current, null);
|
||||
Interlocked.Exchange(ref m_ViewerProviderState, -1);
|
||||
m_Log.WarnFormat("[OGL-VOICE]: Provider-Discovery abgelehnt (HTTP {0}).", (int)response.StatusCode);
|
||||
return;
|
||||
}
|
||||
@@ -219,10 +222,18 @@ namespace NexVerse.RegionModules.Voice
|
||||
|
||||
Volatile.Write(ref m_Current, provider);
|
||||
m_LastRefresh = DateTimeOffset.UtcNow;
|
||||
bool viewerReady = provider.viewer_capability == "firestorm-webrtc-v1" &&
|
||||
OglVoiceDiscoveryProof.IsSafeServiceUri(provider.media_gateway_url);
|
||||
int state = viewerReady ? 1 : 0;
|
||||
if (Interlocked.Exchange(ref m_ViewerProviderState, state) != state)
|
||||
m_Log.InfoFormat(
|
||||
"[OGL-VOICE]: Trusted Robust discovery succeeded; Firestorm WebRTC capability configured={0}. Media gateway reachability and audio are NOT verified by discovery.",
|
||||
viewerReady);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Volatile.Write(ref m_Current, null);
|
||||
Interlocked.Exchange(ref m_ViewerProviderState, -1);
|
||||
m_Log.Warn("[OGL-VOICE]: Provider-Discovery fehlgeschlagen; keine unbestaetigten Einstellungen verwendet. " + e.Message);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
# OpenGenesisLINK 0.9.3.10 Dev – Firestorm Voice/Pathfinding Logabgleich (10.10.2026)
|
||||
|
||||
## Gesicherte Symptome aus dem Firestorm 7.2.4.80712-Log
|
||||
|
||||
Region `OGL Developer Gen1`; Log-Zeiten sind UTC (13:23 = 15:23 MESZ).
|
||||
|
||||
- **Navigation:** `LLPathfindingManager::getCapabilityURLForRegion:
|
||||
cannot find capability 'RetrieveNavMeshSrc' for current region 'OGL Developer Gen1'`.
|
||||
- **Voice:** `LLVivoxVoiceClient::provisionVoiceAccount`, dann
|
||||
`cannot POST url ''` und `Unable to provision voice account`.
|
||||
- Firestorm startet damit **den Legacy-Vivox-Pfad**; das Log beweist
|
||||
**nicht**, dass ein OGLVoice/WebRTC-Mediendienst funktionierte.
|
||||
|
||||
## Technische Trennung: kein kosmetisches Unterdruecken der Warnungen
|
||||
|
||||
**OpenGenesisLINK Pathfinding:** `[OGLPathfinding] Enabled=true` aktiviert
|
||||
den bereits implementierten **nativen Terrain-A*-Snapshot** mit
|
||||
`IOglTerrainNavigationRegion` und optionalen NPC-Wegpunkten. Er erzeugt
|
||||
derzeit **keinen** Firestorm-/Second-Life-kompatiblen NavMesh-Datenstrom.
|
||||
Firestorm verlangt fuer `RetrieveNavMeshSrc` einen POST-Endpunkt mit
|
||||
`navmesh_version` und zlib/LLSD-komprimierten binären
|
||||
`navmesh_data`; zusaetzlich ist eine konsistente
|
||||
`NavMeshGenerationStatus`-Capability erforderlich. Ein leerer
|
||||
oder frei erfundener Payload ist **kein** Ersatz und kann den Viewer
|
||||
stoeren. Deshalb **nicht** als CAP registrieren, solange ein korrektes
|
||||
Viewer-NavMesh-Backend fehlt. Die fehlende CAP ist eine reale
|
||||
Kompatibilitaetsluecke; ein eingeschalteter Terrain-Pathfinder
|
||||
beseitigt die Warnung nicht.
|
||||
|
||||
**OGLVoice:** Firestorm benoetigt den von OpenGenesisLINK bei
|
||||
`VoiceServerType=webrtc` beworbenen zweistufigen
|
||||
`ProvisionVoiceAccountRequest` / `VoiceSignalingRequest`-Pfad.
|
||||
Die Implementierung existiert als **opt-in** C#-Regionadapter mit
|
||||
zentral signierter Provider-Discovery. Diese wird nur aktiv,
|
||||
wenn ein tatsaechlich betriebener Pion/WebRTC–LiveKit-Media-Bridge-
|
||||
Dienst per gueltigem `MediaGatewayUrl`, `EnableFirestormGateway=true`
|
||||
und authentifizierter NexBus-Vertrauensbeziehung verbunden ist.
|
||||
Das vorhandene OGLVoice-Webportal oder eine direkte LiveKit-`wss://`-
|
||||
Adresse ist **kein** Medien-Gateway. Bis dahin faellt der Viewer
|
||||
moeglicherweise auf Vivox mit leerer URL zurueck.
|
||||
Nie eine falsche Vivox-Adresse konfigurieren, kein
|
||||
`VoiceServerType=webrtc` ohne betriebsbereiten Gateway erzwingen.
|
||||
|
||||
## Neuer sicherer Preflight im Quellcode
|
||||
|
||||
```bash
|
||||
cd /opt/developer
|
||||
python3 tools/diagnostics/ogl_voice_pathfinding_preflight.py \
|
||||
--sim-config /opt/developer/bin/OpenSim.ini \
|
||||
--robust-config /opt/robust/bin/Robust.HG.ini
|
||||
```
|
||||
|
||||
**Dateinamen anpassen**: Das im Produktiveinsatz tatsaechlich
|
||||
geladene Robust-Config kann `Robust.ini` statt `Robust.HG.ini`
|
||||
heissen. Mehrere `*.ini`-Includes werden vom Preflight **nicht**
|
||||
automatisch aufgeloest. Die Beispiel-Konfiguration
|
||||
`OpenSim.ini.example` ist kein Beweis fuer produktive Werte.
|
||||
Das auf dem Linux-Desktop liegende `Firestorm.log` kann optional
|
||||
durch `--viewer-log /pfad/zur/Firestorm.log` hinzugefuegt werden.
|
||||
`--json` bietet strukturierte Ergebnisse. Das Tool ist **rein lesend**,
|
||||
macht **keine** Netzwerkaufrufe und gibt **keine** Zugangsdaten aus.
|
||||
|
||||
Vor jedem Live-Enable:
|
||||
1. **Media Bridge wirklich bereitstellen.** Go-Dienst
|
||||
`services/oglvoice-media` bauen, Umgebungsvariablen sicher setzen,
|
||||
LiveKit-Server/Schluessel, Node/Tenant ACL, STUN/TURN und UDP-ICE
|
||||
kontrollieren; `GET /healthz` am internen Dienst pruefen.
|
||||
Ein positives Healthz ist **noch kein** funktionierender
|
||||
Firestorm-Audiotest.
|
||||
2. **Robust**: `[OGLVoice] Enabled=true`,
|
||||
`Mode=GridAuthority`, `EnableFirestormGateway=true`, echte
|
||||
`MediaGatewayUrl=https://<media-host>/internal/webrtc/v1/exchange`.
|
||||
URL muss ueber geschuetztes Netz/HTTPS auf den laufenden Gateway
|
||||
zeigen; keinen Platzhalter eintragen.
|
||||
3. **Simulator**: `[NexVerseNodeAgent] Enabled=true`,
|
||||
die konfigurierte `PeerUrl`, der zum Gateway-ACL passende
|
||||
`NodeId` und `SharedKey` werden beim Start vom echten Prozess
|
||||
gelesen; lokale `[OGLVoice]` im GridManaged-Modus nicht unbedacht
|
||||
durch Standalone-Einstellungen ueberschreiben.
|
||||
`[OGLVoiceViewer] Enabled=true` oder Default.
|
||||
4. **Geordnet Robust, Gateway und Simulator pruefen/starten**, nicht
|
||||
blind produktive Regionen neu starten.
|
||||
Auf `[OGL-VOICE]`-Meldungen achten. Der C#-Adapter protokolliert
|
||||
jetzt einmal pro Region, wenn der Provider beim CAPS-Seed
|
||||
nicht bereitsteht. Nach Spaet-Bereitstellung muss der Viewer ggf.
|
||||
erneut einloggen, da bereits ausgegebene CAPS nicht nachtraeglich
|
||||
automatisch erscheinen.
|
||||
5. **Mit zwei Firestorm-Clients live testen:** WebRTC-CAPS, SDP-Offer/
|
||||
Answer, ICE-Konnektivitaet, beidseitiges Audio und Voice-Kugeln,
|
||||
danach HG/Parcel-/Regionswechsel pruefen.
|
||||
Nur eine funktionierende Medienverbindung beseitigt den
|
||||
**eigentlichen** Voice-Fehler.
|
||||
|
||||
## Neue Konsolenmeldungen
|
||||
|
||||
- `[OGL-VOICE]: No authenticated Firestorm WebRTC media provider ready ...`:
|
||||
Gateway/Robust-Discovery oder Session-CAPS nicht bereit.
|
||||
- `[OGL-VOICE]: Firestorm WebRTC provider recovered ...`:
|
||||
nach Discovery-Neustart neue Logins erneut pruefen.
|
||||
- `[OGL-PATH]: ... Terrain A* disabled ...`:
|
||||
nativer Pfadsucher in diesem Simulator nicht aktiv.
|
||||
- `[OGL-PATH]: ... terrain A* configured ... RetrieveNavMeshSrc intentionally not advertised ...`:
|
||||
native Navigation aktiviert, aber Firestorm-NavMesh-Integration fehlt.
|
||||
- `[OGL-PATH]: Terrain navigation ready ...`:
|
||||
nativer Terrain-Snapshot bereit; kein Firestorm-NavMesh.
|
||||
|
||||
## Abnahmegrenzen
|
||||
|
||||
Das neue Diagnose-PR bietet **Betriebsdiagnose und CI-Regressionen**.
|
||||
Der Firestorm-NavMesh-Protokolladapter und eine vollstaendige
|
||||
produktiv lauffaehige Voice-Infrastruktur sind damit **nicht**
|
||||
implementiert oder freigegeben. Die Release-Gates aus
|
||||
`RELEASE_TRAIN_0.9.3.10.md` bleiben weiterhin offen. Keine Stable-
|
||||
Freigabe aus einem grünen CI-Build ableiten.
|
||||
@@ -25,6 +25,24 @@ Das Release bündelt den gesamten geplanten Meilenstein **0.9.3.9** (OGLVoice un
|
||||
- [ ] **Firestorm Appearance "Kein Outfit" live abnehmen:** Current-Outfit-/My-Outfits-Ordner, gespeicherte Outfits, vorhandene Links und Avatar-Appearance vor Ort pruefen. Kein automatischer, potentiell zerstoererischer Reset existierender Nutzeroutfits.
|
||||
- [x] **Viewer-Thumbnail-E2E mit dokumentierter Einschraenkung abgeschlossen:** Neuer Snapshot, MariaDB-Persistenz, Versionsanstieg, Anzeige nach Cache-Neuaufbau und fehlerhafte Aktualisierung nach normalem Relog reproduziert. **Kein** bestandener automatischer Cache-Refresh-Test; Fehler als Firestorm-7.2.4-OpenSim-Kompatibilitaetslimit akzeptiert. `Kein Outfit`/COF ist davon **nicht** abgenommen.
|
||||
|
||||
## A.2 Firestorm-Log: Voice/Pathfinding fehlende Capabilities (10.10.2026)
|
||||
|
||||
- [x] **Analyse und Debugbarkeit:** Firestorm 7.2.4.80712 meldet
|
||||
`RetrieveNavMeshSrc` als fehlend und faellt beim Voice-Account-Setup
|
||||
auf Legacy-Vivox mit leerer POST-URL zurueck.
|
||||
Eigene Servermeldungen fuer ausgeschaltete/noch nicht bereite
|
||||
OGLVoice-Provider und nativen A*-Status sowie ein schluesselfreies
|
||||
read-only-Konfigurations-Preflight plus CI-Tests dokumentiert.
|
||||
Details: `doc/NexVerse/FIRESTORM_VOICE_PATHFINDING_LOG_20261010.md`.
|
||||
- [ ] **Eigentliche Fehlerbeseitigung noch offen:** `RetrieveNavMeshSrc`
|
||||
benoetigt ein echtes Firestorm-kompatibles binäres NavMesh mit
|
||||
Versions-/Status-Endpunkt; der OGL-Terrain-A*-Snapshot leistet das
|
||||
noch nicht. OGLVoice benoetigt einen konfigurierten, live erreichbaren
|
||||
und mit zwei Firestorm-Clients bestaetigten Pion-/LiveKit-WebRTC-
|
||||
Gateway. Weder Platzhalter-CAPS noch fingierte Vivox-URLs werden
|
||||
angeboten. Diese beiden fehlenden Funktionen bleiben
|
||||
**separate Stable-Blocker**, auch wenn der Preflight erfolgreich laeuft.
|
||||
|
||||
## B. Arbeitspaket OGLVoice (aus 0.9.3.9)
|
||||
|
||||
- [ ] Bestehenden NexVoice-/LiveKit-Quellcode einschließlich Credentials/Signalisierung sicher prüfen; keine Produktivschlüssel kopieren.
|
||||
|
||||
@@ -18,6 +18,8 @@ for word in ('Configs["OGLPathfinding"]', "Enabled", "OnTerrainTainted",
|
||||
"UnregisterModuleInterface<IOglTerrainNavigationRegion>"):
|
||||
assert word in module, word
|
||||
assert "TryFindTerrainPath" in iface
|
||||
assert "RetrieveNavMeshSrc intentionally not advertised" in module
|
||||
assert 'RegisterSimpleHandler("RetrieveNavMeshSrc"' not in module
|
||||
assert "Enabled = false" in config and "[OGLPathfinding]" in config
|
||||
assert "llNavigateTo" not in module and "new ScenePresence" not in module
|
||||
print("OGL per-region terrain navigation module wiring: OK")
|
||||
@@ -27,6 +27,9 @@ for expected in ("media_gateway_url", "firestorm-webrtc-v1", "IsSafeServiceUri")
|
||||
assert expected in provider, expected
|
||||
assert "EnableFirestormGateway" in robust
|
||||
assert "EnableFirestormGateway" in node
|
||||
assert "No authenticated Firestorm WebRTC media provider ready" in region
|
||||
assert "Firestorm WebRTC provider recovered" in region
|
||||
assert "Trusted Robust discovery succeeded" in node
|
||||
assert "Firestorm" in wire
|
||||
assert "oglvoice-media-v1" in (root/"NexVerse/Core/Voice/OglVoiceMediaProof.cs").read_text()
|
||||
for word in ('["jsep"]','["viewer_session"]', 'viewer_session', 'candidate'):
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Read-only OGLVoice / native navigation readiness check for a real deployment.
|
||||
|
||||
Does not contact the grid, print credentials, modify files or claim a
|
||||
Firestorm Havok NavMesh implementation that does not exist.
|
||||
"""
|
||||
import argparse
|
||||
import json
|
||||
import re
|
||||
from pathlib import Path
|
||||
from urllib.parse import urlsplit
|
||||
|
||||
ASSIGNMENT = re.compile(r"^\s*([A-Za-z][A-Za-z0-9_.-]*)\s*=\s*(.*?)\s*$")
|
||||
SECTION = re.compile(r"^\s*\[([^\]]+)\]\s*$")
|
||||
|
||||
|
||||
def parse_opensim_ini(text):
|
||||
"""Parse simple active INI keys without expanding environment secrets.
|
||||
|
||||
OpenSim includes and Nini interpolations require the running process for
|
||||
authoritative effective values: this check only inspects supplied files.
|
||||
"""
|
||||
sections = {}
|
||||
section = None
|
||||
for raw in text.splitlines():
|
||||
stripped = raw.strip()
|
||||
if not stripped or stripped.startswith((";", "#")):
|
||||
continue
|
||||
found = SECTION.match(raw)
|
||||
if found:
|
||||
section = found.group(1).strip().lower()
|
||||
sections.setdefault(section, {})
|
||||
continue
|
||||
if section is None:
|
||||
continue
|
||||
found = ASSIGNMENT.match(raw)
|
||||
if found:
|
||||
value = found.group(2).strip()
|
||||
if value and value[0] in ('"', "'"):
|
||||
quote = value[0]
|
||||
last = value.find(quote, 1)
|
||||
value = value[1:last] if last != -1 else value.strip(quote)
|
||||
else:
|
||||
value = value.split(";", 1)[0].strip()
|
||||
sections[section][found.group(1).lower()] = value
|
||||
return sections
|
||||
|
||||
|
||||
def setting(cfg, section, name, fallback=""):
|
||||
return cfg.get(section.lower(), {}).get(name.lower(), fallback)
|
||||
|
||||
|
||||
def enabled(cfg, section, name="Enabled", fallback=False):
|
||||
return setting(cfg, section, name, "true" if fallback else "false").lower() in ("yes", "true", "on", "1")
|
||||
|
||||
|
||||
def configured(value):
|
||||
return bool(value and value.strip() and "${" not in value and
|
||||
not re.search(r"(REPLACE|DEIN-|VOICE-MEDIA-BRIDGE-HOST|YOUR_)", value, flags=re.I))
|
||||
|
||||
|
||||
def media_url_valid(value):
|
||||
if not configured(value):
|
||||
return False
|
||||
try:
|
||||
uri = urlsplit(value)
|
||||
if uri.scheme != "https" and not (
|
||||
uri.scheme == "http" and uri.hostname in ("127.0.0.1", "localhost", "::1")
|
||||
):
|
||||
return False
|
||||
return bool(uri.hostname and uri.path == "/internal/webrtc/v1/exchange"
|
||||
and not uri.username and not uri.password and not uri.fragment)
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
|
||||
def assess(sim_cfg, robust_cfg=None, viewer_log=""):
|
||||
findings = []
|
||||
def add(area, code, severity, message):
|
||||
findings.append({"area": area, "code": code, "severity": severity, "message": message})
|
||||
|
||||
if "RetrieveNavMeshSrc" in viewer_log:
|
||||
add("pathfinding", "FIRESTORM_NAVMESH_CAP_MISSING", "known-limitation",
|
||||
"Firestorm requested RetrieveNavMeshSrc. Native terrain A* does not provide "
|
||||
"a Second Life-compatible binary NavMesh/Havok payload; no fake CAP is advertised.")
|
||||
if enabled(sim_cfg, "OGLPathfinding"):
|
||||
add("pathfinding", "NATIVE_TERRAIN_ENABLED", "info",
|
||||
"OGLPathfinding.Enabled=true; native terrain navigation may operate after initial snapshot. "
|
||||
"This does NOT enable Firestorm NavMesh UI.")
|
||||
else:
|
||||
add("pathfinding", "NATIVE_TERRAIN_DISABLED", "action",
|
||||
"OGLPathfinding.Enabled is false or absent. Enable only for a controlled native A*/NPC test; "
|
||||
"not a solution for RetrieveNavMeshSrc.")
|
||||
|
||||
if "Unable to provision voice account" in viewer_log or "cannot POST url ''" in viewer_log:
|
||||
add("voice", "FIRESTORM_VIVOX_FALLBACK", "observed",
|
||||
"Viewer attempted legacy Vivox provisioning with an empty URL. "
|
||||
"A verified OGLVoice VoiceServerType=webrtc provider was not established in this log.")
|
||||
|
||||
if not enabled(sim_cfg, "OGLVoiceViewer", fallback=True):
|
||||
add("voice", "VIEWER_ADAPTER_DISABLED", "action",
|
||||
"OGLVoiceViewer.Enabled=false. WebRTC CAPS are intentionally disabled.")
|
||||
return findings
|
||||
|
||||
sim_mode = setting(sim_cfg, "OGLVoice", "Mode", "GridManaged").lower()
|
||||
standalone = enabled(sim_cfg, "OGLVoice") and sim_mode == "standalone"
|
||||
if standalone:
|
||||
gw = setting(sim_cfg, "OGLVoice", "MediaGatewayUrl")
|
||||
if (not enabled(sim_cfg, "OGLVoice", "EnableFirestormGateway") or
|
||||
not media_url_valid(gw)):
|
||||
add("voice", "STANDALONE_GATEWAY_NOT_READY", "action",
|
||||
"Standalone must enable the Firestorm gateway and supply a verified HTTPS "
|
||||
"MediaGatewayUrl ending /internal/webrtc/v1/exchange.")
|
||||
else:
|
||||
add("voice", "STANDALONE_GATEWAY_CONFIGURED", "configuration-only",
|
||||
"Standalone gateway URI is configured; live bridge/LiveKit/ICE connectivity is NOT verified.")
|
||||
if not configured(setting(sim_cfg, "OGLVoice", "TenantId")):
|
||||
add("voice", "STANDALONE_TENANT_MISSING", "action", "Standalone OGLVoice.TenantId is not configured.")
|
||||
# The standalone signing key is injected at process start, not in INI.
|
||||
add("voice", "STANDALONE_SIGNATURE_KEY_UNVERIFIED", "action",
|
||||
"Check process environment OGLVOICE_MEDIA_BRIDGE_SHARED_KEY and node ID; "
|
||||
"this tool deliberately does not read or print secrets.")
|
||||
else:
|
||||
if not enabled(sim_cfg, "NexVerseNodeAgent"):
|
||||
add("voice", "NODE_AGENT_DISABLED", "action",
|
||||
"GridManaged OGLVoice requires NexVerseNodeAgent.Enabled=true on the simulator.")
|
||||
else:
|
||||
add("voice", "NODE_AGENT_CONFIGURED", "configuration-only",
|
||||
"NexVerseNodeAgent is enabled; actual trusted discovery/authentication is unverified.")
|
||||
if robust_cfg is None:
|
||||
add("voice", "ROBUST_CONFIG_UNAVAILABLE", "action",
|
||||
"Supply --robust-config to check central OGLVoice enablement and media gateway URI.")
|
||||
else:
|
||||
if not enabled(robust_cfg, "OGLVoice"):
|
||||
add("voice", "ROBUST_VOICE_DISABLED", "action",
|
||||
"Central Robust [OGLVoice] Enabled is false or absent.")
|
||||
if not enabled(robust_cfg, "OGLVoice", "EnableFirestormGateway"):
|
||||
add("voice", "ROBUST_FIRESTORM_GATEWAY_DISABLED", "action",
|
||||
"Central Robust EnableFirestormGateway=false: Firestorm WebRTC provider is not advertised.")
|
||||
if not media_url_valid(setting(robust_cfg, "OGLVoice", "MediaGatewayUrl")):
|
||||
add("voice", "ROBUST_GATEWAY_URL_INVALID", "action",
|
||||
"Central MediaGatewayUrl must point to the real protected HTTPS media exchange "
|
||||
"path /internal/webrtc/v1/exchange, not the LiveKit SFU or voice portal.")
|
||||
elif enabled(robust_cfg, "OGLVoice", "EnableFirestormGateway"):
|
||||
add("voice", "ROBUST_GATEWAY_CONFIGURED", "configuration-only",
|
||||
"Central media URL is plausible; gateway uptime and LiveKit/ICE are not tested.")
|
||||
return findings
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--sim-config", required=True, type=Path)
|
||||
parser.add_argument("--robust-config", type=Path)
|
||||
parser.add_argument("--viewer-log", type=Path)
|
||||
parser.add_argument("--json", action="store_true", help="Emit machine-readable findings")
|
||||
args = parser.parse_args()
|
||||
for file in (args.sim_config, args.robust_config, args.viewer_log):
|
||||
if file is not None and not file.is_file():
|
||||
parser.error("Input file does not exist: " + str(file))
|
||||
sim = parse_opensim_ini(args.sim_config.read_text(encoding="utf-8", errors="replace"))
|
||||
robust = (parse_opensim_ini(args.robust_config.read_text(encoding="utf-8", errors="replace"))
|
||||
if args.robust_config else None)
|
||||
log = (args.viewer_log.read_text(encoding="utf-8", errors="replace")
|
||||
if args.viewer_log else "")
|
||||
findings = assess(sim, robust, log)
|
||||
if args.json:
|
||||
print(json.dumps({"findings": findings}, indent=2, ensure_ascii=False))
|
||||
else:
|
||||
print("OpenGenesisLINK Voice / Pathfinding Preflight (read-only)")
|
||||
for item in findings:
|
||||
print(f"[{item['area']}][{item['severity']}] {item['code']}: {item['message']}")
|
||||
print("NOTE: INI includes, env interpolation, processes and actual media health "
|
||||
"require separate live verification.")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Unit tests for configuration-only, secret-free deployment diagnostics."""
|
||||
import importlib.util
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
"preflight", Path(__file__).with_name("ogl_voice_pathfinding_preflight.py"))
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
|
||||
|
||||
class PreflightTests(unittest.TestCase):
|
||||
def test_read_ini_ignores_comments_and_keeps_effective_last_value(self):
|
||||
cfg = module.parse_opensim_ini("""
|
||||
; [OGLVoice] Enabled = true
|
||||
[OGLVoice]
|
||||
Enabled = false
|
||||
Enabled = true ; override
|
||||
MediaGatewayUrl = "https://media.example.org/internal/webrtc/v1/exchange"
|
||||
SharedKey = "must-not-print"
|
||||
""")
|
||||
self.assertTrue(module.enabled(cfg, "OGLVoice"))
|
||||
self.assertEqual(module.setting(cfg, "OGLVoice", "MediaGatewayUrl"),
|
||||
"https://media.example.org/internal/webrtc/v1/exchange")
|
||||
self.assertNotIn("must-not-print", str(module.assess({}, cfg)))
|
||||
|
||||
def test_no_false_navmesh_success(self):
|
||||
sim = module.parse_opensim_ini("[OGLPathfinding]\nEnabled = true\n")
|
||||
issues = module.assess(sim, viewer_log="cannot find capability 'RetrieveNavMeshSrc'")
|
||||
codes = {x["code"] for x in issues}
|
||||
self.assertIn("NATIVE_TERRAIN_ENABLED", codes)
|
||||
self.assertIn("FIRESTORM_NAVMESH_CAP_MISSING", codes)
|
||||
|
||||
def test_missing_gateway_and_old_vivox(self):
|
||||
sim = module.parse_opensim_ini("[NexVerseNodeAgent]\nEnabled = true\n")
|
||||
robust = module.parse_opensim_ini(
|
||||
"[OGLVoice]\nEnabled = true\nEnableFirestormGateway = false\nMediaGatewayUrl = \"\"")
|
||||
issues = module.assess(sim, robust, "cannot POST url ''\nUnable to provision voice account.")
|
||||
codes = {x["code"] for x in issues}
|
||||
self.assertIn("ROBUST_FIRESTORM_GATEWAY_DISABLED", codes)
|
||||
self.assertIn("ROBUST_GATEWAY_URL_INVALID", codes)
|
||||
self.assertIn("FIRESTORM_VIVOX_FALLBACK", codes)
|
||||
|
||||
def test_configured_not_claimed_functional(self):
|
||||
sim = module.parse_opensim_ini(
|
||||
"[NexVerseNodeAgent]\nEnabled = true\n[OGLPathfinding]\nEnabled = true")
|
||||
robust = module.parse_opensim_ini("""
|
||||
[OGLVoice]
|
||||
Enabled = true
|
||||
EnableFirestormGateway = true
|
||||
MediaGatewayUrl = "https://media.example.net/internal/webrtc/v1/exchange"
|
||||
""")
|
||||
issues = module.assess(sim, robust)
|
||||
code = {x["code"]: x for x in issues}
|
||||
self.assertEqual(code["ROBUST_GATEWAY_CONFIGURED"]["severity"], "configuration-only")
|
||||
self.assertNotIn("success", [x["severity"] for x in issues])
|
||||
|
||||
def test_media_url_avoids_unsafe_targets(self):
|
||||
for value in (
|
||||
"https://voice.example.org", "wss://livekit.example.org",
|
||||
"http://media.example.org/internal/webrtc/v1/exchange",
|
||||
"https://name:secret@media.example.org/internal/webrtc/v1/exchange",
|
||||
"https://VOICE-MEDIA-BRIDGE-HOST/internal/webrtc/v1/exchange",
|
||||
"https://example.org/internal/webrtc/v1/exchange#frag"
|
||||
):
|
||||
self.assertFalse(module.media_url_valid(value), value)
|
||||
self.assertTrue(module.media_url_valid(
|
||||
"https://media.example.org/internal/webrtc/v1/exchange"))
|
||||
self.assertTrue(module.media_url_valid(
|
||||
"http://127.0.0.1:19098/internal/webrtc/v1/exchange"))
|
||||
|
||||
def test_standalone_requires_key_in_process_environment(self):
|
||||
sim = module.parse_opensim_ini("""
|
||||
[OGLVoice]
|
||||
Enabled = true
|
||||
Mode = "Standalone"
|
||||
TenantId = "nexverse"
|
||||
EnableFirestormGateway = true
|
||||
MediaGatewayUrl = "https://media.example.org/internal/webrtc/v1/exchange"
|
||||
""")
|
||||
codes = {x["code"] for x in module.assess(sim)}
|
||||
self.assertIn("STANDALONE_GATEWAY_CONFIGURED", codes)
|
||||
self.assertIn("STANDALONE_SIGNATURE_KEY_UNVERIFIED", codes)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user