From e5c40b9c692749786825ebe4fcba1fc86d1db9ac Mon Sep 17 00:00:00 2001 From: Wildan M Date: Fri, 8 Dec 2023 17:37:01 +0700 Subject: [PATCH] Fix ssl sharing --- package.json | 2 +- src/executor/runner.js | 6 ++++++ src/index.js | 9 +++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 4c544eb..faa62ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "domcloud-bridge", - "version": "0.34.1", + "version": "0.34.2", "description": "Deployment runner for DOM Cloud", "main": "app.js", "engines": { diff --git a/src/executor/runner.js b/src/executor/runner.js index 9b72365..7d257d4 100644 --- a/src/executor/runner.js +++ b/src/executor/runner.js @@ -704,6 +704,12 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec, changed = true; } if (regenerateSsl || (!expectedSslMode && !sharedSSL && !selfSignSsl)) { + if (domaindata['SSL shared with']) { + await writeLog("$> Breaking ssl cert sharing with the global domain"); + await virtExec("modify-web", { + 'break-ssl-cert': true, + }); + } await writeLog("$> Generating ssl cert with let's encrypt"); await spawnSudoUtil('OPENSSL_CLEAN'); await virtExec("generate-letsencrypt-cert", { diff --git a/src/index.js b/src/index.js index 0774ae9..b3ebdd0 100644 --- a/src/index.js +++ b/src/index.js @@ -30,10 +30,7 @@ app.use(function (err, req, res, next) { res.json(err); }); const port = process.env.PORT ? parseInt(process.env.PORT) : 2223; -app.listen(port); +app.listen(port, function () { + console.log(`Listening on ${port}`); +}) -console.log(`Starting main node on ${port}`); - -const cleanUpServer = (code) => { - console.log(`Exiting main node ${port} with code ${code}`); -};