wiki update
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user