new notification system

This commit is contained in:
KingKDot
2026-03-22 00:36:02 -05:00
parent b98613ae51
commit 92530044c9
15 changed files with 580 additions and 5 deletions
@@ -20,6 +20,8 @@ type MiscRouteDeps = {
getRdSessionCount: () => number;
getFileBrowserSessionCount: () => number;
getProcessSessionCount: () => number;
tlsCertPath?: string;
tlsSource?: "certbot" | "configured" | "self-signed";
};
export async function handleMiscRoutes(
@@ -388,5 +390,28 @@ export async function handleMiscRoutes(
});
}
if (req.method === "GET" && url.pathname === "/api/cert/info") {
return Response.json(
{ source: deps.tlsSource || "unknown" },
{ headers: { "Content-Type": "application/json", ...deps.CORS_HEADERS } },
);
}
if (req.method === "GET" && url.pathname === "/api/cert/download" && deps.tlsCertPath) {
try {
const file = Bun.file(deps.tlsCertPath);
if (await file.exists()) {
return new Response(file, {
headers: {
"Content-Type": "application/x-pem-file",
"Content-Disposition": 'attachment; filename="overlord-ca.crt"',
...deps.CORS_HEADERS,
},
});
}
} catch { }
return new Response("Certificate not available", { status: 404 });
}
return null;
}