fix: www or not-www, that's the question

This commit is contained in:
Andras Bacsai 2022-04-07 21:24:05 +02:00
parent 84b4cc5d54
commit 6462982d12

View File

@ -200,14 +200,20 @@ export async function generateSSLCerts() {
} }
for (const ssl of ssls) { for (const ssl of ssls) {
if (!dev) { 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`); console.log(`Certificate for ${ssl.domain} already exists`);
} else { } else {
console.log('Generating SSL for', ssl.domain); console.log('Generating SSL for', ssl.domain);
await letsEncrypt(ssl.domain, ssl.id, ssl.isCoolify); await letsEncrypt(ssl.domain, ssl.id, ssl.isCoolify);
} }
} else { } 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`); console.log(`Certificate for ${ssl.domain} already exists`);
} else { } else {
console.log('Generating SSL for', ssl.domain); console.log('Generating SSL for', ssl.domain);