From 6462982d12c7f2ec97943ef30799cd6dd6502c2a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 7 Apr 2022 21:24:05 +0200 Subject: [PATCH] fix: www or not-www, that's the question --- src/lib/letsencrypt/index.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/letsencrypt/index.ts b/src/lib/letsencrypt/index.ts index 240b561ea..12b527890 100644 --- a/src/lib/letsencrypt/index.ts +++ b/src/lib/letsencrypt/index.ts @@ -200,14 +200,20 @@ export async function generateSSLCerts() { } for (const ssl of ssls) { if (!dev) { - if (certificates.includes(ssl.domain)) { + if ( + certificates.includes(ssl.domain) || + certificates.includes(ssl.domain.replace('www', '')) + ) { console.log(`Certificate for ${ssl.domain} already exists`); } else { console.log('Generating SSL for', ssl.domain); await letsEncrypt(ssl.domain, ssl.id, ssl.isCoolify); } } else { - if (certificates.includes(ssl.domain)) { + if ( + certificates.includes(ssl.domain) || + certificates.includes(ssl.domain.replace('www', '')) + ) { console.log(`Certificate for ${ssl.domain} already exists`); } else { console.log('Generating SSL for', ssl.domain);