From f379ef6a3b004c5af238218f1069d65e70fa6ed6 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 22 Sep 2022 09:03:19 +0200 Subject: [PATCH] feat: ssl cert on traefik config --- apps/api/src/routes/webhooks/traefik/handlers.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/api/src/routes/webhooks/traefik/handlers.ts b/apps/api/src/routes/webhooks/traefik/handlers.ts index cd2d80023..d46b23af8 100644 --- a/apps/api/src/routes/webhooks/traefik/handlers.ts +++ b/apps/api/src/routes/webhooks/traefik/handlers.ts @@ -546,7 +546,19 @@ export async function traefikOtherConfiguration(request: FastifyRequest) { const { id } = request.params try { + const sslpath = '/etc/traefik/acme/custom'; + const certificates = await prisma.certificate.findMany({ where: { team: { destinationDocker: { some: { id, remoteEngine: true, isCoolifyProxyUsed: true, remoteVerified: true } } } } }) + let parsedCertificates = [] + for (const certificate of certificates) { + parsedCertificates.push({ + certFile: `${sslpath}/${certificate.id}-cert.pem`, + keyFile: `${sslpath}/${certificate.id}-key.pem` + }) + } const traefik = { + tls: { + certificates: parsedCertificates + }, http: { routers: {}, services: {},