WIP: Traefik

This commit is contained in:
Andras Bacsai
2022-05-12 16:53:22 +02:00
parent c095cb58b3
commit ae5d90eb47
22 changed files with 721 additions and 216 deletions

View File

@@ -1,4 +1,4 @@
import { ErrorHandler } from '$lib/database';
import { ErrorHandler, prisma } from '$lib/database';
import { configureHAProxy } from '$lib/haproxy/configuration';
export default async function (): Promise<void | {
@@ -6,7 +6,10 @@ export default async function (): Promise<void | {
body: { message: string; error: string };
}> {
try {
return await configureHAProxy();
const settings = await prisma.setting.findFirst();
if (!settings.isTraefikUsed) {
return await configureHAProxy();
}
} catch (error) {
return ErrorHandler(error.response?.body || error);
}