mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
Add secure configuration bootstrap flow
This commit is contained in:
@@ -0,0 +1,236 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Nitro Secure Runtime Modes</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
</head>
|
||||
<body class="bg-slate-950 text-slate-100">
|
||||
<div class="mx-auto max-w-6xl px-6 py-10">
|
||||
<div class="mb-8 rounded-3xl border border-cyan-500/20 bg-slate-900/80 p-8 shadow-2xl shadow-cyan-950/30">
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<span class="rounded-full border border-cyan-400/30 bg-cyan-500/10 px-3 py-1 text-xs font-semibold uppercase tracking-[0.25em] text-cyan-300">Nitro V3</span>
|
||||
<span class="rounded-full border border-emerald-400/30 bg-emerald-500/10 px-3 py-1 text-xs font-semibold uppercase tracking-[0.25em] text-emerald-300">Secure Runtime</span>
|
||||
</div>
|
||||
<h1 class="mt-5 text-4xl font-black tracking-tight text-white">Documentazione configurazione runtime</h1>
|
||||
<p class="mt-4 max-w-3xl text-sm leading-7 text-slate-300">
|
||||
Questa pagina riassume in modo ordinato come configurare i toggle runtime, i file example e i parametri lato client / emulatore
|
||||
senza sporcare i componenti in <code class="rounded bg-slate-800 px-1.5 py-0.5 text-cyan-300">src</code>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="grid gap-6 lg:grid-cols-[280px_minmax(0,1fr)]">
|
||||
<aside class="rounded-3xl border border-slate-800 bg-slate-900/70 p-5 lg:sticky lg:top-6 lg:h-fit">
|
||||
<h2 class="mb-4 text-sm font-bold uppercase tracking-[0.2em] text-slate-400">Indice</h2>
|
||||
<nav class="space-y-2 text-sm">
|
||||
<a class="block rounded-xl px-3 py-2 text-slate-300 transition hover:bg-slate-800 hover:text-white" href="#overview">Overview</a>
|
||||
<a class="block rounded-xl px-3 py-2 text-slate-300 transition hover:bg-slate-800 hover:text-white" href="#files">File da usare</a>
|
||||
<a class="block rounded-xl px-3 py-2 text-slate-300 transition hover:bg-slate-800 hover:text-white" href="#client-mode">client-mode</a>
|
||||
<a class="block rounded-xl px-3 py-2 text-slate-300 transition hover:bg-slate-800 hover:text-white" href="#renderer-config">renderer-config</a>
|
||||
<a class="block rounded-xl px-3 py-2 text-slate-300 transition hover:bg-slate-800 hover:text-white" href="#ui-config">ui-config</a>
|
||||
<a class="block rounded-xl px-3 py-2 text-slate-300 transition hover:bg-slate-800 hover:text-white" href="#runtime-code">Codice runtime</a>
|
||||
<a class="block rounded-xl px-3 py-2 text-slate-300 transition hover:bg-slate-800 hover:text-white" href="#emulator">Emulatore</a>
|
||||
<a class="block rounded-xl px-3 py-2 text-slate-300 transition hover:bg-slate-800 hover:text-white" href="#scenarios">Scenari</a>
|
||||
<a class="block rounded-xl px-3 py-2 text-slate-300 transition hover:bg-slate-800 hover:text-white" href="#checklist">Checklist</a>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<main class="space-y-6">
|
||||
<section id="overview" class="rounded-3xl border border-slate-800 bg-slate-900/70 p-8">
|
||||
<h2 class="text-2xl font-bold text-white">Overview</h2>
|
||||
<div class="mt-5 grid gap-4 md:grid-cols-3">
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/70 p-5">
|
||||
<h3 class="text-sm font-semibold uppercase tracking-wide text-cyan-300">Dist Obfuscation</h3>
|
||||
<p class="mt-3 text-sm leading-7 text-slate-300">Sceglie se caricare <code class="rounded bg-slate-800 px-1">app.js/app.css</code> oppure <code class="rounded bg-slate-800 px-1">.dat</code>.</p>
|
||||
</div>
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/70 p-5">
|
||||
<h3 class="text-sm font-semibold uppercase tracking-wide text-emerald-300">Secure Assets</h3>
|
||||
<p class="mt-3 text-sm leading-7 text-slate-300">Controlla se <code class="rounded bg-slate-800 px-1">renderer-config</code>, <code class="rounded bg-slate-800 px-1">ui-config</code> e gamedata passano da <code class="rounded bg-slate-800 px-1">/nitro-sec/file</code>.</p>
|
||||
</div>
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/70 p-5">
|
||||
<h3 class="text-sm font-semibold uppercase tracking-wide text-fuchsia-300">Secure API</h3>
|
||||
<p class="mt-3 text-sm leading-7 text-slate-300">Attiva o disattiva la cifratura runtime automatica su <code class="rounded bg-slate-800 px-1">/api/*</code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="files" class="rounded-3xl border border-slate-800 bg-slate-900/70 p-8">
|
||||
<h2 class="text-2xl font-bold text-white">File da usare</h2>
|
||||
<div class="mt-5 overflow-hidden rounded-2xl border border-slate-800">
|
||||
<table class="min-w-full divide-y divide-slate-800 text-sm">
|
||||
<thead class="bg-slate-950/80">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left font-semibold text-slate-200">File</th>
|
||||
<th class="px-4 py-3 text-left font-semibold text-slate-200">Scopo</th>
|
||||
<th class="px-4 py-3 text-left font-semibold text-slate-200">Nota</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-800">
|
||||
<tr class="bg-slate-900/60">
|
||||
<td class="px-4 py-3"><code>public/configuration/client-mode.example</code></td>
|
||||
<td class="px-4 py-3">Template per i toggle runtime</td>
|
||||
<td class="px-4 py-3 text-slate-300">Da copiare in <code>configuration/client-mode.json</code> nel deploy reale, che resta ignorato da Git</td>
|
||||
</tr>
|
||||
<tr class="bg-slate-950/40">
|
||||
<td class="px-4 py-3"><code>public/configuration/renderer-config.example</code></td>
|
||||
<td class="px-4 py-3">Template sicuro del renderer config</td>
|
||||
<td class="px-4 py-3 text-slate-300">Non tocca il tuo <code>configuration/renderer-config.json</code> locale</td>
|
||||
</tr>
|
||||
<tr class="bg-slate-900/60">
|
||||
<td class="px-4 py-3"><code>public/configuration/ui-config.example</code></td>
|
||||
<td class="px-4 py-3">Template UI config</td>
|
||||
<td class="px-4 py-3 text-slate-300">Da mantenere come riferimento pulito</td>
|
||||
</tr>
|
||||
<tr class="bg-slate-950/40">
|
||||
<td class="px-4 py-3"><code>Latest_Compiled_Version/config.ini.example</code></td>
|
||||
<td class="px-4 py-3">Flag backend secure</td>
|
||||
<td class="px-4 py-3 text-slate-300">Specifica la parte lato emulatore</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="client-mode" class="rounded-3xl border border-slate-800 bg-slate-900/70 p-8">
|
||||
<h2 class="text-2xl font-bold text-white">client-mode.example</h2>
|
||||
<p class="mt-3 text-sm leading-7 text-slate-300">È il punto centrale per attivare o disattivare il comportamento runtime senza dover modificare il codice.</p>
|
||||
<pre class="mt-5 overflow-x-auto rounded-2xl border border-slate-800 bg-slate-950/90 p-5 text-sm text-cyan-300"><code>{
|
||||
"distObfuscationEnabled": true,
|
||||
"secureAssetsEnabled": true,
|
||||
"secureApiEnabled": true,
|
||||
"apiBaseUrl": "https://nitro.example.com:2096",
|
||||
"plainConfigBaseUrl": "https://hotel.example.com/configuration/",
|
||||
"plainGamedataBaseUrl": "https://hotel.example.com/client/nitro/gamedata/"
|
||||
}</code></pre>
|
||||
<div class="mt-5 grid gap-4 md:grid-cols-2">
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/60 p-5">
|
||||
<h3 class="font-semibold text-white">Campi</h3>
|
||||
<ul class="mt-3 space-y-2 text-sm leading-7 text-slate-300">
|
||||
<li><code class="rounded bg-slate-800 px-1">distObfuscationEnabled</code>: usa <code>.dat</code> oppure file plain</li>
|
||||
<li><code class="rounded bg-slate-800 px-1">secureAssetsEnabled</code>: attiva <code>/nitro-sec/file</code></li>
|
||||
<li><code class="rounded bg-slate-800 px-1">secureApiEnabled</code>: cifra le richieste <code>/api/*</code></li>
|
||||
<li><code class="rounded bg-slate-800 px-1">apiBaseUrl</code>: base URL emulatore/API</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="rounded-2xl border border-amber-500/20 bg-amber-500/10 p-5">
|
||||
<h3 class="font-semibold text-amber-200">Suggerimento</h3>
|
||||
<p class="mt-3 text-sm leading-7 text-amber-100/90">Conviene impostare sempre <code>apiBaseUrl</code> in modo esplicito, così non dipendi da fallback impliciti del runtime.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="renderer-config" class="rounded-3xl border border-slate-800 bg-slate-900/70 p-8">
|
||||
<h2 class="text-2xl font-bold text-white">renderer-config.example</h2>
|
||||
<p class="mt-3 text-sm leading-7 text-slate-300">Qui definisci URL di socket, API, asset library e gamedata. Tutti i link pubblici dovrebbero vivere qui, non nei componenti React.</p>
|
||||
<div class="mt-5 grid gap-4 md:grid-cols-2">
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/60 p-5">
|
||||
<h3 class="font-semibold text-white">Chiavi principali</h3>
|
||||
<ul class="mt-3 space-y-2 text-sm leading-7 text-slate-300">
|
||||
<li><code>socket.url</code></li>
|
||||
<li><code>api.url</code></li>
|
||||
<li><code>asset.url</code></li>
|
||||
<li><code>image.library.url</code></li>
|
||||
<li><code>images.url</code></li>
|
||||
<li><code>gamedata.url</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/60 p-5">
|
||||
<h3 class="font-semibold text-white">Traduzioni</h3>
|
||||
<ul class="mt-3 space-y-2 text-sm leading-7 text-slate-300">
|
||||
<li><code>external.texts.translation.url</code></li>
|
||||
<li><code>furnidata.translation.url</code></li>
|
||||
<li>Usano <code>%locale%</code> e <code>%timestamp%</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="ui-config" class="rounded-3xl border border-slate-800 bg-slate-900/70 p-8">
|
||||
<h2 class="text-2xl font-bold text-white">ui-config.example</h2>
|
||||
<p class="mt-3 text-sm leading-7 text-slate-300">Per la login view e altre immagini UI, la sorgente deve stare qui o in renderer config, non hardcoded nei componenti.</p>
|
||||
<div class="mt-5 rounded-2xl border border-slate-800 bg-slate-950/60 p-5">
|
||||
<h3 class="font-semibold text-white">Login view</h3>
|
||||
<ul class="mt-3 space-y-2 text-sm leading-7 text-slate-300">
|
||||
<li><code>loginview.images.background</code></li>
|
||||
<li><code>loginview.images.drape</code></li>
|
||||
<li><code>loginview.images.left</code></li>
|
||||
<li><code>loginview.images.right</code></li>
|
||||
<li><code>loginview.widgets</code> per i blocchi promozionali</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="runtime-code" class="rounded-3xl border border-slate-800 bg-slate-900/70 p-8">
|
||||
<h2 class="text-2xl font-bold text-white">Codice runtime coinvolto</h2>
|
||||
<div class="mt-5 grid gap-4 md:grid-cols-2">
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/60 p-5">
|
||||
<h3 class="font-semibold text-white"><code>src/bootstrap.ts</code></h3>
|
||||
<p class="mt-3 text-sm leading-7 text-slate-300">Legge <code>client-mode</code>, costruisce <code>NitroConfig['config.urls']</code> e prepara il bootstrap del client.</p>
|
||||
</div>
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/60 p-5">
|
||||
<h3 class="font-semibold text-white"><code>src/secure-assets.ts</code></h3>
|
||||
<p class="mt-3 text-sm leading-7 text-slate-300">Gestisce ECDH, decrypt/encrypt, fallback plain e secure API runtime.</p>
|
||||
</div>
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/60 p-5">
|
||||
<h3 class="font-semibold text-white"><code>scripts/write-asset-loader.mjs</code></h3>
|
||||
<p class="mt-3 text-sm leading-7 text-slate-300">Genera <code>public/configuration/asset-loader.js</code> e decide se usare file plain o <code>.dat</code>.</p>
|
||||
</div>
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/60 p-5">
|
||||
<h3 class="font-semibold text-white"><code>scripts/minify-dist.mjs</code></h3>
|
||||
<p class="mt-3 text-sm leading-7 text-slate-300">Genera i <code>.dat</code> ma mantiene anche i file plain per il toggle runtime.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="emulator" class="rounded-3xl border border-slate-800 bg-slate-900/70 p-8">
|
||||
<h2 class="text-2xl font-bold text-white">Emulatore</h2>
|
||||
<pre class="mt-5 overflow-x-auto rounded-2xl border border-slate-800 bg-slate-950/90 p-5 text-sm text-emerald-300"><code>nitro.secure.assets.enabled=true
|
||||
nitro.secure.api.enabled=true
|
||||
nitro.secure.config.root=C:/path/to/Nitro-V3/public
|
||||
nitro.secure.gamedata.root=C:/path/to/gamedata
|
||||
nitro.secure.master_key=change-me-to-a-long-random-secret</code></pre>
|
||||
<ul class="mt-5 space-y-2 text-sm leading-7 text-slate-300">
|
||||
<li><code>nitro.secure.assets.enabled</code>: abilita <code>/nitro-sec/bootstrap</code> e <code>/nitro-sec/file</code></li>
|
||||
<li><code>nitro.secure.api.enabled</code>: abilita la cifratura su <code>/api/*</code></li>
|
||||
<li><code>nitro.secure.config.root</code>: cartella dei config live</li>
|
||||
<li><code>nitro.secure.gamedata.root</code>: cartella del gamedata live</li>
|
||||
<li><code>nitro.secure.master_key</code>: chiave persistente server-side</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section id="scenarios" class="rounded-3xl border border-slate-800 bg-slate-900/70 p-8">
|
||||
<h2 class="text-2xl font-bold text-white">Scenari rapidi</h2>
|
||||
<div class="mt-5 grid gap-4 md:grid-cols-3">
|
||||
<div class="rounded-2xl border border-cyan-500/20 bg-cyan-500/10 p-5">
|
||||
<h3 class="font-semibold text-cyan-200">Tutto attivo</h3>
|
||||
<p class="mt-3 text-sm leading-7 text-cyan-50/90">Secure assets, secure API e dist obfuscation tutti attivi.</p>
|
||||
</div>
|
||||
<div class="rounded-2xl border border-emerald-500/20 bg-emerald-500/10 p-5">
|
||||
<h3 class="font-semibold text-emerald-200">Solo .dat</h3>
|
||||
<p class="mt-3 text-sm leading-7 text-emerald-50/90">Usi i <code>.dat</code>, ma lasci config/API in plain.</p>
|
||||
</div>
|
||||
<div class="rounded-2xl border border-slate-700 bg-slate-950/60 p-5">
|
||||
<h3 class="font-semibold text-white">Tutto plain</h3>
|
||||
<p class="mt-3 text-sm leading-7 text-slate-300">Modalità fallback completa per debug o test locali.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="checklist" class="rounded-3xl border border-slate-800 bg-slate-900/70 p-8">
|
||||
<h2 class="text-2xl font-bold text-white">Checklist finale</h2>
|
||||
<div class="mt-5 grid gap-3">
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/60 px-5 py-4 text-sm text-slate-300">Hai creato i file reali partendo da <code>client-mode.example</code>, <code>renderer-config.example</code> e <code>ui-config.example</code></div>
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/60 px-5 py-4 text-sm text-slate-300">Gli URL pubblici stanno nei file config, non nei componenti React</div>
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/60 px-5 py-4 text-sm text-slate-300">Hai deployato sia i file plain sia i <code>.dat</code></div>
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/60 px-5 py-4 text-sm text-slate-300">Il server espone correttamente il MIME type per <code>.dat</code></div>
|
||||
<div class="rounded-2xl border border-slate-800 bg-slate-950/60 px-5 py-4 text-sm text-slate-300">Hai impostato <code>nitro.secure.master_key</code> lato emulatore</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user