From 20f369c639ca340cfc313ddd00fa0a1fa55b2aa4 Mon Sep 17 00:00:00 2001 From: "alexey.lazarenko" Date: Fri, 31 May 2024 04:49:52 +0300 Subject: [PATCH 1/2] [Let's Encrypt] Unable to Update/Remove add-on when it was reconfigured ... #296 --- scripts/ssl-manager.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/ssl-manager.js b/scripts/ssl-manager.js index 44701e92..49334388 100644 --- a/scripts/ssl-manager.js +++ b/scripts/ssl-manager.js @@ -44,6 +44,7 @@ function SSLManager(config) { UPLOADER_ERROR = 12006, READ_TIMED_OUT = 12007, NO_VALID_IP_ADDRESSES = 12008, + ENVIRONMENT_NODE_GROUP_NOT_EXISTS = 2391, VALIDATION_SCRIPT = "validation.sh", SHELL_CODES = {}, INSTALL_LE_SCRIPT = "install-le.sh", @@ -710,10 +711,19 @@ function SSLManager(config) { propName, resp; + resp = me.cmd("[[ -f \"" + CUSTOM_CONFIG + "\" ]] && echo true || echo false", { nodeGroup: config.nodeGroup }); + + if (resp.result == ENVIRONMENT_NODE_GROUP_NOT_EXISTS) { + resp = nodeManager.getEntryPointGroup(); + if (resp.result != 0) return resp; + + config.nodeGroup = resp.group; + } + if (resp.result != 0) return resp; - if (resp.responses[0].out == "true") { + if (resp.responses && resp.responses[0] && resp.responses[0].out == "true") { resp = nodeManager.readFile(CUSTOM_CONFIG, config.nodeGroup); if (resp.result != 0) return resp; From 2001df1860067a21a7ffed8682ce2d225d369a15 Mon Sep 17 00:00:00 2001 From: "alexey.lazarenko" Date: Fri, 31 May 2024 05:00:22 +0300 Subject: [PATCH 2/2] [LE] Unable to Update/Remove add-on when... #296 --- scripts/ssl-manager.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/ssl-manager.js b/scripts/ssl-manager.js index 49334388..c1e82c7a 100644 --- a/scripts/ssl-manager.js +++ b/scripts/ssl-manager.js @@ -363,7 +363,13 @@ function SSLManager(config) { }; me.uninstall = function () { - var autoUpdateScript = nodeManager.getScriptPath(AUTO_UPDATE_SCRIPT); + var autoUpdateScript = nodeManager.getScriptPath(AUTO_UPDATE_SCRIPT), + resp; + + resp = nodeManager.getEntryPointGroup(); + if (resp.result != 0) return resp; + + config.nodeGroup = resp.group; return me.execAll([ [ me.cmd, "crontab -l 2>/dev/null | grep -v '%(scriptPath)' | crontab -", { @@ -383,7 +389,8 @@ function SSLManager(config) { nodeManager.getScriptPath(INSTALL_LE_SCRIPT), nodeManager.getScriptPath(VALIDATION_SCRIPT), autoUpdateScript - ].join(DOMAINS_SEP) + ].join(DOMAINS_SEP), + nodeGroup: config.nodeGroup }] ]); };