From d05dad2e4887f5b4e0d8e0587b35caa865d04293 Mon Sep 17 00:00:00 2001 From: Anais Saraiva Date: Mon, 21 Sep 2026 11:38:19 +0200 Subject: [PATCH] wiki update --- .env.example | 3 +++ another_prompt | 20 ++++++++++++++++++++ docs/OPERATIONS.md | 1 + frontend/src/components/Chat.tsx | 9 +++++++-- src/config.ts | 4 ++++ src/index.ts | 5 +++++ 6 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 another_prompt diff --git a/.env.example b/.env.example index 59ba57d..27adf53 100644 --- a/.env.example +++ b/.env.example @@ -10,6 +10,9 @@ SESSION_TTL_HOURS=720 # Data dir: holds kisassistant.db (SQLite: users, sessions, chats, shares) DATA_DIR=./data +# Public docs wiki (Gitea wiki pages of this repo). GET /wiki redirects here. +WIKI_URL=https://git.kisakay.com/k/chat/wiki + # --- rate limit on /api/auth/login (per IP, sliding window) --- RATE_LIMIT_MAX=5 RATE_LIMIT_WINDOW_MIN=10 diff --git a/another_prompt b/another_prompt new file mode 100644 index 0000000..a9c345c --- /dev/null +++ b/another_prompt @@ -0,0 +1,20 @@ +fait en sorte de pouvoir upload un avatar (Servir un cdn en local via fichier upload sur le serveur dans un dossier à côté de la codebase) + +cdn comme sa + +http/cdn//. + +Extension authorisé ONLY: +jpg/jpeg/webp/png + +BLACKLISTE SYSTÈMATHIQUEMENT LE RESTE. +Pas que un detect typeFile avec l'extension. +Logique propre de détection du fichier *magic byte, looking bytes, etc* + +Changer l 'avatar à plusieurs règles: +Rate-limit per change / per account de: +5 fois maximum en 2 heures +(window time: 2 hours, max count 5) +file length maxi: 5MB + +SYSTEM DE CHANGEMENT DE MDP: diff --git a/docs/OPERATIONS.md b/docs/OPERATIONS.md index befa07b..9758b4c 100644 --- a/docs/OPERATIONS.md +++ b/docs/OPERATIONS.md @@ -10,6 +10,7 @@ Copy `.env.example` to `.env`. Full list: | `APP_PASSWORD` | *(required)* | **admin** access key — generate with `openssl rand -base64 24` | | `SESSION_TTL_HOURS` | `720` | Bearer session lifetime (30 days) | | `DATA_DIR` | `./data` | holds `kisassistant.db` (SQLite) | +| `WIKI_URL` | `https://git.kisakay.com/k/chat/wiki` | remote docs wiki — `GET /wiki` redirects (302) there | | `RATE_LIMIT_MAX` / `RATE_LIMIT_WINDOW_MIN` | `5` / `10` | login rate limit per IP | | `OLLAMA_HOST` / `OLLAMA_ENABLED` | `http://10.66.66.4:11434` / `true` | local-model driver | | `MISTRAL_*`, `DEEPSEEK_*`, `ANTHROPIC_*`, `OPENAI_*` | disabled | API drivers: set `*_ENABLED=true` **and** `*_API_KEY` | diff --git a/frontend/src/components/Chat.tsx b/frontend/src/components/Chat.tsx index 3f64534..b6b9ddb 100644 --- a/frontend/src/components/Chat.tsx +++ b/frontend/src/components/Chat.tsx @@ -1,5 +1,5 @@ import { useEffect, useRef, useState } from "react"; -import { Bot, Cpu, PanelLeftOpen, SendHorizontal, Share2, User as UserIcon } from "lucide-react"; +import { BookOpen, Bot, Cpu, PanelLeftOpen, SendHorizontal, Share2, User as UserIcon } from "lucide-react"; import type { ChatMessage, Conversation, DriverModel, User } from "../lib/types.ts"; import { Avatar, IconButton, LOGO_URL, Logo, Picker, type PickerGroup, Spinner } from "./ui.tsx"; import { Markdown } from "./Markdown.tsx"; @@ -180,7 +180,12 @@ export function Chat({ -

No cookies — a Bearer key is stored in this browser only.

+

+ + + Wiki & docs + +

); diff --git a/src/config.ts b/src/config.ts index 3c8275f..6cb1ce4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -37,6 +37,10 @@ export const config = { openaiApiKey: env("OPENAI_API_KEY", ""), openaiEnabled: envBool("OPENAI_ENABLED", false), + + // Public docs wiki (served by the hosted git forge, e.g. Gitea wiki pages). + // The app redirects GET /wiki there (302) so the target stays configurable. + wikiUrl: env("WIKI_URL", "https://git.kisakay.com/k/chat/wiki"), }; export function assertConfig(): void { diff --git a/src/index.ts b/src/index.ts index dee3926..97928ee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -133,6 +133,11 @@ const server = Bun.serve({ }); } + // --- public: /wiki redirects to the remote docs wiki (git forge) --- + if ((path === "/wiki" || path === "/wiki/") && req.method === "GET") { + return Response.redirect(config.wikiUrl, 302); + } + // --- auth: login (rate limited) --- if (path === "/api/auth/login" && req.method === "POST") { const ip = clientIp(req, server);