Skip to content

Commit

Permalink
fix ssl mode and ability to disable lets encrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Nov 15, 2023
1 parent d18b04e commit 0ff3f12
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "domcloud-bridge",
"version": "0.32.0",
"version": "0.32.1",
"description": "Deployment runner for DOM Cloud",
"main": "app.js",
"engines": {
Expand Down
12 changes: 10 additions & 2 deletions src/executor/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec,
let regenerateSsl = false;
let expectedSslMode = null;
if (['off', 'always', 'on'].includes(value)) {
expectedSslMode = expectedSslMode;
expectedSslMode = value;
} else if (value == 'letsencrypt') {
regenerateSsl = true;
}
Expand Down Expand Up @@ -703,13 +703,21 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec,
await writeLog(await nginxExec.setDirect(subdomain, nginxInfos));
}
if (regenerateSsl || (!expectedSslMode && !sharedSSL)) {
await writeLog("$> generating ssl cert with let's encrypt");
await writeLog("$> Generating ssl cert with let's encrypt");
await spawnSudoUtil('OPENSSL_CLEAN');
await virtExec("generate-letsencrypt-cert", {
domain: subdomain,
'renew': 2,
'web': true,
});
} else if (sharedSSL && domaindata['Lets Encrypt renewal'] == 'Enabled') {
await writeLog("$> Generating self signed cert and turning off let's encrypt renewal");
await virtExec("generate-cert", {
domain: subdomain,
'self': true,
});
} else if (!changed) {
await writeLog("$> SSL config seems OK, nothing changed");
}
break;
case 'root':
Expand Down

0 comments on commit 0ff3f12

Please sign in to comment.