From 974fd52ae534cfc86bfd43ef37448b3ceab3acfdb26ed8a5a1fea259d1360906 Mon Sep 17 00:00:00 2001 From: sisungo Date: Mon, 14 Sep 2026 12:16:11 +0000 Subject: [PATCH] fix: build is excluded from git Signed-off-by: sisungo --- .gitignore | 2 +- src/routes/api/login/+server.ts | 1 + .../api/packages/[name]/build/+server.ts | 29 +++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/routes/api/packages/[name]/build/+server.ts diff --git a/.gitignore b/.gitignore index 8919111..ab5fa16 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ node_modules/ # Build output -build/ +/build .svelte-kit/ # Rust build artifacts diff --git a/src/routes/api/login/+server.ts b/src/routes/api/login/+server.ts index fe8fe56..c224a4d 100644 --- a/src/routes/api/login/+server.ts +++ b/src/routes/api/login/+server.ts @@ -18,6 +18,7 @@ export const POST: RequestHandler = async ({ request, cookies }) => { httpOnly: true, sameSite: 'lax', maxAge: 7 * 24 * 60 * 60, + secure: false, }); return json({ ok: true }); diff --git a/src/routes/api/packages/[name]/build/+server.ts b/src/routes/api/packages/[name]/build/+server.ts new file mode 100644 index 0000000..07b4d86 --- /dev/null +++ b/src/routes/api/packages/[name]/build/+server.ts @@ -0,0 +1,29 @@ +import { json } from '@sveltejs/kit'; +import { createBuild } from '$lib/server/db.js'; +import type { RequestHandler } from './$types'; + +export const POST: RequestHandler = async ({ params, request, locals }) => { + if (!locals.user) { + return json({ error: 'Login required' }, { status: 401 }); + } + + const body = await request.json(); + const arch = body.arch ?? ''; + const target = body.target ?? `${arch || 'x86_64'}-semios-linux`; + const atombuild = body.atombuild ?? true; + const trigger = body.trigger ?? 'manual'; + + try { + const buildId = createBuild(params.name, target, atombuild, trigger); + return json({ + status: 'queued', + build_id: buildId, + message: `Build of ${params.name} queued` + }); + } catch (e) { + return json({ + status: 'error', + message: (e as Error).message + }, { status: 500 }); + } +};