From a46df3ef764edc8b369ca4a19e8bd09665bff70b Mon Sep 17 00:00:00 2001 From: orfelorfel23 Date: Wed, 21 Oct 2026 21:21:59 +0200 Subject: [PATCH] chore: Codebuff-Download-Artefakte und Altlasten bereinigt --- .gitignore | 3 - public/app.js | 4 +- public/download.html | 171 ------------------------------------------- public/index.html | 4 +- public/styles.css | 1 - src/index.js | 47 ------------ 6 files changed, 3 insertions(+), 227 deletions(-) delete mode 100644 public/download.html diff --git a/.gitignore b/.gitignore index fcdd2c0..24c2033 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/public/app.js b/public/app.js index 5b6b9fb..0e3c9b6 100644 --- a/public/app.js +++ b/public/app.js @@ -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.', diff --git a/public/download.html b/public/download.html deleted file mode 100644 index 965559c..0000000 --- a/public/download.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - -Solus – Download - - - -
-

🪞 Solus herunterladen

-

Der komplette Quellcode, lauffähig auf deinem Rechner – ohne Cloudflare-Account.

- -
- -

ZIP: Quellcode zum Entpacken · Bundle: git clone solus.bundle solus

- -
- -

Falls der Download blockiert wird

-
-

Manche eingebettete Vorschau-Fenster verbieten Datei-Downloads. Dann den Inhalt als Text kopieren - und lokal wieder in eine Datei schreiben:

-
- - - Neuer Tab -
-

-

- -

Danach in PowerShell (Ordner C:\GitHub anlegen bzw. anpassen). - Der Längenvergleich ist wichtig: stimmt die Byte-Zahl nicht, war die Kopie abgeschnitten:

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

In 4 Schritten starten (Windows)

-
-
    -
  1. Node.js LTS installieren (Version 20 oder neuer).
  2. -
  3. solus.zip herunterladen und nach C:\GitHub\solus entpacken.
  4. -
  5. PowerShell in diesem Ordner öffnen und starten:
    -
    cd C:\GitHub\solus
    -npm start
    -
  6. -
  7. http://localhost:8787 im Browser öffnen.
  8. -
-

Beim ersten Start werden Abhängigkeiten installiert, .dev.vars angelegt und die lokale Datenbank - mit 10 Charakteren befüllt. Für echte KI-Antworten MINIMAX_API_KEY=… in .dev.vars eintragen und neu starten.

-
- -

Mit Git-Historie

-
-
git clone solus.bundle solus
-cd solus
-npm start
-
- -

Ausführliche Anleitung inkl. Handy-Zugriff, Firewall, Autostart und Datensicherung: README.md im Download.

-
- - - diff --git a/public/index.html b/public/index.html index 760cfcb..6b384d6 100644 --- a/public/index.html +++ b/public/index.html @@ -17,7 +17,6 @@
- ⬇
@@ -39,7 +38,6 @@ - ⬇ Quellcode laden
@@ -48,4 +46,4 @@ - + \ No newline at end of file diff --git a/public/styles.css b/public/styles.css index 6661bce..696d61e 100644 --- a/public/styles.css +++ b/public/styles.css @@ -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} diff --git a/src/index.js b/src/index.js index 61b5ee1..39a03df 100644 --- a/src/index.js +++ b/src/index.js @@ -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 }));