mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-18 08:09:40 +02:00
- Add Dockerfile for multi-stage Docker build - Add mana-core-auth integration with login/register pages - Add auth store using Svelte 5 runes - Add protected route layout with auth guard - Add health endpoint for container health checks - Add runtime URL injection via hooks.server.ts - Add logout button to header - Update docker-compose.macmini.yml with llm-playground service - Update cloudflared-config.yml with playground.mana.how route - Update mana-llm CORS config for playground domain - Update generate-env.mjs with auth URL variable Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
18 lines
680 B
TypeScript
18 lines
680 B
TypeScript
import type { Handle } from '@sveltejs/kit';
|
|
|
|
const PUBLIC_MANA_CORE_AUTH_URL_CLIENT =
|
|
process.env.PUBLIC_MANA_CORE_AUTH_URL_CLIENT || process.env.PUBLIC_MANA_CORE_AUTH_URL || '';
|
|
const PUBLIC_MANA_LLM_URL_CLIENT =
|
|
process.env.PUBLIC_MANA_LLM_URL_CLIENT || process.env.PUBLIC_MANA_LLM_URL || '';
|
|
|
|
export const handle: Handle = async ({ event, resolve }) => {
|
|
return resolve(event, {
|
|
transformPageChunk: ({ html }) => {
|
|
const envScript = `<script>
|
|
window.__PUBLIC_MANA_CORE_AUTH_URL__ = "${PUBLIC_MANA_CORE_AUTH_URL_CLIENT}";
|
|
window.__PUBLIC_MANA_LLM_URL__ = "${PUBLIC_MANA_LLM_URL_CLIENT}";
|
|
</script>`;
|
|
return html.replace('<head>', `<head>${envScript}`);
|
|
},
|
|
});
|
|
};
|