Skip to content

Commit

Permalink
Smarter when to self sign
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Nov 14, 2024
1 parent 279f49b commit df13c4d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/executor/runnersub.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,14 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec,
});
subdomaindata['SSL cert expiry'] = new Date().toISOString()
}
// if LE ON AND force self-sign / shared on, must turn off
// if it was shared or ssl path don't match, just assume that's also LE ON
} else if ((selfSignSsl || sharedSSL || expectedSslMode == 'off') && ((subdomaindata['SSL shared with'] && changed && !expectedSslMode) || subdomaindata['Lets Encrypt renewal'] == 'Enabled')) {
// Regenerate self sign if
// 1. Explicit request || SSL off
// 2. Let's Encrypt renewal enabled
// 3. sharing SSL and was not
} else if ((selfSignSsl || expectedSslMode == 'off') || (subdomaindata['Lets Encrypt renewal'] == 'Enabled') || ((sharedSSL && !subdomaindata['SSL shared with'] && !expectedSslMode))) {
if (subdomaindata['SSL shared with']) {
throw new Error('Cannot turn off SSL while using shared domain!')
}
await writeLog("$> Generating self signed cert and turning off let's encrypt renewal");
await virtExec("generate-cert", {
domain: subdomain,
Expand Down

0 comments on commit df13c4d

Please sign in to comment.