feat: ssl cert on traefik config
This commit is contained in:
parent
510a748749
commit
f379ef6a3b
1 changed files with 12 additions and 0 deletions
|
|
@ -546,7 +546,19 @@ export async function traefikOtherConfiguration(request: FastifyRequest<TraefikO
|
||||||
export async function remoteTraefikConfiguration(request: FastifyRequest<OnlyId>) {
|
export async function remoteTraefikConfiguration(request: FastifyRequest<OnlyId>) {
|
||||||
const { id } = request.params
|
const { id } = request.params
|
||||||
try {
|
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 = {
|
const traefik = {
|
||||||
|
tls: {
|
||||||
|
certificates: parsedCertificates
|
||||||
|
},
|
||||||
http: {
|
http: {
|
||||||
routers: {},
|
routers: {},
|
||||||
services: {},
|
services: {},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue