diff --git a/.github/workflows/nexjast-ci.yml b/.github/workflows/nexjast-ci.yml index 03b64a09..7795d5ea 100644 --- a/.github/workflows/nexjast-ci.yml +++ b/.github/workflows/nexjast-ci.yml @@ -86,6 +86,10 @@ jobs: - name: Verify OpenGenesisLINK protected admin Control Center shell: bash run: python3 tools/ci/verify_ogl_docs_admin_ui.py + - 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 OpenGenesisLINK 0.9.3.12 dashboard and diagnostic updates shell: bash diff --git a/NexVerse/Server/Api/NexApiDocsPage.cs b/NexVerse/Server/Api/NexApiDocsPage.cs index bc469408..2376355e 100644 --- a/NexVerse/Server/Api/NexApiDocsPage.cs +++ b/NexVerse/Server/Api/NexApiDocsPage.cs @@ -46,12 +46,12 @@ namespace NexVerse.Server.Api "no-referrer"); response.AddHeader( "Content-Security-Policy", - "default-src 'self'; style-src 'unsafe-inline'; script-src 'unsafe-inline'; connect-src 'self'"); + "default-src 'self'; img-src 'self' data:; style-src 'unsafe-inline'; script-src 'unsafe-inline'; connect-src 'self'"); response.RawBuffer = Encoding.UTF8.GetBytes(s_Html); } - private const string s_Html = """ + private static readonly string s_Html = """ @@ -190,26 +190,97 @@ main:before {content:"";position:fixed;inset:0;pointer-events:none;opacity:.17;z .ogl-triage-tile p{font-size:12px;color:#a4b8d4;line-height:1.6;} .ogl-triage-tile code{overflow-wrap:anywhere;} + +/* OGL COMMAND CENTER 2.0 — overlays existing validated controls and preserves IDs */ +:root{--bg:#030914;--panel:#0a172b;--panel2:#10243b;--line:rgba(75,157,218,.25);--text:#edf8ff;--muted:#97b5d2;--accent:#3ddcff;--accent2:#568cff;--good:#55eebd;--shadow:0 12px 46px rgba(0,0,0,.36)} +body{background:radial-gradient(ellipse at 78% 0%,rgba(11,70,143,.22),transparent 36%),repeating-linear-gradient(90deg,transparent 0 77px,rgba(34,87,148,.024) 78px 79px),#030913} +.shell{grid-template-columns:284px minmax(0,1fr)} +nav{width:284px;display:flex;flex-direction:column;overflow:hidden;border-right:1px solid rgba(74,168,241,.23);background:linear-gradient(180deg,rgba(5,17,34,.99),rgba(5,12,25,.99));padding:0 12px} +.ogl-brand{flex:0 0 auto;display:flex;gap:10px;align-items:center;padding:23px 10px 15px;margin:0;border-bottom:1px solid rgba(75,157,218,.23)} +.ogl-brand .ogl-logo img{width:56px;height:56px;object-fit:contain;filter:drop-shadow(0 0 12px rgba(56,209,255,.2))} +.ogl-brand .ogl-logo{flex:0 0 61px;width:61px;height:61px;border-radius:12px;display:grid;place-items:center;font-size:14px;box-shadow:0 0 16px rgba(0,220,255,.18);border:1px solid rgba(60,211,252,.3)} +.ogl-brand .brand-copy{min-width:0}.ogl-brand strong{font-size:15px;letter-spacing:-.25px}.ogl-brand span{font-size:9px;letter-spacing:.11em} +.nav-scroll{overflow-y:auto;overscroll-behavior:contain;flex:1;padding:12px 3px 24px;scrollbar-width:thin;scrollbar-color:#24466b transparent} +.navgroup{border-bottom:1px solid rgba(74,140,209,.10);margin-bottom:5px;padding-bottom:7px} +.navgroup summary{cursor:pointer;list-style:none;padding:12px 12px 7px;font-size:10px;font-weight:800;letter-spacing:.125em;text-transform:uppercase;color:#81b2d9;display:flex;justify-content:space-between;align-items:center} +.navgroup summary:after{content:'+';color:#57cfff;font-size:17px;line-height:1}.navgroup[open] summary:after{content:'−'} +.navgroup summary::-webkit-details-marker{display:none} +.navbtn{display:block;width:100%;margin:1px 0;padding:9px 13px;font-size:12px;border-radius:8px;min-height:35px} +.navmeta{position:static;flex:0 0 auto;padding:12px 10px 15px;line-height:1.4;max-height:88px;overflow:hidden;border-top:1px solid rgba(72,167,240,.21)} +main{padding:28px clamp(17px,3vw,52px)} +.page{max-width:1600px} +.hero{background:linear-gradient(110deg,rgba(11,33,68,.94),rgba(6,25,54,.94) 65%,rgba(7,17,39,.93));min-height:146px} +.hero h1{letter-spacing:-.035em;font-size:clamp(26px,2.6vw,37px)} +.section,.card,.ogl-release-card,.ogl-status-card{background:linear-gradient(145deg,rgba(13,28,53,.92),rgba(6,17,34,.97));border:1px solid rgba(73,155,224,.21);box-shadow:0 12px 45px rgba(0,0,0,.21)} +.ogl-overline{font-size:10px;letter-spacing:.17em;color:#50d9ff;font-weight:800} +.ogl-command-bar{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:0 0 17px} +.ogl-command-bar h2{font-size:24px;margin:3px 0}.ogl-command-bar p{color:var(--muted);margin:0} +.ogl-quick-actions{display:flex;flex-wrap:wrap;gap:8px} +.ogl-status-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 19px} +.ogl-status-card{padding:19px 20px;border-radius:13px;display:flex;flex-direction:column;gap:5px;position:relative;overflow:hidden} +.ogl-status-card:before{content:'';position:absolute;left:0;right:0;top:0;height:2px;background:linear-gradient(90deg,#2ee0ff,transparent);opacity:.7} +.ogl-status-card small,.ogl-release-type{font-size:10px;letter-spacing:.11em;font-weight:750;color:#83b9e0} +.ogl-status-card strong{font-size:clamp(16px,1.5vw,23px);color:#e6f9ff;overflow-wrap:anywhere} +.ogl-status-card span{font-size:11px;color:var(--muted)} +.ogl-panel-split{display:grid;grid-template-columns:1fr 1fr;gap:15px} +.ogl-section-flex{display:flex;justify-content:space-between;gap:15px;align-items:start} +.ogl-shortcuts{display:grid;grid-template-columns:1fr 1fr;gap:9px}.ogl-shortcuts button{padding:13px;border:1px solid rgba(79,173,240,.21);background:#081a31;color:#c7edff;text-align:left;border-radius:9px;cursor:pointer}.ogl-shortcuts button:hover{border-color:#42cfff} +.ogl-release-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px} +.ogl-release-card{border-radius:14px;padding:23px;min-height:195px;display:flex;flex-direction:column;gap:12px} +.ogl-release-card strong{font-size:25px;overflow-wrap:anywhere} +.ogl-release-card p{margin:0;color:var(--muted);flex:1;overflow-wrap:anywhere} +.ogl-release-card a{color:#75ddff;font-size:12px} +.ogl-mini-status{border:1px solid rgba(81,149,213,.2);padding:12px;margin:10px 0;border-radius:9px;background:rgba(7,20,42,.6);color:#a5c9e4;overflow-wrap:anywhere} +.ogl-workspace-tools{display:flex;gap:15px;align-items:center;margin:15px 0}.ogl-workspace-tools input{flex:1;min-width:0}.ogl-workspace-tools span{color:var(--muted);white-space:nowrap} +.ogl-operation-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px} +.ogl-opcard{display:flex;flex-direction:column;gap:9px;align-items:start;border:1px solid rgba(72,148,219,.25);background:rgba(4,17,37,.66);border-radius:10px;padding:15px;color:var(--text);text-align:left;cursor:pointer;overflow-wrap:anywhere} +.ogl-opcard:hover,.ogl-opcard:focus-visible{border-color:#33c8ff;background:rgba(13,53,90,.5)} +.ogl-opcard small{font-size:11px;color:var(--muted)}.ogl-opcard code{font-size:11px;white-space:normal} +.ogl-opbadge{font-size:10px;font-weight:850;padding:3px 7px;border-radius:5px;background:#1b4262;color:#b9f4ff} +.ogl-opbadge.write{background:#4b351d;color:#ffce80} +.ogl-status-ok{color:#52e3ac}.ogl-status-error{color:#ff9797} +#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}}
-
+
MISSION CONTROL · LIVE GRID

Systemübersicht

Reale API-Werte, veröffentlichte Releases und Verwaltungszugriffe auf einen Blick.

+
+
GITHUB STABLE · veröffentlichtPrüfe GitHub…Release-Kanal
+
GITHUB DEVELOPMENT · mainPrüfe Branch…Build-Stand
+
CI / GITHUB ACTIONSPrüfe CI…Letzter main-Lauf
+
EINWOHNER REGISTRIERT–World-Statistik
+
AVATARE ONLINE–Aktuelle Sessions
+
API-OPERATIONEN–OpenAPI-Vertrag
+
+

Repository & Releases

Autoritativ aus GitHub; bei Fehlern keine erfundenen Versionen.

GitHub-Abfrage steht aus.

Direktzugriff

Jede Aktion verwendet den bestehenden, berechtigten World-API-Vertrag.

OGL LIVESERVER & WORLD APIOpenGenesisLINK · Status wird geladen
SystemstatusAKTUELLE SERVERDATEN
@@ -246,6 +327,59 @@ main:before {content:"";position:fixed;inset:0;pointer-events:none;opacity:.17;z +
+
GITHUB · OPEN SOURCE / RELEASE CONTROL

Repository & Versionen

Stable ist der neueste veröffentlichte Nicht-Prerelease-GitHub-Release. Development basiert auf main, nicht auf einer behaupteten Stable-Freigabe.

Noch nicht geladen
+
+
STABLE · GITHUB RELEASE–

Noch nicht geladen

GitHub-Releases ansehen
+
DEVELOPMENT · MAIN–

Noch nicht geladen

Commits ansehen
+
CI · MAIN–

Noch nicht geladen

Actions ansehen
+
+

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“.

+
+
+
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…
+
+
+
OGL CONTROL PLANE · GROUPS

Gruppen & Rollen

Gruppenprofile, Mitglieder, Einladungen, Rechte, Gruppenland und Finanzen.

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…
+
+
+
OGL CONTROL PLANE · INVENTORY

Inventar & Assets

Eigentümerbezogenes Inventar, Medien-Assets und geschützte Bestandsoperationen.

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…
+
+
+
OGL CONTROL PLANE · PROFILES

Profile & Media

Avatarprofile, Profilbilder, First-Life und sichere Media-Verwaltung.

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…
+
+
+
OGL CONTROL PLANE · ECONOMY

Economy / NV$

Banking, Zahlungen, Wallets, Verkäufe und Ledger-/Revisionsprozesse.

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…
+
+
+
OGL CONTROL PLANE · MARKETPLACE

Marketplace & Medien

Veröffentlichte Bilder, Publisher-Scopes, Media-Bindungen und Katalog-Schnittstellen.

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…
+
+
+
OGL CONTROL PLANE · DISCOVERY

Orte, Events & Suche

Suche, Destination Guide, Places, Events und Community-Discovery.

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…
+
+
+
OGL CONTROL PLANE · EXPERIENCES

Experiences

Verwaltung und Berechtigungen der vorhandenen Experiences-API.

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…
+
+
+
OGL CONTROL PLANE · SECURITY

Sicherheit & Audit

Audithistorie, Benutzer-Sicherheit, Rollen und autorisierte Schutzfunktionen.

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…
+
+
+
OGL CONTROL PLANE · ESTATES

Estates & Land

Regions- und Estate-Konfiguration, Parzellen und Gruppenzuordnung.

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…
+
+
+
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…
+
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.

@@ -646,7 +780,7 @@ Archivprüfungen bleiben auch für freigegebene Importe aktiv.

4. Vorhandene API-Schlüssel verwalten

Bestehende Schlüssel lassen sich jetzt um Berechtigungen wie statistics:read erweitern, ohne ihren Schlüsselwert auszutauschen. Klicke beim gewünschten Schlüssel auf Berechtigungen bearbeiten. Die Liste zeigt nur zulässige Maschinen-Scopes; admin:* und interaktive Scopes bleiben gesperrt. Es erscheinen ausschließlich ID, Name, Scopes und letzte Nutzung, niemals geheime Werte.

-
+
Als Administrator anmelden, dann Schlüsselbestand laden.

Scope-Änderungen gelten ab der nächsten API-Authentifizierung mit dem gleichen Schlüssel. Der vollständige Secret-Wert wird nicht erneut angezeigt. Die Bearbeitung sowie Aktivierung, Deaktivierung und Löschung verlangen Administratorrechte und werden protokolliert. Für dauerhafte Löschung zuerst deaktivieren.

@@ -795,14 +929,120 @@ function categoryLabel(value){return categoryLabels[value]||value||''} function audienceLabel(value){return audienceLabels[value]||value||''} function languageLabel(value){return languageLabels[value]||value||''} + +/* OpenGenesisLINK modular dashboard and category workspaces */ +const oglWorkspaceGroups={"users":["/api/v1/users","/api/v1/auth"],"groups":["/api/v1/groups"],"inventory":["/api/v1/inventory","/api/v1/media/assets","/api/v1/media/inventory"],"profiles":["/api/v1/profiles","/api/v1/media/profiles","/api/v1/media/uploads"],"economy":["/api/v1/economy","/api/v1/banking","/api/v1/commerce","/api/v1/groups/{groupId}/transactions"],"marketplace":["/api/v1/media/marketplace","/api/v1/media/uploads","/api/v1/media/assets"],"discovery":["/api/v1/discovery","/api/v1/search","/api/v1/events","/api/v1/places"],"experiences":["/api/v1/experiences"],"security":["/api/v1/audit","/api/v1/security","/api/v1/auth/api-keys","/api/v1/feature-control"],"estates":["/api/v1/estates","/api/v1/regions","/api/v1/grid","/api/v1/groups/{groupId}/land"],"console":["/api/v1/jobs","/api/v1/nodes","/api/v1/regions","/api/v1/feature-control","/api/v1/maintenance","/api/v1/backup","/api/v1/oar","/api/v1/iar"]}; +let oglGitCache=null,oglGitLoadedAt=0,oglGitPending=null; +function oglWorkspaceOpen(entry){ + showPage('explorer'); + endpointAudience='all'; + document.querySelectorAll('[data-endpoint-audience]').forEach(x=>x.classList.toggle('active',x.dataset.endpointAudience==='all')); + $('search').value=''; + selectEntry(entry); + $('detail').scrollIntoView({behavior:'smooth',block:'start'}); +} +function oglRenderWorkspaces(){ + for(const [domain,prefixes] of Object.entries(oglWorkspaceGroups)){ + const host=$('workspace-'+domain);if(!host)continue; + host.replaceChildren(); + const search=document.querySelector('[data-workspace-search="'+domain+'"]'); + const q=(search?.value||'').trim().toLowerCase(); + const matches=entries.filter(x=>prefixes.some(p=>x.path.startsWith(p))).filter(x=> + !q||[x.method,x.path,x.op.summary||'',x.op['x-nexverse-scope']||''].join(' ').toLowerCase().includes(q)); + $('workspace-count-'+domain).textContent=matches.length+' Operationen'; + if(!matches.length){ + const empty=document.createElement('div');empty.className='empty'; + empty.textContent=q?'Keine passenden Operationen.':'Der laufende Server stellt für diese Kategorie derzeit keine passende API-Operation bereit.'; + host.append(empty);continue; + } + for(const entry of matches){ + const b=document.createElement('button');b.type='button';b.className='ogl-opcard'; + const badge=document.createElement('span');badge.className='ogl-opbadge'+(entry.method!=='GET'?' write':'');badge.textContent=entry.method; + 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); + } + } +} +document.querySelectorAll('[data-workspace-search]').forEach(input=>input.addEventListener('input',oglRenderWorkspaces)); +function oglGithubText(id,text){const element=$(id);if(element)element.textContent=String(text||'–')} +async function oglLoadGithub(force=false){ + if(oglGitPending)return oglGitPending; + if(!force&&oglGitCache&&Date.now()-oglGitLoadedAt<300000){oglRenderGithub(oglGitCache);return} + oglGithubText('githubState','Prüfe GitHub…'); + oglGitPending=(async()=>{ + try{ + const response=await fetch('/api/v1/repository/status',{cache:'no-store',credentials:'same-origin',headers:{Accept:'application/json'}}); + if(!response.ok)throw Error('World-API Repository-Status HTTP '+response.status); + const data=await response.json(); + if(!data||data.source!=='github'||!Array.isArray(data.fail))throw Error('Ungültige GitHub-Statusantwort'); + oglGitCache=data;oglGitLoadedAt=Date.now(); + oglRenderGithub(data); + }catch(error){ + if(oglGitCache){ + oglRenderGithub(oglGitCache); + oglGithubText('githubState','Zwischengespeicherter Status (GitHub derzeit nicht erreichbar)'); + }else{ + oglGithubText('githubState','GitHub nicht erreichbar'); + if($('githubDot'))$('githubDot').className='dot bad'; + for(const id of ['githubStableVersion','githubDevelopmentVersion','githubCiVersion', + 'dashStable','dashDevelopment','dashWorkflow'])oglGithubText(id,'Nicht verfügbar'); + oglGithubText('dashboardRepository','Repository-Status konnte nicht geladen werden. Keine Versionsnummer wird geraten.'); + } + } + })().finally(()=>{oglGitPending=null}); + return oglGitPending; +} +function oglRenderGithub(d){ + const release=d.release,commit=d.commit,run=d.ci?.workflow_runs?.[0]; + const stable=release?.tag_name||'Nicht verfügbar'; + const dev=commit?.sha?'main · '+commit.sha.slice(0,8):'Nicht verfügbar'; + const roadmap=spec?.['x_nexverse_roadmap']; + const current=String(roadmap?.current_milestone||''); + const planned=(roadmap?.milestones||[]).filter(x=>x.status==='planned'&&String(x.version)>current) + .sort((x,y)=>String(x.version).localeCompare(String(y.version),undefined,{numeric:true}))[0]; + const devLabel=planned?.version?planned.version+' · geplant':dev; + const ci=run?(run.conclusion||run.status||'unbekannt'):'Nicht verfügbar'; + oglGithubText('githubStableVersion',stable); + oglGithubText('dashStable',stable); + oglGithubText('dashStableMeta',release?.published_at?'Veröffentlicht '+new Date(release.published_at).toLocaleDateString('de-DE'):'Release-API nicht verfügbar'); + oglGithubText('githubStableInfo',release?.name||'Kein bestätigter Release-Status. Keine Version wird geraten.'); + oglGithubText('githubDevelopmentVersion',devLabel); + oglGithubText('dashDevelopment',devLabel); + oglGithubText('dashDevelopmentMeta',commit?'main '+commit.sha.slice(0,8)+' · kein Release':'Branch-Status nicht verfügbar'); + oglGithubText('githubDevelopmentInfo',commit?.commit?.message?.split('\n')[0]||'Letzter main-Commit nicht abrufbar.'); + oglGithubText('githubLastCommit',commit?'Letzter Entwicklungscommit: '+commit.sha+' · '+(commit.commit?.author?.date||'Zeit unbekannt'):'GitHub-main ist derzeit nicht erreichbar.'); + oglGithubText('githubCiVersion',ci); + oglGithubText('dashWorkflow',ci); + oglGithubText('dashWorkflowMeta',run?'Lauf #'+run.run_number:'CI-Status unbekannt'); + oglGithubText('githubCiInfo',run?'Workflow: '+run.name+' · '+(run.head_sha||'').slice(0,8):'Kein bestätigter CI-Lauf gefunden.'); + oglGithubText('githubReleaseNotes',release?.body?'Release: '+String(release.body).slice(0,460):'Keine Release-Notizen aus GitHub verfügbar.'); + oglGithubText('githubUpdated','Stand '+new Date(d.at).toLocaleString('de-DE')+' · '+(d.fail.length?'Teilweise nicht erreichbar (HTTP-/Netzwerkfehler)':'GitHub REST API (kein Demo-Wert)')); + oglGithubText('githubState',d.fail.length?'Teilweise nicht erreichbar':'GitHub verbunden'); + if($('githubDot'))$('githubDot').className='dot '+(d.fail.length?'bad':'good'); + oglGithubText('dashboardRepository','Stable '+stable+' | Development '+dev+' | CI '+ci+'. Veröffentlichte GitHub-Version und lokaler ROBUST-Build können sich unterscheiden.'); +} +if($('githubRefresh'))$('githubRefresh').addEventListener('click',()=>oglLoadGithub(true)); +function oglFilterKeys(){ + const needle=($('secretKeySearch')?.value||'').trim().toLowerCase(); + const filter=$('secretKeyState')?.value||'all'; + document.querySelectorAll('#secretKeyList > .change').forEach(card=>{ + const matching=!needle||(card.dataset.keySearch||'').includes(needle); + const active=card.dataset.keyEnabled==='true'; + card.hidden=!(matching&&(filter==='all'||(filter==='active'&&active)||(filter==='disabled'&&!active))); + }); +} function showPage(name){ - if(['secrets','nodes','grid'].includes(name)&&!adminIsActive()){ + if(['secrets','nodes','grid','security','console'].includes(name)&&!adminIsActive()){ adminNextPage=name; name='adminlogin'; adminUpdateStatus('Anmeldung mit UserLevel >= 200 erforderlich.',null); } 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)); + 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(oglWorkspaceGroups[name])oglRenderWorkspaces(); window.scrollTo({top:0,behavior:'smooth'}); } document.querySelectorAll('.navbtn').forEach(x=>x.addEventListener('click',()=>showPage(x.dataset.page))); @@ -992,6 +1232,8 @@ function renderStatistics(data){ const residents=data.residents||{},hg=data.hypergrid||{},online=data.online||{}; const protectedDetails=data.protected_details===true; statText('statRegistered',residents.registered_total); + oglGithubText('dashResidents',residents.registered_total==null?'–':residents.registered_total); + oglGithubText('dashOnline',online.total==null?'–':online.total); statText('statOnlineTotal',online.total); statText('statResidentsOnline',residents.online_now); statText('statActive7',residents.active_last_7_days); @@ -1893,7 +2135,8 @@ function secretRenderKeyInventory(keys, supportedScopes) { $('secretListStatus').textContent=keys.length+' Schlüssel registriert. '+ duplicates+' aktive Duplikatgruppe(n) gefunden. Kein Schlüssel wurde automatisch verändert.'; for(const key of keys){ - const card=document.createElement('div');card.className='change'; + const card=document.createElement('div');card.className='change';card.dataset.keyEnabled=key.enabled?'true':'false'; + card.dataset.keySearch=[key.name||'',key.key_id||'',...(key.scopes||[])].join(' ').toLowerCase(); const title=document.createElement('strong'); title.textContent=(key.name||'Unbenannt')+(key.enabled?' · Aktiv':' · Deaktiviert'); card.append(title); @@ -1967,6 +2210,7 @@ function secretRenderKeyInventory(keys, supportedScopes) { card.append(editor); host.append(card); } + oglFilterKeys(); } async function secretEditKeyScopes(key,scopes) { try{ @@ -2242,7 +2486,8 @@ async function init(){ $('navmeta').textContent=(version.server_version||'OpenGenesisLINK')+' · '+(version.api_version||'API')+' · '+languageLabel(version.language||spec['x_nexverse_language']||'de-DE'); if(changes.length){$('lastChangeDate').textContent=changes[0].date||'–';$('lastChangeTitle').textContent=changes[0].title||''} const overview=$('overviewChanges');overview.replaceChildren();changes.slice(0,4).forEach(x=>overview.append(makeChange(x)));if(!changes.length)overview.innerHTML='
Noch keine Versionshinweise veröffentlicht.
'; - renderChangeFilters();renderChanges('all');renderVersions();renderRoadmap();renderEndpointList(); + renderChangeFilters();renderChanges('all');renderVersions();renderRoadmap();renderEndpointList();oglRenderWorkspaces();oglLoadGithub(); + oglGithubText('dashOperations',entries.length); loadStatistics(); }catch(err){ $('healthText').textContent='API-Metadaten konnten nicht geladen werden';$('healthDot').className='dot bad';$('navmeta').textContent=String(err); @@ -2259,6 +2504,8 @@ $('secretGeneratePortalIm').addEventListener('click',secretGeneratePortalIm); $('secretCopy').addEventListener('click',secretCopy); $('secretClear').addEventListener('click',secretClear); $('secretLoadKeys').addEventListener('click',secretLoadKeys); +$('secretKeySearch').addEventListener('input',oglFilterKeys); +$('secretKeyState').addEventListener('change',oglFilterKeys); $('worldAuthUseMe').addEventListener('click',worldAuthUseMe); $('worldAuthLoad').addEventListener('click',worldAuthLoad); $('worldAuthSave').addEventListener('click',worldAuthSave); @@ -2293,6 +2540,6 @@ init(); -"""; +""".Replace("OGL_LOGO_DATA_URI", NexOglBranding.DataUri); } } diff --git a/NexVerse/Server/Api/NexChatGptInstructionDownloads.cs b/NexVerse/Server/Api/NexChatGptInstructionDownloads.cs index 58fe579c..bedd3cdb 100644 --- a/NexVerse/Server/Api/NexChatGptInstructionDownloads.cs +++ b/NexVerse/Server/Api/NexChatGptInstructionDownloads.cs @@ -529,6 +529,8 @@ namespace NexVerse.Server.Api "/api/v1/search"); AppendCatalogGroup(md, requestedAudience, "public", "version", "/api/v1/version"); + AppendCatalogGroup(md, requestedAudience, "public", "OpenGenesisLINK GitHub Stable/Development/CI Status", + "/api/v1/repository/status"); AppendCatalogGroup(md, requestedAudience, "public", "Oeffentliche Weltkarte", "/api/v1/world-map", "/api/v1/world-map/view"); diff --git a/NexVerse/Server/Api/NexGithubRepositoryStatusApi.cs b/NexVerse/Server/Api/NexGithubRepositoryStatusApi.cs new file mode 100644 index 00000000..2720fbaa --- /dev/null +++ b/NexVerse/Server/Api/NexGithubRepositoryStatusApi.cs @@ -0,0 +1,196 @@ +// SPDX-License-Identifier: MPL-2.0 +// Source-of-truth GitHub release/commit/CI metadata, with bounded cache. +// No credentials, shell execution, or operator-defined remote URLs. +using System; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using OpenSim.Framework.Servers.HttpServer; + +namespace NexVerse.Server.Api +{ + internal sealed class NexGithubRepositoryStatusApi + { + private const string Base = "https://api.github.com/repos/opengenesislink/opengenesislinkserver"; + private static readonly HttpClient s_Client = CreateClient(); + private static readonly SemaphoreSlim s_Refresh = new SemaphoreSlim(1, 1); + private static byte[] s_Cached; + private static DateTimeOffset s_LastFetch = DateTimeOffset.MinValue; + + private static HttpClient CreateClient() + { + var client = new HttpClient { Timeout = TimeSpan.FromSeconds(6) }; + client.DefaultRequestHeaders.UserAgent.ParseAdd("OpenGenesisLINK-WorldAPI/1.0"); + client.DefaultRequestHeaders.Accept.Add( + new MediaTypeWithQualityHeaderValue("application/vnd.github+json")); + return client; + } + + public void Handle(IOSHttpRequest request, IOSHttpResponse response) + { + response.KeepAlive = false; + response.AddHeader("Cache-Control", "private, no-store"); + response.AddHeader("X-Content-Type-Options", "nosniff"); + response.ContentType = "application/json; charset=utf-8"; + + if (request == null || request.HttpMethod != "GET" || + (request.UriPath ?? "").TrimEnd('/') != "/api/v1/repository/status") + { + response.StatusCode = (int)HttpStatusCode.MethodNotAllowed; + response.RawBuffer = JsonSerializer.SerializeToUtf8Bytes( + new { error = "method_not_allowed" }); + return; + } + + // The short, process-local cache prevents 60/h anonymous GitHub API + // rate-limit exhaustion and avoids any database writes. + try + { + if (s_Cached != null && + DateTimeOffset.UtcNow - s_LastFetch < TimeSpan.FromMinutes(5)) + { + response.StatusCode = (int)HttpStatusCode.OK; + response.RawBuffer = s_Cached; + return; + } + + if (!s_Refresh.Wait(TimeSpan.FromSeconds(8))) + { + WriteFallback(response); + return; + } + try + { + if (s_Cached == null || + DateTimeOffset.UtcNow - s_LastFetch >= TimeSpan.FromMinutes(5)) + { + var payload = FetchStatus().GetAwaiter().GetResult(); + if (payload != null) + { + s_Cached = payload; + s_LastFetch = DateTimeOffset.UtcNow; + } + } + WriteFallback(response); + } + finally { s_Refresh.Release(); } + } + catch (Exception) + { + // GitHub is an external dependency. Never expose credentials, + // stack traces, HTML proxy errors or fabricated release tags. + WriteFallback(response); + } + } + + private static void WriteFallback(IOSHttpResponse response) + { + if (s_Cached != null) + { + response.StatusCode = (int)HttpStatusCode.OK; + response.RawBuffer = s_Cached; + } + else + { + response.StatusCode = (int)HttpStatusCode.ServiceUnavailable; + response.RawBuffer = JsonSerializer.SerializeToUtf8Bytes( + new { error = "github_unavailable", + source = "https://github.com/opengenesislink/opengenesislinkserver" }); + } + } + + private static async Task Read(string url) + { + // A fixed URL set only. No request parameters or redirect to + // an attacker-supplied domain. GitHub metadata is public. + try + { + using HttpResponseMessage response = await s_Client.GetAsync(url, + HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false); + if (!response.IsSuccessStatusCode) return null; + byte[] bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + if (bytes.Length > 512 * 1024) return null; + using JsonDocument document = JsonDocument.Parse(bytes); + return document.RootElement.Clone(); + } + catch (Exception) { return null; } + } + + private static string String(JsonElement? root, params string[] path) + { + if (!root.HasValue) return null; + JsonElement value = root.Value; + foreach (string name in path) + { + if (value.ValueKind != JsonValueKind.Object || + !value.TryGetProperty(name, out value)) return null; + } + return value.ValueKind == JsonValueKind.String ? value.GetString() : + value.ValueKind == JsonValueKind.Number ? value.ToString() : null; + } + + private static async Task FetchStatus() + { + var result = await Task.WhenAll( + Read(Base + "/releases/latest"), + Read(Base + "/commits/main"), + Read(Base + "/actions/workflows/nexjast-ci.yml/runs?branch=main&per_page=1") + ).ConfigureAwait(false); + + JsonElement? release = result[0], commit = result[1], runs = result[2]; + JsonElement? lastRun = null; + if (runs.HasValue && + runs.Value.TryGetProperty("workflow_runs", out JsonElement list) && + list.ValueKind == JsonValueKind.Array && list.GetArrayLength() != 0) + lastRun = list[0]; + + if (!release.HasValue && !commit.HasValue && !runs.HasValue) + return null; + + object stable = release.HasValue ? new + { + tag_name = String(release, "tag_name"), + name = String(release, "name"), + published_at = String(release, "published_at"), + body = String(release, "body") + } : null; + object development = commit.HasValue ? new + { + sha = String(commit, "sha"), + commit = new { + message = String(commit, "commit", "message"), + author = new { date = String(commit, "commit", "author", "date") } + } + } : null; + object ci = runs.HasValue ? new + { + workflow_runs = lastRun.HasValue ? new object[] {new + { + run_number = String(lastRun, "run_number"), + name = String(lastRun, "name"), + head_sha = String(lastRun, "head_sha"), + status = String(lastRun, "status"), + conclusion = String(lastRun, "conclusion") + }} : Array.Empty() + } : null; + + return JsonSerializer.SerializeToUtf8Bytes(new + { + source = "github", + release = stable, + commit = development, + ci, + fail = new[] { !release.HasValue ? 0 : -1, + !commit.HasValue ? 1 : -1, + !runs.HasValue ? 2 : -1 } + .Where(x => x >= 0).ToArray(), + at = DateTimeOffset.UtcNow.ToString("O") + }); + } + } +} diff --git a/NexVerse/Server/Api/NexOglBranding.cs b/NexVerse/Server/Api/NexOglBranding.cs new file mode 100644 index 00000000..1ae266bb --- /dev/null +++ b/NexVerse/Server/Api/NexOglBranding.cs @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: MPL-2.0 +namespace NexVerse.Server.Api +{ + internal static class NexOglBranding + { + // Downsampled version of the operator-provided World API logo (56px WebP, transparent). + internal const string DataUri = "data:image/webp;base64,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"; + } +} diff --git a/NexVerse/Server/Api/NexVerseWorldApiConnector.cs b/NexVerse/Server/Api/NexVerseWorldApiConnector.cs index 21c2230a..98181c67 100644 --- a/NexVerse/Server/Api/NexVerseWorldApiConnector.cs +++ b/NexVerse/Server/Api/NexVerseWorldApiConnector.cs @@ -324,6 +324,12 @@ namespace NexVerse.Server.Api m_Log.Info("[NEX-WORLD-API]: Endpunkt für Statistikübersicht registriert."); server.AddSimpleStreamHandler(new SimpleStreamHandler("/api/v1/version", apiGate.Wrap(handlers.Version), "NexVerse World API Version")); + // GitHub is queried server-side because the protected admin iframe + // inherits the login shell's restrictive same-origin CSP. + NexGithubRepositoryStatusApi githubStatus = new NexGithubRepositoryStatusApi(); + server.AddSimpleStreamHandler(new SimpleStreamHandler( + "/api/v1/repository/status", apiGate.Wrap(githubStatus.Handle), + "OpenGenesisLINK public GitHub releases and CI status")); server.AddSimpleStreamHandler(new SimpleStreamHandler("/api/v1/capabilities", apiGate.Wrap(handlers.Capabilities), "NexVerse World API Capabilities")); server.AddSimpleStreamHandler(new SimpleStreamHandler("/api/v1/openapi.json", apiGate.Wrap(handlers.OpenApi), "NexVerse World API OpenAPI")); diff --git a/NexVerse/Server/Api/NexVerseWorldApiHandlers.cs b/NexVerse/Server/Api/NexVerseWorldApiHandlers.cs index 568a2910..ae6c8f40 100644 --- a/NexVerse/Server/Api/NexVerseWorldApiHandlers.cs +++ b/NexVerse/Server/Api/NexVerseWorldApiHandlers.cs @@ -135,6 +135,7 @@ namespace NexVerse.Server.Api ["/api/v1"] = GetOperation("Metadaten des World-API-Dienstes"), ["/api/v1/health"] = GetOperation("Status der World API"), ["/api/v1/version"] = GetOperation("NexVerse-Server- und Protokollversionen"), + ["/api/v1/repository/status"] = GetOperation("Autoritative GitHub-Releases, Entwicklungsstand main und letzter CI-Lauf; gecacht, ohne Secrets"), ["/api/v1/capabilities"] = GetOperation("NexVerse-Funktions- und Kompatibilitätsstufen"), ["/api/v1/openapi.json"] = GetOperation("OpenAPI-Dokument"), ["/api/v1/docs"] = GetOperation("Selbst gehostete, durchsuchbare API-Dokumentation mit Live-Explorer"), diff --git a/NexVerse/Server/Api/OglApiDocsAccess.cs b/NexVerse/Server/Api/OglApiDocsAccess.cs index fccbc3f9..708992b1 100644 --- a/NexVerse/Server/Api/OglApiDocsAccess.cs +++ b/NexVerse/Server/Api/OglApiDocsAccess.cs @@ -181,7 +181,7 @@ namespace NexVerse.Server.Api : "OpenGenesisLINK: Adminpanel nicht verfügbar."); } - private const string s_LoginPage = """ + private static readonly string s_LoginPage = """ @@ -217,7 +217,7 @@ label{display:block;color:#d3deed;font-size:12px;margin:18px 0 8px;font-weight:6
-
OGL
OpenGenesisLINKWorld API · Control Center
Secure administration / OGL 0.9.3.12
+
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
@@ -290,6 +290,6 @@ form.addEventListener('submit',async event=>{ -"""; +""".Replace("OGL_LOGO_DATA_URI", NexOglBranding.DataUri); } } diff --git a/doc/OpenGenesisLINK/WORLD_API_SCIFI_CONTROL_CENTER_2.md b/doc/OpenGenesisLINK/WORLD_API_SCIFI_CONTROL_CENTER_2.md new file mode 100644 index 00000000..17998b71 --- /dev/null +++ b/doc/OpenGenesisLINK/WORLD_API_SCIFI_CONTROL_CENTER_2.md @@ -0,0 +1,48 @@ +# OpenGenesisLINK World API – Sci-Fi Control Center 2.0 + +Stand: 25.10.2026. **Ein echtes Redesign der vorhandenen geschützten World-API-Verwaltung, kein separater Mockup-Prototyp.** + +## Zugriff und Branding + +`GET /api/v1/docs` bleibt die abgesicherte Admin-Anmeldeseite. Die eigentliche Oberfläche wird nur nach lokaler GridUser-Anmeldung mit UserLevel mindestens 200 und einer signierten Session aus `GET /api/v1/docs/panel` geladen. Der vorhandene Login-, TOTP-, Logout- und API-/Node-Autorisierungsweg wird **nicht ersetzt**. + +Das vom Betreiber gelieferte `OpenGenesisLINK World API`-Logo wurde als WebP auf 56×56 px optimiert und in `NexOglBranding.cs` eingebettet. Kein externer Bildhost und kein nachgeneriertes Bild. Dieselbe Grafik erscheint im Login und in der Control-Center-Sidebar. + +## Navigationsstruktur + +Die Sidebar besitzt aufklappbare Hauptgruppen mit sinnvollen Unterseiten: + +- **Übersicht & Monitoring:** Dashboard, Statistik, Diagnose, GitHub & Releases +- **Grid & Simulatoren:** Grid-/Regionenplaner, Simulator-Nodes, Estates/Land, Konsole & Jobs +- **Einwohner & Communities:** Benutzer/Avatare, Gruppen, Inventar/Assets, Profile/Media +- **Wirtschaft & Content:** Economy/NV$, Marketplace/Medien, Orte/Events/Suche, Experiences +- **API & Sicherheit:** API-Schlüssel/Scopes, Sicherheit/Audit, API-Explorer, Integrationen, Admin-Anmeldung +- **Software & Planung:** Changelog, Versionen, Roadmap + +Jede Fach-Unterseite zeigt **tatsächlich registrierte Endpunkte und HTTP-Methoden** des zur Laufzeit geladenen OpenAPI-Vertrags. Die gefilterten Operationen öffnen den bestehenden echten API-Explorer mit authentifizierter Anfrageausführung. Nicht verfügbare Endpunkte werden ausdrücklich als nicht verfügbar dargestellt, nicht als Mockdaten. Native Grid-/Node-/Estate-Lifecycle-Aktionen verbleiben in ihren etablierten Verwaltungsseiten; keine bestehende Funktion wird entfernt. + +## GitHub-Versionierung + +Neue GitHub-/Release-Seite plus drei prominente Dashboard-Kacheln. Aus **offiziellen GitHub-REST-Daten**: + +1. `/repos/opengenesislink/opengenesislinkserver/releases/latest`: der neueste veröffentlichte, nicht vorab veröffentlichte Stable-Release. **Keine aus dem Versionsstring erratene Stable-Freigabe**. +2. `/repos/opengenesislink/opengenesislinkserver/commits/main`: Development-Branch mit gekürzter SHA und aktuellem Committext. Ein Branch ist keine Release-Freigabe. +3. `/repos/opengenesislink/opengenesislinkserver/actions/workflows/nexjast-ci.yml/runs?branch=main&per_page=1`: der letzte main-CI-Lauf, mit Ergebnis oder laufendem Status. + +GitHub-Abfragen werden **serverseitig** durch den neuen World-Endpunkt `GET /api/v1/repository/status` ausgeführt: ein fest konfigurierter öffentlicher Repository-Host, keine API-Schlüssel, kein Browser-Zugriff auf `api.github.com`. Der ROBUST-Prozess hält die Ergebnisse fünf Minuten zwischengespeichert. Die geschützte Admin-Oberfläche liest ausschließlich den **Same-Origin-World-API-Endpunkt**, damit die restriktive `connect-src 'self'`-Policy von Adminpanel und Login-Frame unverändert bleiben kann. Nicht erreichbare GitHub-API oder Rate-Limit-Fehler werden als **nicht verfügbar** beziehungsweise explizit zwischengespeichert angezeigt; es werden **keine** Release-Tags, Commits, CI-Werte oder Installationsstände erfunden. + +**Wichtig:** Die GitHub-Stable-Version ist nicht zwingend die installierte Version auf ROBUST. Für die aktuell laufende Serverversion bleibt `GET /api/v1/version` die Quelle. Das Dashboard zeigt diese unabhängig. + +## Administrator-Funktionen + +- Einheitliches dunkles Design mit leuchtendem Cyan/Blau, responsive Sidebar und kompakten Dienstkacheln. +- Echtzeit-Kennzahlen zu registrierten Einwohnern und Online-Sessions aus `/api/v1/statistics/summary`, Servicezustand aus `/api/v1/health` und Endpoint-Zahl aus `/api/v1/openapi.json`. +- Bessere API-Schlüsselliste: durchsuchbar nach ID/Name/Scope und filterbar nach aktiv/deaktiviert; bestehende Funktionen zum Erstellen, Ändern, Deaktivieren, Löschen und zum Generieren sicherer Secrets bleiben erhalten. +- Fachseiten für Inventar, Gruppen, User, NV$, Media, Sicherheit, Marketplace, Jobs und weitere Bereiche sind keine unabhängigen zweiten APIs. Sie benutzen den zentralen OpenAPI-Vertrag, dessen Scopes und den bestehenden Request-Runner. +- **Kein unbeschränkter Shell- oder OpenSim-Konsolen-Remote-Executor.** Nur tatsächlich vorhandene, serverseitig berechtigte Operationen erscheinen. Für bisher ausschließlich via Textkonsole angebotene Befehle (z. B. freie Asset-Löschbefehle, dynamische Script-Konsole, beliebige Shell) gibt es noch keinen sicheren, explizit autorisierten HTTP-Handler. Sie werden nicht als funktionierend ausgegeben und nicht durch ungefilterte Remote-Commands ersetzt. Das ist eine Sicherheitsgrenze, kein UI-Dummy. + +## QA / Release + +In der NexVerse CI läuft `verify_worldapi_scifi_admin_center.py`. Zusätzlich zu bestehenden API-, Login-, Schlüssel-, Grid- und Estate-Regressionen werden die Logo-Einbettung, Navigations-IDs, Release-Quellen, Zugriffsschutz, Datenquellen und die Syntax des **tatsächlichen** Browser-JavaScript mit Node überprüft. + +Vor Produktionsübernahme: GitHub-API-Zugriff unter KeyHelp-/Apache-HTTPS und CSP prüfen, alle Unterseiten (mobil/desktop) bedienen, Keys/Scopes nur mit autorisiertem Administrator testen, Node/Region/Estates mit Staging-Datensatz testen. GitHub-Release-Status darf nie die lokale Build-Abnahme ersetzen. Code-Merge ist **kein Live-Deployment**. diff --git a/tools/ci/verify_worldapi_scifi_admin_center.py b/tools/ci/verify_worldapi_scifi_admin_center.py new file mode 100644 index 00000000..bf67e9ee --- /dev/null +++ b/tools/ci/verify_worldapi_scifi_admin_center.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +"""Fail-closed checks for sci-fi protected World API admin center.""" +from pathlib import Path +import base64, re, subprocess, shutil, tempfile + +root=Path(__file__).resolve().parents[2] +page=(root/"NexVerse/Server/Api/NexApiDocsPage.cs").read_text() +login=(root/"NexVerse/Server/Api/OglApiDocsAccess.cs").read_text() +branding=(root/"NexVerse/Server/Api/NexOglBranding.cs").read_text() +assert "private static readonly string s_Html" in page +assert "private static readonly string s_LoginPage" in login +assert "NexOglBranding.DataUri" in page and "NexOglBranding.DataUri" in login +assert "OGL_LOGO_DATA_URI" in page and "OGL_LOGO_DATA_URI" in login +image=re.search(r'DataUri\s*=\s*"data:image/webp;base64,([A-Za-z0-9+/=]+)"',branding) +assert image, "Supplied logo must be stored as an inline WebP image" +data=base64.b64decode(image.group(1),validate=True) +assert data[:4]==b"RIFF" and data[8:12]==b"WEBP" and len(data)>2000 +assert "frame-ancestors 'none'" in login +assert "m_Authenticator.TryAuthenticate" in login +assert "UserLevel < MinimumLevel" in login +assert 'adminIsActive()' in page +assert "connect-src 'self'" in page +assert "connect-src 'self' https://api.github.com" not in page +connector=(root/"NexVerse/Server/Api/NexVerseWorldApiConnector.cs").read_text() +github=(root/"NexVerse/Server/Api/NexGithubRepositoryStatusApi.cs").read_text() +openapi=(root/"NexVerse/Server/Api/NexVerseWorldApiHandlers.cs").read_text() +assert '"/api/v1/repository/status"' in connector and 'githubStatus.Handle' in connector +assert '"/api/v1/repository/status"' in openapi +assert "https://api.github.com/repos/opengenesislink/opengenesislinkserver" in github +assert '"/releases/latest"' in github and '"/commits/main"' in github +assert '"/actions/workflows/nexjast-ci.yml/runs?branch=main&per_page=1"' in github +assert "TimeSpan.FromMinutes(5)" in github +assert "JsonSerializer.SerializeToUtf8Bytes" in github +assert "fetch('/api/v1/repository/status'" in page +for name in ["overview","statistics","diagnostics","repository","grid","nodes", + "estates","console","users","groups","inventory","profiles","economy", + "marketplace","discovery","experiences","secrets","security","explorer", + "chatgpt","adminlogin","changes","versions","roadmap"]: + assert 'data-page="'+name+'"' in page,name + assert 'id="page-'+name+'"' in page,name +assert '