chore: Codebuff-Download-Artefakte und Altlasten bereinigt

This commit is contained in:
Jannik committed 2026-10-21 21:21:59 +02:00
1 parent 75f45ae3ef
commit a46df3ef76
6 files changed
+3 -227

No files matched your search

-3
View File
@@ -6,6 +6,3 @@ dist/
*.zip
.DS_Store
*.bundle
# Download-Artefakte für die Auslieferung sichtbar halten (werden nicht eingecheckt)
!public/solus.zip
!public/solus.bundle
+2 -2
View File
@@ -15,7 +15,7 @@ const state = {
/* ---------------- i18n ---------------- */
const I18N = {
de: {
tab_feed:'Feed', tab_chars:'Charaktere', tab_chats:'Chats', tab_me:'Du', download:'Quellcode laden',
tab_feed:'Feed', tab_chars:'Charaktere', tab_chats:'Chats', tab_me:'Du',
compose_title:'Neuer Post', post_btn:'Posten', posting:'Postet…',
ai_image:'🎨 Bild generieren', empty_feed:'Noch nichts los. Schreib den ersten Post!',
ai_off:'Demo-Modus – kein MiniMax-API-Key gesetzt. Antworten sind Platzhalter.',
@@ -40,7 +40,7 @@ const I18N = {
new_post:'+ Neuer Post', compose_ph:'Was läuft bei dir?',
},
en: {
tab_feed:'Feed', tab_chars:'Characters', tab_chats:'Chats', tab_me:'You', download:'Get the code',
tab_feed:'Feed', tab_chars:'Characters', tab_chats:'Chats', tab_me:'You',
compose_title:'New post', post_btn:'Post', posting:'Posting…',
ai_image:'🎨 Generate image', empty_feed:'Nothing here yet. Be the first to post!',
ai_off:'Demo mode – no MiniMax API key set. Replies are placeholders.',
-171
View File
@@ -1,171 +0,0 @@
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Solus – Download</title>
<style>
:root { color-scheme: dark; --bg:#0b0b10; --card:#16161f; --line:#26263a; --text:#f2f2f7; --muted:#9b9bb0; --a:#a78bfa; --b:#f472b6; }
* { box-sizing: border-box; }
body { margin:0; background:radial-gradient(1200px 600px at 20% -10%, #1d1033 0%, transparent 60%), var(--bg); color:var(--text);
font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding: 32px 20px 64px; }
main { max-width: 720px; margin: 0 auto; }
h1 { font-size: 30px; margin: 0 0 4px; letter-spacing: -.02em; }
.sub { color: var(--muted); margin: 0 0 28px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin-bottom: 16px; }
.btns { display:flex; flex-wrap:wrap; gap:12px; }
a.btn { display:inline-flex; align-items:center; gap:10px; text-decoration:none; font-weight:600; padding:12px 18px; border-radius:12px;
background:linear-gradient(135deg,var(--a),var(--b)); color:#12081f; }
a.btn.alt { background:transparent; color:var(--text); border:1px solid var(--line); }
.meta { color:var(--muted); font-size:13px; margin-top:10px; }
h2 { font-size:15px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin: 26px 0 10px; }
ol { padding-left: 20px; }
li { margin-bottom: 8px; }
code { background:#0e0e16; border:1px solid var(--line); border-radius:6px; padding:2px 6px; font-size:14px; }
pre { background:#0e0e16; border:1px solid var(--line); border-radius:12px; padding:14px 16px; overflow-x:auto; font-size:14px; }
pre code { background:none; border:0; padding:0; }
.note { border-left: 3px solid var(--a); padding-left: 12px; color: var(--muted); font-size: 14px; }
textarea { width:100%; height: 180px; margin-top: 12px; background:#0e0e16; color:var(--text); border:1px solid var(--line);
border-radius:12px; padding:10px 12px; font: 12px/1.5 ui-monospace, Consolas, monospace; resize: vertical; word-break: break-all; }
a { color: var(--a); }
</style>
</head>
<body>
<main>
<h1>🪞 Solus herunterladen</h1>
<p class="sub">Der komplette Quellcode, lauffähig auf deinem Rechner – ohne Cloudflare-Account.</p>
<div class="card">
<div class="btns">
<a class="btn" href="/api/download/solus.zip" download="solus.zip">solus.zip <span aria-hidden="true">↓</span></a>
<a class="btn alt" href="/api/download/solus.bundle" download="solus.bundle">solus.bundle (mit Git-Historie)</a>
</div>
<p class="meta">ZIP: Quellcode zum Entpacken · Bundle: <code>git clone solus.bundle solus</code></p>
<p class="meta" id="missing" hidden></p>
</div>
<h2>Falls der Download blockiert wird</h2>
<div class="card">
<p class="meta" style="margin-top:0">Manche eingebettete Vorschau-Fenster verbieten Datei-Downloads. Dann den Inhalt als Text kopieren
und lokal wieder in eine Datei schreiben:</p>
<div class="btns">
<button class="btn" id="show-b64" type="button">Base64 hier anzeigen</button>
<button class="btn alt" id="copy-zip" type="button">In Zwischenablage kopieren</button>
<a class="btn alt" href="/api/download/solus.zip?mode=base64" target="_blank" rel="noreferrer">Neuer Tab</a>
</div>
<p class="meta" id="copy-status"></p>
<p class="meta" id="sizes"></p>
<textarea id="b64" readonly spellcheck="false" placeholder="Noch nicht geladen – auf „Base64 hier anzeigen“ klicken." hidden></textarea>
<p class="meta">Danach in PowerShell (Ordner <code>C:\GitHub</code> anlegen bzw. anpassen).
Der Längenvergleich ist wichtig: stimmt die Byte-Zahl nicht, war die Kopie abgeschnitten:</p>
<pre><code>cd C:\GitHub
$b64 = (Get-Clipboard -Raw) -replace '\s', ''
$bytes = [Convert]::FromBase64String($b64)
$bytes.Length # muss der Byte-Zahl oben entsprechen
[IO.File]::WriteAllBytes("solus.zip", $bytes)
tar -xf solus.zip -C . # Windows 10+: bsdtar, robuster als Expand-Archive</code></pre>
</div>
<h2>In 4 Schritten starten (Windows)</h2>
<div class="card">
<ol>
<li><a href="https://nodejs.org" target="_blank" rel="noreferrer">Node.js LTS</a> installieren (Version 20 oder neuer).</li>
<li><code>solus.zip</code> herunterladen und nach <code>C:\GitHub\solus</code> entpacken.</li>
<li>PowerShell in diesem Ordner öffnen und starten:<br />
<pre><code>cd C:\GitHub\solus
npm start</code></pre>
</li>
<li><a href="http://localhost:8787" target="_blank" rel="noreferrer">http://localhost:8787</a> im Browser öffnen.</li>
</ol>
<p class="note">Beim ersten Start werden Abhängigkeiten installiert, <code>.dev.vars</code> angelegt und die lokale Datenbank
mit 10 Charakteren befüllt. Für echte KI-Antworten <code>MINIMAX_API_KEY=…</code> in <code>.dev.vars</code> eintragen und neu starten.</p>
</div>
<h2>Mit Git-Historie</h2>
<div class="card">
<pre><code>git clone solus.bundle solus
cd solus
npm start</code></pre>
</div>
<p class="meta">Ausführliche Anleitung inkl. Handy-Zugriff, Firewall, Autostart und Datensicherung: README.md im Download.</p>
</main>
<script>
// Die Artefakte liegen nur im ausgelieferten Build, nicht im Git-Repo.
// Wenn sie fehlen (z. B. nach einem frischen Clone), sagen wir das offen.
fetch('/api/download/solus.zip', { method: 'HEAD' }).then((res) => {
if (!res.ok) {
const box = document.getElementById('missing');
box.hidden = false;
box.textContent = 'In diesem Build liegen die Download-Dateien nicht bei (frischer Clone) – '
+ 'nutze dann das Git-Repository, das ist derselbe Stand.';
}
}).catch(() => {});
const ta = document.getElementById('b64');
const status = document.getElementById('copy-status');
const sizes = document.getElementById('sizes');
let cache = null;
let zipBytes = null;
fetch('/api/download/solus.zip', { method: 'HEAD' })
.then((r) => {
const n = Number(r.headers.get('content-length'));
if (n) {
zipBytes = n;
sizes.textContent = 'Erwartet: ZIP ' + n + ' Bytes · Base64 ' + (4 * Math.ceil(n / 3)) + ' Zeichen';
}
})
.catch(() => {});
async function loadB64() {
if (cache) return cache;
const res = await fetch('/api/download/solus.zip?mode=base64');
if (!res.ok) throw new Error('HTTP ' + res.status);
cache = await res.text();
return cache;
}
function reveal() {
ta.hidden = false;
ta.focus();
ta.select();
}
document.getElementById('show-b64').addEventListener('click', async () => {
status.textContent = 'Lade …';
try {
ta.value = await loadB64();
reveal();
status.textContent = 'Geladen: ' + ta.value.length + ' Zeichen – nach dem Kopieren Strg+A, Strg+C, dann PowerShell-Befehl ausführen.';
} catch (e) {
status.textContent = '❌ ' + e.message;
}
});
document.getElementById('copy-zip').addEventListener('click', async () => {
status.textContent = 'Lade …';
try {
const b64 = await loadB64();
let ok = false;
try {
await navigator.clipboard.writeText(b64);
ok = true;
} catch {
// Clipboard-API ist in eingebetteten Frames oft gesperrt – Fallback über die Textarea.
ta.value = b64;
reveal();
ok = document.execCommand('copy');
}
const expected = zipBytes ? 4 * Math.ceil(zipBytes / 3) : b64.length;
status.textContent = ok
? '✅ ' + b64.length + ' Zeichen kopiert' + (b64.length === expected ? ' (vollständig)' : ' – ACHTUNG: erwartet ' + expected)
+ ' – jetzt den PowerShell-Befehl unten ausführen.'
: '⚠️ Kopieren blockiert. Der Text steht unten in der Box: Strg+A, Strg+C.';
} catch (e) {
status.textContent = '❌ ' + e.message;
}
});
</script>
</body>
</html>
+1 -3
View File
@@ -17,7 +17,6 @@
</div>
<div class="topbar-right">
<span id="ai-badge" class="badge badge-ai" hidden>Demo-Modus</span>
<a id="download-link" class="icon-btn" href="/download" title="Solus herunterladen">⬇</a>
<button id="lang-toggle" class="icon-btn" title="Sprache">EN</button>
</div>
</header>
@@ -39,7 +38,6 @@
<button class="side-item" data-view="chats">💬 <span data-i18n="tab_chats">Chats</span></button>
<button class="side-item" data-view="profile">🫵 <span data-i18n="tab_me">Du</span></button>
<button class="side-item side-compose" data-view="compose">✏️ <span data-i18n="compose_title">Neuer Post</span></button>
<a class="side-item side-download" href="/download">⬇ <span data-i18n="download">Quellcode laden</span></a>
<div class="side-foot" id="side-foot"></div>
</nav>
</div>
@@ -48,4 +46,4 @@
<div id="modal-root"></div>
<script type="module" src="/app.js"></script>
</body>
</html>
</html>
-1
View File
@@ -171,7 +171,6 @@ input[type=text]:focus,textarea:focus,select:focus{border-color:var(--acc)}
.side-item.active{background:linear-gradient(135deg,rgba(124,92,255,.18),rgba(229,110,224,.18));color:var(--txt);font-weight:700}
.side-compose{margin-top:10px;background:linear-gradient(135deg,var(--acc),var(--acc2));color:#fff;font-weight:700;justify-content:center}
.side-compose:hover{color:#fff;filter:brightness(1.08)}
.side-download{margin-top:12px;text-decoration:none;font-size:14px}
.side-foot{margin-top:auto;font-size:12px;color:var(--muted);line-height:1.6;padding:0 6px}
.main{margin-left:var(--side-w);margin-right:auto;padding:28px 24px 60px}
.chat-input{bottom:0}
-47
View File
@@ -236,53 +236,6 @@ app.get('/img/:key', async (c) => {
return new Response(obj.body, { headers: { 'Content-Type': obj.httpMetadata?.contentType || 'image/jpeg', 'Cache-Control': 'public, max-age=31536000, immutable' } });
});
// ---------- SOURCE-DOWNLOAD ----------
// Eigene Route statt statischem Asset: setzt immer Content-Type + Content-Disposition,
// und liefert mit ?mode=base64 notfalls reinen Text (falls ein Vorschau-Frame Downloads blockt).
const DOWNLOADS = {
'solus.zip': 'application/zip',
'solus.bundle': 'application/x-git-bundle',
};
app.get('/api/download/:file', async (c) => {
const file = c.req.param('file');
const type = DOWNLOADS[file];
if (!type) return c.json({ error: 'Unbekannte Datei' }, 404);
const asset = await c.env.ASSETS.fetch(new URL(`/${file}`, c.req.url));
const ct = asset.headers.get('content-type') || '';
// Fehlt die Datei im Build, antwortet die Asset-Schicht mit der SPA-Fallback-Seite (200, text/html).
if (!asset.ok || ct.includes('text/html')) {
return c.json({ error: 'Artefakt nicht im Build enthalten', file }, 404);
}
const buf = await asset.arrayBuffer();
const head = new Uint8Array(buf.slice(0, 4));
const isZip = head[0] === 0x50 && head[1] === 0x4b;
const isBundle = new TextDecoder().decode(new Uint8Array(buf.slice(0, 15))) === '# v2 git bundle';
if ((file === 'solus.zip' && !isZip) || (file === 'solus.bundle' && !isBundle)) {
return c.json({ error: 'Artefakt beschädigt oder nicht im Build enthalten', file }, 404);
}
if (c.req.query('mode') === 'base64') {
const bytes = new Uint8Array(buf);
let bin = '';
for (let i = 0; i < bytes.length; i += 0x8000) {
bin += String.fromCharCode.apply(null, bytes.subarray(i, i + 0x8000));
}
return new Response(btoa(bin), {
headers: { 'Content-Type': 'text/plain; charset=utf-8', 'Cache-Control': 'no-store' },
});
}
return new Response(buf, {
headers: {
'Content-Type': type,
'Content-Length': String(buf.byteLength),
'Content-Disposition': `attachment; filename="${file}"`,
'Cache-Control': 'no-store',
'X-Content-Type-Options': 'nosniff',
},
});
});
// ---------- STATUS ----------
app.get('/api/status', (c) => c.json({ aiEnabled: hasKey(c.env), seed: SEED_CHARACTERS.length }));