diff --git a/.github/workflows/nexjast-ci.yml b/.github/workflows/nexjast-ci.yml index 7795d5ea..e6a41e01 100644 --- a/.github/workflows/nexjast-ci.yml +++ b/.github/workflows/nexjast-ci.yml @@ -89,6 +89,9 @@ jobs: - name: Verify World API Sci-Fi admin dashboard navigation and GitHub releases shell: bash run: python3 tools/ci/verify_worldapi_scifi_admin_center.py + - name: Verify operator CRUD, Audit and NodeId daily log relay + shell: bash + run: python3 tools/ci/verify_ogl_operator_logs_admin.py - name: Verify OpenGenesisLINK 0.9.3.12 dashboard and diagnostic updates diff --git a/NexVerse/Core/Messaging/DistributedNexEventBus.cs b/NexVerse/Core/Messaging/DistributedNexEventBus.cs index 05d10430..c111c48c 100644 --- a/NexVerse/Core/Messaging/DistributedNexEventBus.cs +++ b/NexVerse/Core/Messaging/DistributedNexEventBus.cs @@ -12,6 +12,10 @@ namespace NexVerse.Core.Messaging private readonly InMemoryNexEventBus m_Local = new InMemoryNexEventBus(); private readonly INexEventTransport m_Transport; + // ROBUST-only authenticated NexBus log chunks bypass normal fan-out. + // Unlike ordinary bus events, they must never be re-relayed to + // third-party simulator peers which would expose private log text. + public Func ReceiveLogChunk { get; set; } private readonly ConcurrentDictionary m_Seen = new ConcurrentDictionary(); private readonly ConcurrentQueue m_SeenOrder = diff --git a/NexVerse/RegionModules/NodeAgent/NexVerseNodeAgentModule.cs b/NexVerse/RegionModules/NodeAgent/NexVerseNodeAgentModule.cs index 5a004c6a..7898d445 100644 --- a/NexVerse/RegionModules/NodeAgent/NexVerseNodeAgentModule.cs +++ b/NexVerse/RegionModules/NodeAgent/NexVerseNodeAgentModule.cs @@ -70,6 +70,15 @@ namespace NexVerse.RegionModules.NodeAgent private SimulatorNexEventTransport m_Transport; private DistributedNexEventBus m_Bus; private Timer m_HeartbeatTimer; + // Secure, cursor-based export to the existing HMAC-authenticated + // NexBus peer. Never transport plain files via a public HTTP upload. + private Timer m_LogForwardTimer; + private HttpClient m_LogForwardClient; + private Uri m_LogForwardPeer; + private bool m_LogForwardEnabled; + private int m_LogForwardRunning; + private readonly Dictionary m_LogForwardOffsets = new(); + private readonly object m_LogForwardSync = new(); private IDisposable m_CreateRegionSubscription; private IDisposable m_MoveRegionSubscription; private IDisposable m_RegionLifecycleSubscription; @@ -126,6 +135,16 @@ namespace NexVerse.RegionModules.NodeAgent m_NodeId = OglArchiveFeatureGate.ResolveNodeId( config.GetString("NodeId", Environment.MachineName), Environment.MachineName); + // Log files can contain personally identifiable information or + // credentials. Forward only over TLS (or loopback for local tests). + m_LogForwardEnabled = config.GetBoolean("LogForwardingEnabled", true) && + System.Text.RegularExpressions.Regex.IsMatch(m_NodeId, + @"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$") && + (peer.Scheme == Uri.UriSchemeHttps || peer.IsLoopback); + if (config.GetBoolean("LogForwardingEnabled", true) && !m_LogForwardEnabled) + m_Log.Warn("[NEX-NODE]: Automatic OpenSim log forwarding disabled: " + + "NexBus peer must use HTTPS and NodeId must contain safe filename characters."); + m_LogForwardPeer = peer; m_SharedKey = sharedKey; m_UpdateStagingEnabled = config.GetBoolean("UpdateStagingEnabled", false); @@ -295,6 +314,15 @@ namespace NexVerse.RegionModules.NodeAgent null, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(m_HeartbeatSeconds)); + if (m_LogForwardEnabled) + { + m_LogForwardClient = new HttpClient { + Timeout = TimeSpan.FromSeconds(8) + }; + m_LogForwardTimer = new Timer( + _ => _ = ForwardDailyLogsSafeAsync(), + null, TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(15)); + } Publish(new NexEvent( "node.online", @@ -347,6 +375,8 @@ namespace NexVerse.RegionModules.NodeAgent m_ObjectMessageOutboundRates.Clear(); m_ObjectMessageInboundRates.Clear(); m_HeartbeatTimer?.Dispose(); + m_LogForwardTimer?.Dispose(); + m_LogForwardClient?.Dispose(); m_Bus?.Dispose(); m_Transport = null; m_Bus = null; @@ -1066,6 +1096,98 @@ namespace NexVerse.RegionModules.NodeAgent } } + + /// + /// Keep source offsets only after NexBus HTTP 202 acceptance. Each + /// message is signed using the existing NodeAgent HMAC transport key. + /// A retry starts at the same offset, so Robust de-duplicates content. + /// Read at most 4 * 32 KiB per timer cycle to avoid starving the sim. + /// The previous 7 daily archives remain eligible for catch-up. + /// + private async Task ForwardDailyLogsSafeAsync() + { + if (!m_Enabled || !m_LogForwardEnabled || + Interlocked.CompareExchange(ref m_LogForwardRunning, 1, 0) != 0) + return; + try + { + int remaining = 4; + // An oldest-first replay also synchronizes yesterday's tail + // after reconnection, restart or temporary network failure. + for (int back = 7; back >= 0 && remaining > 0; --back) + { + DateTime day = DateTime.Today.AddDays(-back); + string dayId = day.ToString("yyyy-MM-dd", + System.Globalization.CultureInfo.InvariantCulture); + string local = Path.Combine(AppContext.BaseDirectory, "logs", + "OpenSim_" + day.ToString("dd_MM_yyyy", + System.Globalization.CultureInfo.InvariantCulture) + ".log"); + if (!File.Exists(local)) continue; + + long cursor; + lock (m_LogForwardSync) + cursor = m_LogForwardOffsets.TryGetValue(dayId, out long pos) ? pos : 0L; + + while (remaining > 0) + { + byte[] bytes = new byte[32 * 1024]; + int count; + try + { + using var input = new FileStream(local, FileMode.Open, FileAccess.Read, + FileShare.ReadWrite | FileShare.Delete); + if (cursor > input.Length) cursor = 0L; + input.Position = cursor; + count = await input.ReadAsync(bytes.AsMemory(0, bytes.Length)) + .ConfigureAwait(false); + } + catch (IOException) { break; } + catch (UnauthorizedAccessException) { break; } + if (count == 0) break; + if (count != bytes.Length) Array.Resize(ref bytes, count); + + var envelope = new NexEvent("node.log.chunk", "nexverse.simulator", + new Dictionary { + ["node_id"] = m_NodeId, + ["date"] = dayId, + ["offset"] = cursor.ToString( + System.Globalization.CultureInfo.InvariantCulture), + ["bytes_base64"] = Convert.ToBase64String(bytes) + }); + byte[] payload = NexBusProtocol.Serialize(envelope); + using var outgoing = new HttpRequestMessage(HttpMethod.Post, m_LogForwardPeer); + outgoing.Headers.TryAddWithoutValidation("X-NexBus-Node", m_NodeId); + outgoing.Headers.TryAddWithoutValidation("X-NexBus-Schema", + NexVerse.Core.NexVersePlatform.NexBusSchemaVersion); + outgoing.Headers.TryAddWithoutValidation("X-NexBus-Signature", + "sha256=" + NexBusProtocol.Sign(payload, m_SharedKey)); + outgoing.Content = new ByteArrayContent(payload); + outgoing.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + using HttpResponseMessage result = await m_LogForwardClient.SendAsync(outgoing) + .ConfigureAwait(false); + if (result.StatusCode != HttpStatusCode.Accepted) return; + // 'accepted=false' means the NexBus replay/dedup gate + // rejected this particular event; never lose the cursor. + byte[] reply = await result.Content.ReadAsByteArrayAsync() + .ConfigureAwait(false); + using JsonDocument ack = JsonDocument.Parse(reply); + if (!ack.RootElement.TryGetProperty("accepted", out JsonElement accepted) || + accepted.ValueKind != JsonValueKind.True) + return; + cursor += count; + lock (m_LogForwardSync) m_LogForwardOffsets[dayId] = cursor; + --remaining; + } + } + } + catch (Exception error) + { + if (error is not OperationCanceledException) + m_Log.Debug("[NEX-NODE]: Signed log sync will retry: " + error.GetType().Name); + } + finally { Volatile.Write(ref m_LogForwardRunning, 0); } + } + private void PublishHeartbeatSafe() { try diff --git a/NexVerse/Server/Api/NexApiDocsPage.cs b/NexVerse/Server/Api/NexApiDocsPage.cs index 2376355e..c2f25b34 100644 --- a/NexVerse/Server/Api/NexApiDocsPage.cs +++ b/NexVerse/Server/Api/NexApiDocsPage.cs @@ -242,6 +242,43 @@ main{padding:28px clamp(17px,3vw,52px)} #page-repository .section{min-height:125px} @media(max-width:1180px){.ogl-status-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ogl-release-grid{grid-template-columns:1fr 1fr}} @media(max-width:850px){.shell{grid-template-columns:1fr}nav{position:relative;top:auto;width:100%;height:auto;max-height:440px}.nav-scroll{max-height:285px}.ogl-status-grid,.ogl-release-grid,.ogl-panel-split,.ogl-operation-grid{grid-template-columns:1fr}.ogl-command-bar{align-items:start;flex-direction:column}.navmeta{display:none}} + +/* Operator Control Center 3.0 – restrained, legible aerospace design */ +:root{--bg:#060d19;--panel:#111d2c;--panel2:#17283d;--line:#28435a;--text:#edf4fc;--muted:#9cb3c8;--accent:#52c9eb;--accent2:#89aaff;--good:#56d9a9;--shadow:0 8px 28px rgba(0,0,0,.24)} +body{background:linear-gradient(148deg,#0a1628 0%,#050a14 56%,#0a1020 100%);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif} +.shell{grid-template-columns:276px minmax(0,1fr)} +nav{width:276px;background:#091423;border-right:1px solid #243b53} +.ogl-brand{border-bottom:1px solid #253c52} +.navgroup summary{color:#9db4ca;letter-spacing:.08em} +.navbtn{font-size:13px}.navbtn.active{box-shadow:inset 3px 0 #4fcbed;color:#ebfaff;background:#162f43} +main{max-width:1900px;width:100%;margin:0 auto} +.hero{border-radius:14px;background:linear-gradient(108deg,#152c43,#101d31 64%,#10182b);box-shadow:none;border:1px solid #2b4962;min-height:145px} +.hero:before{opacity:.25} +.ogl-status-card,.ogl-release-card,.section,.card{background:#111f31;border:1px solid #2c4358;box-shadow:none;border-radius:12px} +.ogl-status-card:before{background:#4fcbed;opacity:.55} +.ogl-command-bar h2{font-size:26px}.ogl-opcard{background:#0d1929;border:1px solid #2d455c} +.ogl-opcard:hover{background:#172d43} +.ogl-log-list{display:grid;gap:9px} +.ogl-day{background:#0b192a;border:1px solid #2c455c;border-radius:10px;overflow:hidden} +.ogl-day summary{cursor:pointer;padding:17px 18px;display:flex;align-items:center;gap:10px;justify-content:space-between;font-weight:700} +.ogl-day summary:hover{background:#122b42} +.ogl-log-body{padding:14px;border-top:1px solid #29435e} +.ogl-logs-pre{font:12px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;max-height:560px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;background:#06111e;color:#bdd6e6;padding:16px;border-radius:9px;border:1px solid #20384d} +.ogl-audit-line{padding:12px;border-bottom:1px solid #294052;display:grid;grid-template-columns:178px 160px 1fr;gap:12px;color:#cad9e9;overflow-wrap:anywhere} +.ogl-action-surface{border:1px solid #3c6e86;border-radius:12px;background:#10273a;padding:19px;margin:16px 0} +.ogl-action-surface h3{margin:0 0 8px;font-size:17px} +.ogl-action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;margin:14px 0} +.ogl-action-field{display:flex;flex-direction:column;gap:6px;min-width:0} +.ogl-action-field label{color:#a9c7df;font-size:12px} +.ogl-action-surface textarea{min-height:145px;width:100%;font-family:ui-monospace,monospace} +.ogl-action-surface pre{font-size:12px;max-height:420px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;background:#061321;border-radius:8px;padding:14px} +.ogl-action-buttonrow{display:flex;gap:9px;flex-wrap:wrap;margin-top:11px} +.ogl-inline-admin{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0} +.ogl-inline-admin input{flex:1;min-width:140px} +.ogl-user-results{display:grid;gap:8px;margin:10px 0} +.ogl-user-row{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;background:#0b1b2d;border:1px solid #31475b;border-radius:9px;padding:11px} +.ogl-user-row small{color:#a1bacf} +@media(max-width:900px){.ogl-audit-line{grid-template-columns:1fr}.ogl-action-grid{grid-template-columns:1fr}} @@ -259,7 +296,8 @@ main{padding:28px clamp(17px,3vw,52px)} - + + @@ -336,7 +375,17 @@ main{padding:28px clamp(17px,3vw,52px)}

Repository-Verbindung

Die Daten werden ausschließlich lesend von der offiziellen GitHub-API geladen.

Kein Commit geladen.
Keine Release-Informationen geladen.

Hinweis: Eine GitHub-Freigabe ist nicht identisch mit der momentan auf diesem ROBUST-Host installierten Version. Der lokale Build steht im Dashboard unter „Server“.

-
+

Benutzerverwaltung

Einwohner direkt erstellen, suchen und deaktivieren. Serverprüfungen und Audit sind aktiv.

+

Neues Benutzerkonto

+ + + + +
+
+

Benutzer suchen / verwalten

+
+
OGL CONTROL PLANE · USERS

Benutzer & Avatare

Einwohnerkonten, Registrierung, Profile, Aktivität und Sperr-/Löschabläufe.

Autoritative API

Verfügbare Verwaltungsoperationen

Aus dem aktiven OpenAPI-Vertrag dieses Servers. Ein Klick öffnet die echte Operation mit Parametern, Berechtigungen und Ausführung im API-Explorer; nicht vorhandene Funktionen werden nicht simuliert.

–
API-Vertrag wird geladen…
@@ -380,6 +429,10 @@ main{padding:28px clamp(17px,3vw,52px)}
OGL CONTROL PLANE · CONSOLE

Konsole & Aufträge

Kontrollierte Serverfunktionen und Jobs über bereits geprüfte HTTP-Endpunkte. Keine unbeschränkte Shell.

Autoritative API

Verfügbare Verwaltungsoperationen

Aus dem aktiven OpenAPI-Vertrag dieses Servers. Ein Klick öffnet die echte Operation mit Parametern, Berechtigungen und Ausführung im API-Explorer; nicht vorhandene Funktionen werden nicht simuliert.

–
API-Vertrag wird geladen…
+
OBSERVABILITY · DIAGNOSTICS

Tagesprotokolle

ROBUST und lokale OpenSim-Logs werden nach Kalendertag archiviert. Archive öffnen, blättern und Fehler filtern – ohne Konsolenzugriff oder Download fremder Dateien.

Noch nicht geladen
+

Logarchiv

Sortiert nach Datum (neueste zuerst). Die OpenSim-Liste zeigt nur Dateien, die auf demselben Server vorhanden sind; fremde Simulator-Nodes benötigen ihren eigenen geschützten Logdienst.

–
Zum Öffnen der Logarchive mit einer gültigen Administrator-Sitzung anmelden.
+
SECURITY · TRACEABILITY

Audit & Ereignisse

Die bereits gespeicherten Administrationsaktionen mit Zeit, Akteur, Ressource und Korrelation; gruppiert nach Datum. Keine Änderung oder Löschung von Audit-Ereignissen.

Noch nicht geladen
+

Administrations-Audit

Abfrage der bestehenden persistenten World-API-Audit-Historie. Datumseinträge zeigen die aktuell geladene Ergebnismenge; ältere Datensätze können seitenweise nachgeladen werden.

OGL CONTROL PLANE / DIAGNOSTICS

Systemdiagnose

Prüfe die tatsächlich erreichbaren World-API-Dienste dieses OGL-Servers. Kein Demo-Status, keine Datenbankänderungen.

Noch nicht geprüft

Live-Selbsttest

Diese Prüfung liest ausschließlich den aktuellen Health-/Versions-/OpenAPI-Zustand, die ChatGPT-Anweisung und den optionalen Node-Lizenzdienst. Keine schreibenden Aktionen.

@@ -961,11 +1014,105 @@ function oglRenderWorkspaces(){ const path=document.createElement('code');path.textContent=entry.path; const summary=document.createElement('small');summary.textContent=entry.op.summary||'API-Operation'; const scope=document.createElement('small');scope.textContent='Scope: '+(entry.op['x-nexverse-scope']||'laut OpenAPI-Vertrag'); - b.append(badge,path,summary,scope);b.addEventListener('click',()=>oglWorkspaceOpen(entry));host.append(b); + b.append(badge,path,summary,scope);b.addEventListener('click',()=>oglActionEditor(domain,entry));host.append(b); } } } document.querySelectorAll('[data-workspace-search]').forEach(input=>input.addEventListener('input',oglRenderWorkspaces)); + +/* Inline API editor. No permission shortcut: every action uses the signed + * administrator bearer token and the existing server-side World API. */ +function oglActionEditor(domain,entry){ + const host=$('workspace-'+domain);if(!host)return; + let panel=$('oglAction-'+domain); + if(!panel){panel=document.createElement('div');panel.id='oglAction-'+domain;panel.className='ogl-action-surface';host.parentNode.insertBefore(panel,host)} + panel.replaceChildren(); + panel.append(oglPlain('h3','',entry.method+' '+entry.path),oglPlain('p','sectionlead',entry.op.summary||'World API')); + const form=document.createElement('form'), fields=document.createElement('div');fields.className='ogl-action-grid'; + const params=[]; + const pathNames=[...entry.path.matchAll(/\{([^}]+)\}/g)].map(m=>m[1]); + const queryNames=(entry.op.parameters||[]).filter(x=>x.in==='query'); + for(const param of [...pathNames.map(name=>({name,in:'path',required:true})),...queryNames]){ + const wrapper=document.createElement('label');wrapper.className='ogl-action-field';wrapper.textContent=param.name+(param.in==='path'?' · UUID / ID':' · Query'); + const input=document.createElement('input');input.required=param.required===true;input.placeholder=param.description||param.name; + wrapper.append(input);fields.append(wrapper);params.push({def:param,input}); + } + if(params.length)form.append(fields); + let bodyInput=null;const schema=requestSchema(entry.op); + if(schema){ + const label=oglPlain('label','label2','Anfragedaten (JSON)'); + bodyInput=document.createElement('textarea');bodyInput.setAttribute('aria-label','JSON-Anfrage');bodyInput.spellcheck=false;bodyInput.value=JSON.stringify(exampleFor(schema),null,2); + form.append(label,bodyInput); + } + const bar=document.createElement('div');bar.className='ogl-action-buttonrow'; + const run=document.createElement('button');run.type='submit';run.className='action';run.textContent=entry.method+' ausführen'; + const detail=document.createElement('button');detail.type='button';detail.className='action';detail.textContent='API-Details'; + detail.addEventListener('click',()=>oglWorkspaceOpen(entry)); + bar.append(run,detail);form.append(bar); + const status=oglPlain('p','authnote','Authentifizierte World-API-Operation; Rechteprüfung erfolgt serverseitig.'); + const output=document.createElement('pre');output.className='ogl-logs-pre';output.hidden=true; + panel.append(form,status,output); + form.addEventListener('submit',async e=>{ + e.preventDefault();if(!adminIsActive()){status.textContent='Bitte als Administrator anmelden.';return} + let url=entry.path;const query=new URLSearchParams(); + for(const {def,input} of params){const v=input.value.trim();if(!v&&def.required){status.textContent=def.name+' fehlt';return} + if(def.in==='path')url=url.replace('{'+def.name+'}',encodeURIComponent(v)); + else if(v)query.set(def.name,v); + } + if(query.toString())url+='?'+query.toString(); + if(!url.startsWith('/api/v1/')||url.includes('{')){status.textContent='Ungültige World-API-URL';return} + const body=bodyInput?.value.trim()||'';if(body){try{JSON.parse(body)}catch{status.textContent='JSON-Anfrage ist ungültig';return}} + if(entry.method!=='GET'&&entry.method!=='HEAD'){ + const destructive=entry.method==='DELETE'||/reset|revoke|ban|purge|delete/i.test(entry.path); + if(destructive){if(prompt('Zur Bestätigung AUSFÜHREN eintippen: '+entry.method+' '+url)!=='AUSFÜHREN')return} + else if(!confirm(entry.method+' '+url+' wirklich ausführen?'))return; + } + run.disabled=true;status.textContent='Anfrage läuft…';output.hidden=false;output.textContent=''; + try{ + const options={method:entry.method};if(body&&entry.method!=='GET')options.body=body; + const result=await oglRequest(url,options); + output.textContent=JSON.stringify(result,null,2);status.textContent='Server meldet Erfolg'; + }catch(error){status.textContent='Fehler: '+error.message} + finally{run.disabled=false} + }); + panel.scrollIntoView({behavior:'smooth',block:'nearest'}); +} +async function oglCreateUser(event){ + event.preventDefault();const out=$('oglUserCreateResult');out.hidden=false;out.textContent='Benutzer wird angelegt…'; + try{ + const json=await oglRequest('/api/v1/users',{method:'POST',body:JSON.stringify({ + first_name:$('oglFirstName').value.trim(),last_name:$('oglLastName').value.trim(), + email:$('oglUserEmail').value.trim(),password:$('oglUserPassword').value, + home_region:{name:$('oglHomeRegion').value.trim()} + })}); + out.textContent='Benutzer angelegt: '+JSON.stringify(json,null,2); + }catch(error){out.textContent=error.message}finally{$('oglUserPassword').value=''} +} +async function oglSearchUsers(){ + const q=$('oglUserQuery').value.trim(),host=$('oglUserResults');host.replaceChildren(); + if(q.length<2){$('oglUserSearchStatus').textContent='Mindestens 2 Zeichen benötigt';return} + try{ + const data=await oglRequest('/api/v1/users?q='+encodeURIComponent(q)+'&limit=50'); + const users=data.users||data.results||data.items||[]; + $('oglUserSearchStatus').textContent=users.length+' Ergebnisse'; + for(const user of users){ + const id=user.principal_id||user.principalId||user.user_id||user.id; + const row=document.createElement('div');row.className='ogl-user-row'; + row.append(oglPlain('strong','',(user.first_name||user.firstName||'')+' '+(user.last_name||user.lastName||'')), + oglPlain('small','',id||'Keine ID')); + const buttons=document.createElement('div');buttons.className='ogl-action-buttonrow'; + const view=document.createElement('button');view.className='action';view.textContent='Details';view.type='button'; + view.onclick=async()=>{try{const data=await oglRequest('/api/v1/users/'+encodeURIComponent(id));row.append(oglPlain('pre','ogl-logs-pre',JSON.stringify(data,null,2)))}catch(e){$('oglUserSearchStatus').textContent=e.message}}; + const remove=document.createElement('button');remove.className='action';remove.textContent='Deaktivieren';remove.type='button'; + remove.onclick=async()=>{if(prompt('Benutzer deaktivieren (Soft-Delete)? Bitte DEAKTIVIEREN eingeben: '+id)!=='DEAKTIVIEREN')return; + try{await oglRequest('/api/v1/users/'+encodeURIComponent(id),{method:'DELETE'});$('oglUserSearchStatus').textContent='Konto deaktiviert';await oglSearchUsers()}catch(e){$('oglUserSearchStatus').textContent=e.message}}; + buttons.append(view,remove);row.append(buttons);host.append(row); + } + if(!users.length)host.append(oglPlain('p','empty','Keine Benutzer gefunden.')); + }catch(error){$('oglUserSearchStatus').textContent=error.message} +} +$('oglUserCreate').addEventListener('submit',oglCreateUser); +$('oglUserSearch').addEventListener('click',oglSearchUsers); function oglGithubText(id,text){const element=$(id);if(element)element.textContent=String(text||'–')} async function oglLoadGithub(force=false){ if(oglGitPending)return oglGitPending; @@ -1033,8 +1180,132 @@ function oglFilterKeys(){ card.hidden=!(matching&&(filter==='all'||(filter==='active'&&active)||(filter==='disabled'&&!active))); }); } + +/* Direct operators: all changes go to existing server-side authorized APIs. */ +const oglLogState=new Map(); +let oglAuditOffset=0,oglAuditEvents=[]; +function oglAdminHeaders(body=false){ + const token=adminAuthToken(); + if(!token)throw Error('UserLevel-200-Administrator-Anmeldung erforderlich.'); + const headers={Accept:'application/json',Authorization:'Bearer '+token}; + if(body)headers['Content-Type']='application/json'; + return headers; +} +async function oglRequest(path,options={}){ + if(!path.startsWith('/api/v1/')||path.startsWith('//')||path.includes('\\'))throw Error('Nur lokale World-API-Routen sind erlaubt.'); + const response=await fetch(path,{...options,headers:{...oglAdminHeaders(!!options.body),...(options.headers||{})},credentials:'same-origin',cache:'no-store'}); + const raw=await response.text();let json; + try{json=JSON.parse(raw)}catch{json={message:raw.slice(0,6000)}} + if(!response.ok)throw Error('HTTP '+response.status+' · '+(json.error||json.message||'API-Anfrage fehlgeschlagen')); + return json; +} +function oglCleanDate(timestamp){ + const value=new Date(timestamp); + return Number.isNaN(value.getTime())?'Unbekanntes Datum':value.toLocaleDateString('de-DE',{year:'numeric',month:'2-digit',day:'2-digit'}); +} +function oglPlain(tag,cls,value){ + const e=document.createElement(tag);if(cls)e.className=cls;e.textContent=String(value??'');return e; +} +async function oglLoadLogIndex(){ + $('oglLogsStatus').textContent='Lade Archive…';$('oglLogsDot').className='dot'; + try{ + const data=await oglRequest('/api/v1/admin/logs'); + const chosen=$('oglLogsService').value; + const files=(data.files||[]).filter(x=>chosen==='all'||x.service===chosen) + .sort((a,b)=>String(b.date).localeCompare(String(a.date))||String(a.service).localeCompare(String(b.service))); + const host=$('oglLogArchiveList');host.replaceChildren();oglLogState.clear(); + $('oglLogsCount').textContent=files.length+' Tagesarchive'; + if(!files.length)host.append(oglPlain('p','empty','Noch keine tagesweise protokollierten Dateien auf diesem Host.')); + for(const file of files){ + const row=document.createElement('details');row.className='ogl-day'; + const heading=document.createElement('summary'); + const title=file.service+(file.node_id?' · Node '+file.node_id:' · lokal')+ + ' Log vom '+oglCleanDate(file.date+'T12:00:00'); + heading.append(oglPlain('span','',title),oglPlain('small','',Math.round((file.bytes||0)/1024)+' KiB')); + const body=document.createElement('div');body.className='ogl-log-body'; + const pre=document.createElement('pre');pre.className='ogl-logs-pre';pre.textContent='Zum Laden aufklappen.'; + const more=document.createElement('button');more.className='action';more.type='button';more.textContent='Weitere Logzeilen';more.hidden=true; + body.append(pre,more);row.append(heading,body);host.append(row); + const state={file,lines:[],offset:0,more:false,loading:false,loaded:false}; + oglLogState.set(row,state); + const render=()=>{ + const q=$('oglLogsSearch').value.trim().toLowerCase(); + pre.textContent=state.lines.filter(x=>!q||x.toLowerCase().includes(q)).join('\\n')||'Keine passenden Logzeilen.'; + more.hidden=!state.more; + }; + const load=async()=>{ + if(state.loading||(!state.more&&state.loaded))return; + state.loading=true;more.disabled=true; + pre.textContent=state.loaded?'Lade weitere Zeilen…':'Lese Tagesarchiv…'; + try{ + const endpoint='/api/v1/admin/logs/'+file.service+'/'+file.date+ + '/entries?offset='+state.offset+'&limit=500'+ + (file.node_id?'&node_id='+encodeURIComponent(file.node_id):''); + const result=await oglRequest(endpoint); + state.lines.push(...(result.lines||[]));state.offset=result.next_offset; + state.more=Boolean(result.has_more);state.loaded=true;render(); + }catch(e){pre.textContent='Log konnte nicht geladen werden: '+e.message} + finally{state.loading=false;more.disabled=false} + }; + row.addEventListener('toggle',()=>{if(row.open&&!state.loaded)load()}); + more.addEventListener('click',load); + } + $('oglLogsStatus').textContent=files.length+' Tagesarchive';$('oglLogsDot').className='dot good'; + }catch(error){$('oglLogsStatus').textContent=error.message;$('oglLogsDot').className='dot bad'} +} +function oglFilterLogLines(){ + for(const [row,state] of oglLogState.entries()){ + if(!state.loaded)continue; + const pre=row.querySelector('pre'),q=$('oglLogsSearch').value.trim().toLowerCase(); + pre.textContent=state.lines.filter(x=>!q||x.toLowerCase().includes(q)).join('\\n')||'Keine passenden Logzeilen.'; + } +} +async function oglLoadAudit(next=false){ + if(!next){oglAuditOffset=0;oglAuditEvents=[]} + $('oglAuditStatus').textContent='Lade Audit…';$('oglAuditDot').className='dot'; + const p=new URLSearchParams({limit:'100',offset:String(oglAuditOffset)}); + for(const [id,param] of [['oglAuditActor','actor'],['oglAuditAction','action'],['oglAuditResource','resource']]){ + const val=$(id).value.trim();if(val)p.set(param,val); + } + try{ + const data=await oglRequest('/api/v1/audit?'+p.toString()); + oglAuditEvents.push(...(data.events||[])); + oglAuditOffset+=data.events?.length||0; + const buckets=new Map(); + for(const event of oglAuditEvents){ + const day=oglCleanDate(event.timestamp); + if(!buckets.has(day))buckets.set(day,[]); + buckets.get(day).push(event); + } + const host=$('oglAuditEntries');host.replaceChildren(); + for(const [day,events] of buckets){ + const fold=document.createElement('details');fold.className='ogl-day';fold.open=true; + const heading=document.createElement('summary');heading.textContent='Audit vom '+day+' · '+events.length+' Ereignisse'; + const body=document.createElement('div');body.className='ogl-log-body'; + for(const event of events){ + const row=document.createElement('div');row.className='ogl-audit-line'; + row.append(oglPlain('time','',String(event.timestamp||'').replace('T',' ').slice(0,19)), + oglPlain('strong','',event.action||'Unbekannte Aktion'), + oglPlain('span','',String(event.actor||'–')+' · '+String(event.resource||'–'))); + const detail=document.createElement('details');detail.className='ogl-audit-detail'; + detail.append(oglPlain('summary','','Details / Korrelation anzeigen'),oglPlain('pre','ogl-logs-pre',JSON.stringify({event_id:event.event_id,correlation_id:event.correlation_id,details:event.details},null,2))); + body.append(row,detail); + } + fold.append(heading,body);host.append(fold); + } + if(!buckets.size)host.append(oglPlain('p','empty','Keine Auditereignisse gefunden.')); + $('oglAuditMore').hidden=!data.pagination?.has_more; + $('oglAuditStatus').textContent=oglAuditEvents.length+' Einträge geladen'; + $('oglAuditDot').className='dot good'; + }catch(error){$('oglAuditStatus').textContent=error.message;$('oglAuditDot').className='dot bad'} +} +$('oglLogsRefresh').addEventListener('click',oglLoadLogIndex); +$('oglLogsService').addEventListener('change',oglLoadLogIndex); +$('oglLogsSearch').addEventListener('input',oglFilterLogLines); +$('oglAuditRefresh').addEventListener('click',()=>oglLoadAudit(false)); +$('oglAuditMore').addEventListener('click',()=>oglLoadAudit(true)); function showPage(name){ - if(['secrets','nodes','grid','security','console'].includes(name)&&!adminIsActive()){ + if(['secrets','nodes','grid','security','console','logs','audit','users','groups','inventory','economy','profiles','marketplace','estates','experiences','discovery'].includes(name)&&!adminIsActive()){ adminNextPage=name; name='adminlogin'; adminUpdateStatus('Anmeldung mit UserLevel >= 200 erforderlich.',null); @@ -1042,6 +1313,8 @@ function showPage(name){ document.querySelectorAll('.page').forEach(x=>x.classList.toggle('active',x.id==='page-'+name)); document.querySelectorAll('.navbtn').forEach(x=>{x.classList.toggle('active',x.dataset.page===name);if(x.dataset.page===name)x.closest('details')?.setAttribute('open','');}); if(name==='repository')oglLoadGithub(); + if(name==='logs')oglLoadLogIndex(); + if(name==='audit')oglLoadAudit(false); if(oglWorkspaceGroups[name])oglRenderWorkspaces(); window.scrollTo({top:0,behavior:'smooth'}); } diff --git a/NexVerse/Server/Api/NexBusHttpTransport.cs b/NexVerse/Server/Api/NexBusHttpTransport.cs index 63ff37ea..bc2d54c9 100644 --- a/NexVerse/Server/Api/NexBusHttpTransport.cs +++ b/NexVerse/Server/Api/NexBusHttpTransport.cs @@ -284,8 +284,14 @@ namespace NexVerse.Server.Api try { - bool accepted = m_Bus.Receive(nexEvent); - Write(response, HttpStatusCode.Accepted, new + bool isLogChunk = nexEvent.Name == "node.log.chunk"; + // Persist logs synchronously before acknowledging the sender. + // Do NOT publish these private payloads to the general bus: + // DistributedNexEventBus.Receive would fan them out to peers. + bool accepted = isLogChunk + ? (m_Bus.ReceiveLogChunk?.Invoke(nexEvent) == true) + : m_Bus.Receive(nexEvent); + Write(response, isLogChunk && !accepted ? HttpStatusCode.Conflict : HttpStatusCode.Accepted, new { accepted, event_id = nexEvent.EventId diff --git a/NexVerse/Server/Api/NexBusRemoteLogArchive.cs b/NexVerse/Server/Api/NexBusRemoteLogArchive.cs new file mode 100644 index 00000000..0193fa03 --- /dev/null +++ b/NexVerse/Server/Api/NexBusRemoteLogArchive.cs @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: MPL-2.0 +// Signed NexBus chunks from registered simulator nodes are mirrored to +// bin/logs/OpenSim__.log, never to arbitrary paths. +using System; +using System.Globalization; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using log4net; +using NexVerse.Core.ControlPlane; +using NexVerse.Core.Messaging; + +namespace NexVerse.Server.Api +{ + internal sealed class NexBusRemoteLogArchive + { + private static readonly ILog s_Log = LogManager.GetLogger(typeof(NexBusRemoteLogArchive)); + internal static readonly Regex SafeNode = new Regex( + @"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$", RegexOptions.Compiled | RegexOptions.CultureInvariant); + private const int MaxChunk = 32 * 1024; + private readonly NexNodeRegistry m_Nodes; + private readonly string m_Folder; + private readonly object m_Sync = new object(); + + internal NexBusRemoteLogArchive(NexNodeRegistry nodes) + { + m_Nodes = nodes ?? throw new ArgumentNullException(nameof(nodes)); + m_Folder = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "logs")); + } + + /// + /// Invoked only by the HMAC-verified NexBus endpoint, without regular + /// event-bus fan-out. HTTP 202 is sent ONLY after durable persistence + /// or byte-for-byte replay of an already persisted chunk. + /// + internal bool TryReceive(NexEvent ev) + { + if (ev == null || ev.Name != "node.log.chunk" || + ev.Source != "nexverse.simulator" || ev.Data == null || + !ev.Data.TryGetValue("node_id", out string node) || !SafeNode.IsMatch(node) || + !ev.Data.TryGetValue("date", out string day) || + !DateTime.TryParseExact(day, "yyyy-MM-dd", + CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime date) || + Math.Abs((DateTime.Today - date).TotalDays) > 14 || + !ev.Data.TryGetValue("offset", out string rawOffset) || + !long.TryParse(rawOffset, NumberStyles.None, + CultureInfo.InvariantCulture, out long offset) || + offset < 0 || offset > 512L * 1024 * 1024 || + !ev.Data.TryGetValue("bytes_base64", out string b64) || + b64.Length > (MaxChunk * 4 / 3) + 8 || + m_Nodes.Get(node) == null) + return false; + + byte[] bytes; + try { bytes = Convert.FromBase64String(b64); } + catch (FormatException) { return false; } + if (bytes.Length == 0 || bytes.Length > MaxChunk) return false; + + string name = "OpenSim_" + node + "_" + + date.ToString("dd_MM_yyyy", CultureInfo.InvariantCulture) + ".log"; + string path = Path.Combine(m_Folder, name); + try + { + lock (m_Sync) + { + Directory.CreateDirectory(m_Folder); + using var file = new FileStream(path, FileMode.OpenOrCreate, + FileAccess.ReadWrite, FileShare.Read, 4096, FileOptions.None); + // At-most-once reconstruction of an ordered byte stream. + // The sender resends the same chunk if HTTP acknowledgement + // is lost; reject gaps and non-identical overlapping data. + if (offset > file.Length) return false; + if (offset < file.Length) + { + if (offset + bytes.Length > file.Length) return false; + file.Position = offset; + byte[] previous = new byte[bytes.Length]; + if (file.Read(previous, 0, previous.Length) != previous.Length || + !System.Security.Cryptography.CryptographicOperations.FixedTimeEquals(previous, bytes)) + return false; + return true; + } + file.Position = file.Length; + file.Write(bytes, 0, bytes.Length); + file.Flush(); + if (!OperatingSystem.IsWindows()) + { + try { File.SetUnixFileMode(path, UnixFileMode.UserRead | UnixFileMode.UserWrite); } + catch (IOException) { } + catch (UnauthorizedAccessException) { } + } + } + return true; + } + catch (Exception e) when (e is IOException || e is UnauthorizedAccessException) + { + s_Log.Warn("[OGL-LOG-RELAY]: Cannot persist remote simulator log chunk (" + + e.GetType().Name + ")."); + return false; + } + } + + } +} diff --git a/NexVerse/Server/Api/NexChatGptInstructionDownloads.cs b/NexVerse/Server/Api/NexChatGptInstructionDownloads.cs index bedd3cdb..1f9bd590 100644 --- a/NexVerse/Server/Api/NexChatGptInstructionDownloads.cs +++ b/NexVerse/Server/Api/NexChatGptInstructionDownloads.cs @@ -529,6 +529,9 @@ namespace NexVerse.Server.Api "/api/v1/search"); AppendCatalogGroup(md, requestedAudience, "public", "version", "/api/v1/version"); + AppendCatalogGroup(md, requestedAudience, "admin", "ROBUST und OpenSim Tageslogs – lokale Operatoren", + "/api/v1/admin/logs", + "/api/v1/admin/logs/{service}/{date}/entries"); AppendCatalogGroup(md, requestedAudience, "public", "OpenGenesisLINK GitHub Stable/Development/CI Status", "/api/v1/repository/status"); AppendCatalogGroup(md, requestedAudience, "public", "Oeffentliche Weltkarte", diff --git a/NexVerse/Server/Api/NexOperatorLogsApi.cs b/NexVerse/Server/Api/NexOperatorLogsApi.cs new file mode 100644 index 00000000..a58ddfad --- /dev/null +++ b/NexVerse/Server/Api/NexOperatorLogsApi.cs @@ -0,0 +1,203 @@ +// SPDX-License-Identifier: MPL-2.0 +// Local, read-only, per-day operator logs; no arbitrary paths or remote shell. +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using NexVerse.Core.Security; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Services.Interfaces; + +namespace NexVerse.Server.Api +{ + internal sealed class NexOperatorLogsApi + { + private const int MaxPage = 1000; + private const int MaxOffset = 1000000; + private static readonly Regex s_FileName = new Regex( + @"^(Robust|OpenSim)(?:_([A-Za-z0-9][A-Za-z0-9._-]{0,63}))?_(\d{2})_(\d{2})_(\d{4})\.log$", + RegexOptions.CultureInvariant | RegexOptions.Compiled); + private static readonly Regex s_Secret = new Regex( + @"(?i)(authorization\s*[:=]\s*bearer\s+|x-nexverse-api-key\s*[:=]\s*|password(?:hash|salt)?\s*[:=]\s*|token\s*[:=]\s*)([^\s,;]+)", + RegexOptions.CultureInvariant | RegexOptions.Compiled); + + private readonly NexApiAuthenticator m_Auth; + private readonly string m_LogDirectory; + + internal NexOperatorLogsApi(NexApiAuthenticator authenticator) + { + m_Auth = authenticator ?? throw new ArgumentNullException(nameof(authenticator)); + m_LogDirectory = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "logs")); + } + + internal NexOperatorLogsApi(NexApiAuthenticator authenticator, string baseDirectory) + { + m_Auth = authenticator ?? throw new ArgumentNullException(nameof(authenticator)); + m_LogDirectory = Path.GetFullPath(Path.Combine(baseDirectory, "logs")); + } + + public void Handle(IOSHttpRequest request, IOSHttpResponse response) + { + response.KeepAlive = false; + response.ContentType = "application/json; charset=utf-8"; + response.AddHeader("Cache-Control", "private, no-store"); + response.AddHeader("X-Content-Type-Options", "nosniff"); + if (request == null || request.HttpMethod != "GET") + { + Write(response, HttpStatusCode.MethodNotAllowed, new {error = "method_not_allowed"}); + return; + } + if (!m_Auth.TryAuthenticate(request, NexScopes.AdminAll, + out NexPrincipal principal, out UserAccount account, + out int status, out string reason)) + { + Write(response, (HttpStatusCode)status, new {error = "admin_auth_required"}); + return; + } + if (account == null || !account.LocalToGrid || account.UserLevel < 200 || + !principal.HasScope(NexScopes.AdminAll)) + { + Write(response, HttpStatusCode.Forbidden, new {error = "admin_level_required"}); + return; + } + + string path = (request.UriPath ?? "").TrimEnd('/'); + if (path == "/api/v1/admin/logs") + { + List(response); + return; + } + + string[] parts = path.Trim('/').Split('/'); + if (parts.Length != 7 || parts[0] != "api" || parts[1] != "v1" || + parts[2] != "admin" || parts[3] != "logs" || + (parts[4] != "Robust" && parts[4] != "OpenSim") || + !DateTime.TryParseExact(parts[5], "yyyy-MM-dd", + CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime date) || + parts[6] != "entries" || + date.Date > DateTime.UtcNow.Date.AddDays(1)) + { + Write(response, HttpStatusCode.NotFound, new {error = "log_not_found"}); + return; + } + int limit = 500, offset = 0; + if (request.QueryString?["limit"] is string l && + (!int.TryParse(l, out limit) || limit < 1 || limit > MaxPage) || + request.QueryString?["offset"] is string o && + (!int.TryParse(o, out offset) || offset < 0 || offset > MaxOffset)) + { + Write(response, HttpStatusCode.BadRequest, new {error = "invalid_pagination"}); + return; + } + string nodeId = request.QueryString?["node_id"] ?? string.Empty; + if (nodeId.Length != 0 && + (parts[4] != "OpenSim" || !NexBusRemoteLogArchive.SafeNode.IsMatch(nodeId))) + { + Write(response, HttpStatusCode.BadRequest, new {error = "invalid_node_id"}); + return; + } + ReadDay(response, parts[4], date, limit, offset, nodeId); + } + + private void List(IOSHttpResponse response) + { + try + { + var dates = new List(); + if (Directory.Exists(m_LogDirectory)) + { + foreach (string file in Directory.EnumerateFiles(m_LogDirectory, "*.log")) + { + string basename = Path.GetFileName(file); + Match match = s_FileName.Match(basename); + if (!match.Success || + !DateTime.TryParseExact( + match.Groups[3].Value+"_"+match.Groups[4].Value+"_"+match.Groups[5].Value, + "dd_MM_yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, + out DateTime date)) continue; + FileInfo info = new FileInfo(file); + dates.Add(new + { + service = match.Groups[1].Value, + node_id = match.Groups[2].Success ? match.Groups[2].Value : null, + date = date.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + name = basename, + bytes = info.Length, + last_modified_utc = info.LastWriteTimeUtc.ToString("O") + }); + } + } + // Same fields as ReadDay, grouped in descending date order by the browser. + dates = dates.OrderByDescending(x => JsonSerializer.Serialize(x)).ToList(); + Write(response, HttpStatusCode.OK, new {files = dates, directory = "logs", format = "dd_MM_yyyy"}); + } + catch (IOException) + { + Write(response, HttpStatusCode.ServiceUnavailable, new {error = "logs_unavailable"}); + } + catch (UnauthorizedAccessException) + { + Write(response, HttpStatusCode.ServiceUnavailable, new {error = "logs_unavailable"}); + } + } + + private void ReadDay(IOSHttpResponse response, string service, DateTime date, + int limit, int offset, string nodeId) + { + string filename = service+(string.IsNullOrEmpty(nodeId) ? "" : "_"+nodeId)+ + "_"+date.ToString("dd_MM_yyyy", CultureInfo.InvariantCulture)+".log"; + string file = Path.Combine(m_LogDirectory, filename); + if (!File.Exists(file)) + { + Write(response, HttpStatusCode.NotFound, new {error = "log_not_found"}); + return; + } + try + { + List lines = new List(limit + 1); + using (var stream = new FileStream(file, FileMode.Open, FileAccess.Read, + FileShare.ReadWrite | FileShare.Delete)) + using (var reader = new StreamReader(stream, Encoding.UTF8, true)) + { + for (int i = 0; i < offset && reader.ReadLine() != null; i++) { } + while (lines.Count <= limit) + { + string line = reader.ReadLine(); + if (line == null) break; + line = s_Secret.Replace(line, "$1[REDACTED]"); + if (line.Length > 8192) line = line.Substring(0, 8192)+"…"; + lines.Add(line); + } + } + bool hasMore = lines.Count > limit; + if (hasMore) lines.RemoveAt(limit); + Write(response, HttpStatusCode.OK, new + { + service, node_id = string.IsNullOrEmpty(nodeId) ? null : nodeId, + date = date.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + file = filename, offset, limit, has_more = hasMore, next_offset = offset + lines.Count, + lines + }); + } + catch (IOException) + { + Write(response, HttpStatusCode.ServiceUnavailable, new {error = "logs_unavailable"}); + } + catch (UnauthorizedAccessException) + { + Write(response, HttpStatusCode.ServiceUnavailable, new {error = "logs_unavailable"}); + } + } + + private static void Write(IOSHttpResponse response, HttpStatusCode status, object payload) + { + response.StatusCode = (int)status; + response.RawBuffer = JsonSerializer.SerializeToUtf8Bytes(payload); + } + } +} diff --git a/NexVerse/Server/Api/NexVerseWorldApiConnector.cs b/NexVerse/Server/Api/NexVerseWorldApiConnector.cs index 98181c67..3ca93282 100644 --- a/NexVerse/Server/Api/NexVerseWorldApiConnector.cs +++ b/NexVerse/Server/Api/NexVerseWorldApiConnector.cs @@ -271,6 +271,12 @@ namespace NexVerse.Server.Api new NexNodeRegistry( eventBus, nodeStaleAfterSeconds); + // Remote simulator logs arrive as authenticated NexBus events + // from NodeAgents already registered by node.heartbeat. + // Local ROBUST and local OpenSim log readers use the same folder. + NexBusRemoteLogArchive remoteLogs = new NexBusRemoteLogArchive(nodeRegistry); + if (eventBus is DistributedNexEventBus signedLogBus) + signedLogBus.ReceiveLogChunk = remoteLogs.TryReceive; // Console verbosity is independent of the persistent audit // store: suppress routine health checks without losing audited @@ -609,6 +615,12 @@ namespace NexVerse.Server.Api oauthStore, apiKeyStore, adminMinimumLevel); + // Only the authenticated local UserLevel-200 operator may list + // or read local daily logs. No shell / arbitrary file access. + NexOperatorLogsApi operatorLogs = new NexOperatorLogsApi(authenticator); + server.AddSimpleStreamHandler(new SimpleStreamHandler( + "/api/v1/admin/logs", apiGate.Wrap(operatorLogs.Handle), + "OpenGenesisLINK operator daily log archives"), true); // Attach the existing, server-side native admin authenticator // once privileged services are available. No duplicate routing. diff --git a/NexVerse/Server/Api/NexVerseWorldApiHandlers.cs b/NexVerse/Server/Api/NexVerseWorldApiHandlers.cs index ae6c8f40..88526e86 100644 --- a/NexVerse/Server/Api/NexVerseWorldApiHandlers.cs +++ b/NexVerse/Server/Api/NexVerseWorldApiHandlers.cs @@ -175,6 +175,10 @@ namespace NexVerse.Server.Api ("post", "Einwohnersitzungen widerrufen und Sicherheitsstempel fortschreiben", "self or admin:*", "200")), ["/api/v1/audit"] = AuthenticatedOperations( ("get", "Persistente administrative Audit-Historie abfragen", "admin:*", "200")), + ["/api/v1/admin/logs"] = AuthenticatedOperations( + ("get", "Tagesarchiv-Liste von lokalem ROBUST und OpenSim, nur lokale Administratoren ab UserLevel 200", "admin:*", "200")), + ["/api/v1/admin/logs/{service}/{date}/entries"] = AuthenticatedOperations( + ("get", "Paginierte Logzeilen eines lokalen Tagesarchivs, 1-1000 pro Anfrage, sensitive Tokens maskiert", "admin:*", "200")), ["/api/v1/statistics/summary"] = StatisticsOperation(), ["/api/v1/grid/layout"] = AuthenticatedOperations( ("get", "Gebundenes Welt-Raster mit Zellbelegung lesen", "regions:read", "200")), diff --git a/NexVerse/Server/Api/OglApiDocsAccess.cs b/NexVerse/Server/Api/OglApiDocsAccess.cs index 708992b1..d19b6242 100644 --- a/NexVerse/Server/Api/OglApiDocsAccess.cs +++ b/NexVerse/Server/Api/OglApiDocsAccess.cs @@ -213,14 +213,45 @@ label{display:block;color:#d3deed;font-size:12px;margin:18px 0 8px;font-weight:6 #app{border:0;display:block;width:100%;height:100vh;background:#060b16}#app[hidden],#loginView[hidden]{display:none!important} @media(max-width:1000px){.stage{grid-template-columns:1fr;max-width:670px;padding-top:34px}.orbit{display:none}h1{font-size:clamp(43px,9vw,65px)}.intro{max-width:580px}.top{padding:22px 24px}.topright{font-size:9px}}@media(max-width:570px){.stage{gap:30px;padding:25px 18px 45px}.highlights{gap:7px}.highlight{font-size:11px;padding:8px 9px}.login{padding:25px 21px}.brand strong{font-size:15px}.sigil{width:41px;height:41px}.topright{display:none}.bottom{padding:15px 22px}} @media(prefers-reduced-motion:reduce){body:before{animation:none}.submit{transition:none}} + +/* World API Operator Login 3.0 – cinematic but keyboard-accessible */ +:root{--a:#5bd6fa;--v:#7daeff;--paper:#eef8ff;--muted:#9bb8cf;--line:rgba(110,174,226,.3)} +body{background:radial-gradient(ellipse at 8% 12%,rgba(29,109,160,.16),transparent 32%),radial-gradient(ellipse at 86% 77%,rgba(61,95,187,.14),transparent 41%),#040b16} +body:before{opacity:.28} +.top{background:rgba(6,16,29,.8);border-bottom:1px solid rgba(75,159,207,.26);min-height:88px} +.brand strong{letter-spacing:-.025em;font-size:20px}.brand span{letter-spacing:.12em} +.sigil{background:#0e2539;border-radius:14px;width:56px;height:56px} +.sigil img{width:51px!important;height:51px!important;filter:drop-shadow(0 0 13px rgba(82,222,247,.32))} +.topright{letter-spacing:.09em} +.stage{max-width:1350px;min-height:calc(100vh - 160px);margin:auto;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(340px,.8fr);align-items:center;gap:clamp(25px,4vw,75px);padding:clamp(38px,6vw,78px) clamp(22px,5vw,60px)} +.showcase{position:relative;overflow:hidden;padding:20px 10px 20px 0} +.showcase:before{content:'';position:absolute;top:20px;left:-100px;width:440px;height:440px;border:1px solid rgba(86,196,252,.13);border-radius:50%;pointer-events:none;box-shadow:0 0 0 40px rgba(70,172,230,.027),0 0 0 85px rgba(63,123,216,.025)} +.showcase h1{font-weight:780;font-size:clamp(38px,4.3vw,66px);line-height:1.08;letter-spacing:-.055em;margin:18px 0} +.showcase h1 em{font-style:normal;background:linear-gradient(90deg,#69e4fa,#86aaff);-webkit-background-clip:text;background-clip:text;color:transparent} +.ogl-showcase-logo{width:158px;height:158px;display:grid;place-items:center;border-radius:36px;position:relative;background:radial-gradient(circle,rgba(36,154,228,.2),transparent 70%);filter:drop-shadow(0 0 24px rgba(44,175,245,.22))} +.ogl-showcase-logo img{object-fit:contain;width:158px;height:158px} +.showcase .intro{max-width:580px;color:#b3cadc;line-height:1.8} +.highlights{gap:8px;flex-wrap:wrap}.highlight{border:1px solid rgba(67,139,204,.24);border-radius:8px;background:rgba(9,31,55,.75);font-size:12px} +.orbit{display:none} +.window{width:100%;max-width:460px;margin:0;justify-self:end;background:rgba(11,27,46,.96);border:1px solid rgba(79,178,227,.33);border-radius:20px;box-shadow:0 24px 85px rgba(0,0,0,.38),0 0 70px rgba(47,146,212,.04)} +.login{padding:clamp(22px,3vw,43px)}.login h2{font-size:29px;letter-spacing:-.035em;color:#f1faff} +.loginkicker{font-size:11px;letter-spacing:.13em;color:#66d8fc;font-weight:800} +.login p{color:#acc6d9;line-height:1.6} +.login input{min-height:47px;border-radius:9px;background:#09192c;border:1px solid #2d516b} +.login input:focus-visible{outline:2px solid #60d9f7;outline-offset:2px} +.submit{margin-top:20px;border-radius:9px;min-height:50px;background:linear-gradient(110deg,#1ca2ce,#4073c3);color:#f7fcff;font-weight:750;box-shadow:0 10px 28px rgba(16,128,199,.16)} +.submit:hover{background:linear-gradient(110deg,#25bce6,#588de3)} +.bottom{border-top:1px solid rgba(61,134,185,.22);background:#060f1d;color:#9bacc4} +@media(max-width:1000px){.stage{grid-template-columns:1fr;max-width:630px}.window{max-width:none;justify-self:stretch}.showcase{text-align:left}.ogl-showcase-logo{width:110px;height:110px}.ogl-showcase-logo img{width:110px;height:110px}} +@media(prefers-reduced-motion:reduce){.showcase:before,.ogl-showcase-logo{animation:none!important}}
OpenGenesisLINK World API Logo
OpenGenesisLINKWorld API · Control Center
Secure administration / Live Control Plane
-
The next generation of OpenSimulator

Deine Welt.
Deine Kontrolle.

Willkommen im OpenGenesisLINK Control Center. Verwalte Simulator-Nodes, Grid-Regionen, Dienste, Sicherheit, API-Zugänge und die Infrastruktur deiner virtuellen Welt an einem zentralen Ort.
◈ Grid & Regions
⬡ Simulator Control
⌁ World API Explorer
-
+
OPEN GENESIS LINK · WORLD CONTROL PLANE

Control Center.
Grenzenlose Möglichkeiten.

Willkommen im OpenGenesisLINK Control Center. Verwalte Simulator-Nodes, Grid-Regionen, Dienste, Sicherheit, API-Zugänge und die Infrastruktur deiner virtuellen Welt an einem zentralen Ort.
◈ Grid- & Regionensteuerung
⬡ Live-Diagnose & Audit
⌁ API & Sicherheit
+
© OpenGenesisLINK · OGL Server Technology
Protected administration environment
diff --git a/bin/OpenSim.exe.config b/bin/OpenSim.exe.config index 5be69899..83a5ff9b 100644 --- a/bin/OpenSim.exe.config +++ b/bin/OpenSim.exe.config @@ -30,9 +30,14 @@ ... --> - - + + + + + + + diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 93ecd27f..e0769842 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -7,6 +7,11 @@ NodeId = "" PeerUrl = "${Environment|NEXVERSE_NEXBUS_PEER_URL}" SharedKey = "${Environment|NEXVERSE_NEXBUS_SHARED_KEY}" + ; Daily OpenSim_.log is forwarded automatically to ROBUST + ; as signed NexBus chunks. This contains sensitive diagnostics: + ; only enable for trusted peers reachable over HTTPS. + ; ROBUST stores OpenSim__.log under bin/logs. + LogForwardingEnabled = true InboundPath = "/internal/nexbus/v1/events" HeartbeatSeconds = 30 QueueCapacity = 2048 diff --git a/bin/Robust.exe.config b/bin/Robust.exe.config index 3ad5f317..c785b2b9 100644 --- a/bin/Robust.exe.config +++ b/bin/Robust.exe.config @@ -28,9 +28,14 @@ ... --> - - + + + + + + + diff --git a/doc/OpenGenesisLINK/WORLD_API_SQL_OPERATIONS_LOGS_AUDIT_2026-10-25.md b/doc/OpenGenesisLINK/WORLD_API_SQL_OPERATIONS_LOGS_AUDIT_2026-10-25.md new file mode 100644 index 00000000..5393b96b --- /dev/null +++ b/doc/OpenGenesisLINK/WORLD_API_SQL_OPERATIONS_LOGS_AUDIT_2026-10-25.md @@ -0,0 +1,69 @@ +# OpenGenesisLINK – Betreiber-SQL, World-API und Tabellen-Lifecycle + +Stand: 25.10.2026. Analyse der vom Betreiber bereitgestellten `nexverse_daten.sql` (**Datenexport; kein Schemasnapshot, keine CREATE TABLE-Befehle**) und Quervergleich gegen den aktuellen Code in `opengenesislink/opengenesislinkserver`. + +## Datengrundlage und Grenzen + +Der HeidiSQL-Export enthält **63 benannte Tabellen**, davon **44 mit INSERT-Anweisungen** und **19 mit ~0 Zeilen**. Die Angaben `~… rows` stammen aus Exportkommentaren und sind ungefähre Datensatzmengen. Die Anzahl der `INSERT INTO`-Zeilen ist durch Batch-Inserts nicht gleich der Zeilenanzahl. Der Export enthält personenbezogene Daten, Authentifizierungshashes und Inventar-/Assetdaten; deshalb werden **keine SQL-Nutzdaten** ins Repository übernommen und keine Benutzer-/Geheimdaten zitiert. + +Repräsentative Tabellen im Dump (ungefähre Zeilen): `fsassets` 336.728; `primshapes` 11.178; `prims` 10.920; `inventoryitems` 10.279; `primitems` 3.660; `Avatars` 2.669; `inventoryfolders` 1.152; `portal_im_entries` 460; `GridUser` 233; `land` 159; `regionsettings`, `terrain`, `bakedterrain` und `estate_map` jeweils ca. 150; `regions` 49; `UserAccounts` 16. Für Tabellen ohne Datensätze sind Spaltendefinitionen im Datenexport **nicht enthalten**; die tatsächliche DDL ist mit `SHOW CREATE TABLE` zu verifizieren. + +## World-API-Potenzial (keine direkt freigegebenen SQL-Endpunkte) + +| Tabellen/Daten | Naheliegende API-Verwendung | Status/Schutz | +|---|---|---| +| `UserAccounts`, `auth`, `GridUser` | Benutzer anlegen, suchen, aktualisieren, sperren/deaktivieren, Online-/Home-Region | **Bestehende** `GET/POST /api/v1/users`, `GET/PATCH/DELETE /api/v1/users/{principalId}`; Authentifizierung nur über Account-Services, niemals Hash-/Salt-Ausgabe | +| `Friends`, `Avatars`, `userprofile`, `userdata` | Anzeigenamen, soziale Beziehungen, Profilbilder und Sichtbarkeit | Profile/SocialGraph über vorhandene Dienste; Privacy und Owner/Administrator-Rechte | +| `regions`, `regionsettings`, `regionextra`, `terrain`, `bakedterrain`, `spawn_points` | Grid/Regionenstatus, Estate-Einstellungen, Terrain- und Spawnverwaltung | API via bestehendem Region-/Grid-/Estate-Service; keine direkten DELETE-Tabellenoperationen | +| `prims`, `primshapes`, `primitems`, `land` | Objekt-/Parzellen-Statistiken, begrenzte Regionen-/Land-Mutationen | Regionseigentum, Simulator-Zustand und Linkset-Integrität beachten; keine frei bearbeitbaren Rohdaten-REST-Tabellen | +| `inventoryitems`, `inventoryfolders`, `fsassets` | Inventarstruktur, Asset-Vorschaubilder, Medientyp, Speicherstatistik | Bestehende Inventar- und Media-API; Kopier-/Transfer-/Owner-Rechte und AssetService-Weg strikt einhalten | +| `os_groups_*` | Gruppen, Rollen, Einladungen, Notices, Länder-/Estate-Rechte | Bestehende NexGroups API; über Dienste und GroupPowers, nicht SQL-Manipulation | +| `ogl_ledger_*`, `ogl_economy_*` | Konten, Ledger, Zahlungen, Handel und Land-Mietverträge | Bestehende BankingCommerce-/Ledger-Services; Transaktionen nur mit Double-Entry, Idempotenz und Audit | +| `portal_im_entries` | Portalnachrichten und Zustellprotokoll | Eigene IM-/Portal-Dienste und Privatsphäre; kein globaler öffentlich lesbarer Nachrichtenfeed | +| `ogl_password_recovery` | Reset-Challenges / Passwortänderung | Bestehende `/api/v1/auth/password-recovery`-Routen; niemals Tokens exportieren oder Roh-DELETE anbieten | + +Neue generische `GET/PUT/POST/DELETE /table/{name}`-Endpunkte werden **nicht** implementiert: Das würde Gruppenrechte, Prim-Referenzen, Inventory-Permissions, atomare Buchungen und OpenSim-Konsistenz verletzen. Das neue Admin-Center kann alle bestehenden OpenAPI-Operationen unmittelbar mit signiertem Admin-Bearer und expliziter Bestätigung ausführen, inklusive Einwohneranlage, Soft-Delete, gruppen-/regionbezogenen Aktionen und Asset-Operationen, soweit diese serverseitig tatsächlich existieren. + +## Die 19 im Export leeren Tabellen + +**Nicht löschen – weiterhin im Quellcode/Migrationen referenziert:** + +- `classifieds`: Profile/Search/Discovery und UserProfiles-Migrationen +- `estateban`, `estate_groups`, `estate_users`: Estate-Zugriffslisten/Bans; MySQL/PGSQL/SQLite EstateStore-Migrationen +- `hg_traveling_data`: Hypergrid-TravelService / HGTravelStore-Migrationen +- `MuteList`: MuteListService-/Store-Implementierungen +- `ogl_economy_commerce_orders`, `ogl_economy_land_leases`, `ogl_economy_land_listings`, `ogl_economy_payment_requests`, `ogl_economy_transfer_policies`, `ogl_ledger_account_events`: `NexLedgerSqlStore` und Economy-CI-Regressionspfade +- `ogl_password_recovery`: `NexPasswordRecoveryStore` (0 offene Challenges ist erwartbar) +- `os_groups_notices`: Gruppen-Notices und Gruppenmigration +- `regionban`, `regionextra`, `regionwindlight`, `spawn_points`: RegionStore-/Simulator-Migrationen, Terrain/Environment/Regionzustand +- `userdata`: UserProfilesStore und Benutzer-/Profilkompatibilität + +**Ergebnis:** Aus diesem Export lässt sich **keine** Tabelle zweifelsfrei als totes Schema beweisen. Leer bedeutet „zum Zeitpunkt des Dumps nicht benutzt“, **nicht** „von Code und Migrationen ungenutzt“. Daher keine DROP TABLE-Anweisungen und kein riskantes Entfernen aus den Schema-Migrationen. + +## Nächster sicherer Datenbankabgleich + +Vor jeder späteren Schema-Entfernung vollständigen DDL-/Laufzeitabgleich erstellen, zum Beispiel in einer **isolierten Staging-DB**: + +```sql +SELECT TABLE_NAME, TABLE_ROWS, CREATE_TIME, UPDATE_TIME +FROM information_schema.TABLES +WHERE TABLE_SCHEMA = DATABASE() +ORDER BY TABLE_NAME; + +SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_KEY +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() +ORDER BY TABLE_NAME, ORDINAL_POSITION; +``` + +Dazu pro Tabelle Schreib-/Leseaufrufe, Migrationserzeugung für MySQL/PGSQL/SQLite, Konfigurations-Featureflags, Provider, Hypergrid- und Viewerkompatibilität prüfen; ausschließlich gesicherte, explizit freigegebene Migrationen verwenden. + +## Ergänzte Operator-Funktionen + +- Geschützter Tageslog-Endpunkt `GET /api/v1/admin/logs`; einzelne Logzeilen `GET /api/v1/admin/logs/{Robust|OpenSim}/{yyyy-MM-dd}/entries?limit=500&offset=0` ausschließlich für echte lokale Administratoren mit UserLevel >= 200. +- Log4net schreibt pro Tag `bin/logs/Robust_dd_MM_yyyy.log` und `bin/logs/OpenSim_dd_MM_yyyy.log`. Auch vorhandene Altlogs im früheren `bin/*.log` müssen bei Bedarf gesondert archiviert werden. +- **Fremde Nodes:** `NexVerseNodeAgent` sendet bis zu 32-KiB-Chunks signiert über denselben NexBus-HMAC-/HTTPS-Endpunkt. ROBUST quittiert erst nach Prüfen/Speichern; ein verlorener HTTP-Status führt zur byte-identischen Wiederholung. Der Dateiname enthält die vertraute `NodeId`: `bin/logs/OpenSim__dd_MM_yyyy.log`. Keine Auslieferung dieser Daten an andere NexBus-Peers, keine frei zugängliche Log-URL. +- Im Web-Dashboard: ausklappbare Tage für lokalen ROBUST sowie lokale/verbundene OpenSim-Nodes, Filter, Pagination und vorhandener persistenter Admin-Auditfeed `GET /api/v1/audit`. +- Für fremde Server ist `LogForwardingEnabled=true` Standard im Beispieldokument; eine **HTTPS**-NexBus-Gegenstelle und sicher formatierte `NodeId` sind zwingend. Logs können vertrauliche Nutzerdaten enthalten; Zugriff nur für Betreiber, Rotations-/Retention-Policy organisatorisch festlegen. + +**Produktionsabnahme:** Sicherung von MariaDB und bisherigen Logs, Update von ROBUST **und jeder beteiligten Simulator-Node**, überprüfter TLS-/NexBus-Rückkanal, Auth-/Log-Tests, Fehlerszenarien (Abbruch, Wiederholung, Partition, NodeId-Manipulation), Firestorm-/OpenSim-Login und SQL-Schema-Abgleich. Ein Merge ist keine Live-Installation. diff --git a/tools/ci/verify_ogl_operator_logs_admin.py b/tools/ci/verify_ogl_operator_logs_admin.py new file mode 100644 index 00000000..5f41e291 --- /dev/null +++ b/tools/ci/verify_ogl_operator_logs_admin.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python3 +"""Regression guard for admin operator UI, daily local/remote logs and SQL safety.""" +from pathlib import Path +import re +import shutil +import subprocess +import tempfile +import xml.etree.ElementTree as ET + +root=Path(__file__).resolve().parents[2] +page=(root/"NexVerse/Server/Api/NexApiDocsPage.cs").read_text() +login=(root/"NexVerse/Server/Api/OglApiDocsAccess.cs").read_text() +reader=(root/"NexVerse/Server/Api/NexOperatorLogsApi.cs").read_text() +relay=(root/"NexVerse/Server/Api/NexBusRemoteLogArchive.cs").read_text() +node=(root/"NexVerse/RegionModules/NodeAgent/NexVerseNodeAgentModule.cs").read_text() +endpoint=(root/"NexVerse/Server/Api/NexBusHttpTransport.cs").read_text() +bus=(root/"NexVerse/Core/Messaging/DistributedNexEventBus.cs").read_text() +connector=(root/"NexVerse/Server/Api/NexVerseWorldApiConnector.cs").read_text() +openapi=(root/"NexVerse/Server/Api/NexVerseWorldApiHandlers.cs").read_text() +catalog=(root/"NexVerse/Server/Api/NexChatGptInstructionDownloads.cs").read_text() +doc=(root/"doc/OpenGenesisLINK/WORLD_API_SQL_OPERATIONS_LOGS_AUDIT_2026-10-25.md").read_text() + +for name in ("Robust", "OpenSim"): + cfg=ET.parse(root/"bin"/f"{name}.exe.config") + appender=cfg.find(".//appender[@name='LogFileAppender']") + assert appender is not None + assert appender.attrib["type"]=="log4net.Appender.RollingFileAppender" + assert appender.find("file").attrib["value"]==f"logs/{name}_" + assert appender.find("rollingStyle").attrib["value"]=="Date" + assert appender.find("datePattern").attrib["value"]=="dd_MM_yyyy'.log'" + assert appender.find("staticLogFileName").attrib["value"]=="false" + +for item in ('"/api/v1/admin/logs"', '"/api/v1/admin/logs/{service}/{date}/entries"'): + assert item in openapi +assert "GET /api/v1/admin/logs" in doc +assert "/{yyyy-MM-dd}/entries" in doc +assert 'new NexOperatorLogsApi(authenticator)' in connector +assert 'apiGate.Wrap(operatorLogs.Handle)' in connector +for marker in ("NexScopes.AdminAll", "account.UserLevel < 200", "account.LocalToGrid", + 's_FileName.Match(basename)', 'node_id', 'TryParseExact', + '"logs"', 'MaxPage = 1000', 'FileShare.ReadWrite | FileShare.Delete', + 's_Secret.Replace', 'NexBusRemoteLogArchive.SafeNode.IsMatch(nodeId)'): + assert marker in reader, marker + +for marker in ('m_Nodes.Get(node) == null','SafeNode.IsMatch(node)', + '"OpenSim_" + node + "_"','offset > file.Length', + 'FixedTimeEquals(previous, bytes)', 'file.Flush();', + 'File.SetUnixFileMode', 'internal bool TryReceive(NexEvent ev)'): + assert marker in relay, marker + +for marker in ('LogForwardingEnabled','NexBusProtocol.Serialize(envelope)', + 'NexBusProtocol.Sign(payload, m_SharedKey)','"node.log.chunk"', + 'HttpStatusCode.Accepted','result.Content.ReadAsByteArrayAsync()', + 'cursor += count','Interlocked.CompareExchange(ref m_LogForwardRunning', + 'm_LogForwardOffsets[dayId] = cursor', 'peer.Scheme == Uri.UriSchemeHttps'): + assert marker in node, marker + +assert 'm_Bus.ReceiveLogChunk?.Invoke(nexEvent)' in endpoint +assert 'm_Bus.Receive(nexEvent)' in endpoint +assert 'isLogChunk && !accepted ? HttpStatusCode.Conflict' in endpoint +assert 'public Func ReceiveLogChunk' in bus +assert 'signedLogBus.ReceiveLogChunk = remoteLogs.TryReceive;' in connector + +for marker in ('id="page-logs"','id="page-audit"', + 'id="oglUserCreate"','id="oglUserSearch"', + 'function oglLoadLogIndex()','function oglLoadAudit(next=false)', + 'function oglActionEditor(domain,entry)', 'function oglCreateUser(event)', + 'function oglSearchUsers()', 'new URLSearchParams', + 'DEAKTIVIEREN','AUSFÜHREN', + 'file.node_id?', 'encodeURIComponent(file.node_id)'): + assert marker in page, marker +assert 'OGL_LOGO_DATA_URI' in login +assert 'UserLevel 200' in login +assert "63 benannte Tabellen" in doc +assert "19 mit ~0 Zeilen" in doc +assert "keine" in doc.lower() +assert "DROP TABLE" in doc + +# Syntax-check actual browser programs, not disconnected sample files. +if shutil.which("node") is None: + raise RuntimeError("Node is necessary for browser admin regression") +for code,filename in [(page,"panel.mjs"),(login,"login.mjs")]: + match=re.search(r"", code, re.S) + assert match,filename + with tempfile.TemporaryDirectory() as temp: + path=Path(temp)/filename + path.write_text(match.group(1)) + check=subprocess.run(["node","--check",str(path)],capture_output=True,text=True) + assert check.returncode==0,filename+": "+check.stderr + +print("Operator Center: daily ROBUST/OpenSim and NexBus NodeId archives, admin CRUD, audit, XML & JavaScript OK") diff --git a/tools/ci/verify_worldapi_scifi_admin_center.py b/tools/ci/verify_worldapi_scifi_admin_center.py index bf67e9ee..34a49252 100644 --- a/tools/ci/verify_worldapi_scifi_admin_center.py +++ b/tools/ci/verify_worldapi_scifi_admin_center.py @@ -51,7 +51,8 @@ assert "secretKeySearch" in page and "secretKeyState" in page assert "oglFilterKeys()" in page assert "entries.filter(x=>prefixes.some(p=>x.path.startsWith(p)))" in page assert "selectEntry(entry)" in page -assert "['secrets','nodes','grid','security','console'].includes(name)" in page +assert "['secrets','nodes','grid','security','console'," in page +assert "'logs','audit','users','groups'" in page assert "keine unbeschränkte Shell" in page or "Keine unbeschränkte Shell" in page # Extract JS from the actual HTML page (do not create a separate, unused demo file). script=re.search(r"",page,re.S)