From 255599ea5966c332e46f4f4c47e6141a05aa7299 Mon Sep 17 00:00:00 2001 From: "alexey.lazarenko" Date: Tue, 12 Sep 2023 10:09:27 +0300 Subject: [PATCH 1/3] JE-66894 [Let's Encrypt][WebRoot] Cron task is absent inside container where add-on installed --- scripts/ssl-manager.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/ssl-manager.js b/scripts/ssl-manager.js index 46c034ce..26d04eab 100644 --- a/scripts/ssl-manager.js +++ b/scripts/ssl-manager.js @@ -354,11 +354,13 @@ function SSLManager(config) { me.uninstall = function () { var autoUpdateScript = nodeManager.getScriptPath(AUTO_UPDATE_SCRIPT); + var resp = nodeManager.getNode(); + if (resp.result != 0) return resp; return me.execAll([ [ me.cmd, "crontab -l 2>/dev/null | grep -v '%(scriptPath)' | crontab -", { scriptPath : autoUpdateScript, - nodeGroup: config.nodeGroup + nodeGroup: resp && resp.node ? resp.node.nodeGroup : config.nodeGroup }], [ me.initAddOnExtIp, config.withExtIp ], @@ -1384,6 +1386,7 @@ function SSLManager(config) { me.scheduleAutoUpdate = function scheduleAutoUpdate(crontime) { var scriptUrl = me.getScriptUrl(AUTO_UPDATE_SCRIPT); + var balancerNode = nodeManager.getBalancerMasterNode(); return nodeManager.cmd([ "wget --no-check-certificate '%(url)' -O %(scriptPath)", @@ -1395,7 +1398,8 @@ function SSLManager(config) { url : scriptUrl, cronTime : crontime ? crontime : config.cronTime, scriptPath : nodeManager.getScriptPath(AUTO_UPDATE_SCRIPT), - autoUpdateUrl : me.getAutoUpdateUrl() + autoUpdateUrl : me.getAutoUpdateUrl(), + nodeId: balancerNode ? balancerNode.id : "" }, "", true); }; From 5edd97ecefdce8c8dd4c79b74a73db46a488d516 Mon Sep 17 00:00:00 2001 From: "alexey.lazarenko" Date: Tue, 12 Sep 2023 10:10:35 +0300 Subject: [PATCH 2/3] JE-66894 [Let's Encrypt][WebRoot] Cron task is absent inside container where add-on installed --- scripts/ssl-manager.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/ssl-manager.js b/scripts/ssl-manager.js index 26d04eab..f7303a24 100644 --- a/scripts/ssl-manager.js +++ b/scripts/ssl-manager.js @@ -354,13 +354,11 @@ function SSLManager(config) { me.uninstall = function () { var autoUpdateScript = nodeManager.getScriptPath(AUTO_UPDATE_SCRIPT); - var resp = nodeManager.getNode(); - if (resp.result != 0) return resp; return me.execAll([ [ me.cmd, "crontab -l 2>/dev/null | grep -v '%(scriptPath)' | crontab -", { scriptPath : autoUpdateScript, - nodeGroup: resp && resp.node ? resp.node.nodeGroup : config.nodeGroup + nodeGroup: config.nodeGroup }], [ me.initAddOnExtIp, config.withExtIp ], From 539786b058febd9cf4f981d27837f53f8ab7cf7a Mon Sep 17 00:00:00 2001 From: "alexey.lazarenko" Date: Tue, 12 Sep 2023 10:13:11 +0300 Subject: [PATCH 3/3] JE-66894 --- scripts/ssl-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ssl-manager.js b/scripts/ssl-manager.js index f7303a24..b20a5f50 100644 --- a/scripts/ssl-manager.js +++ b/scripts/ssl-manager.js @@ -1397,7 +1397,7 @@ function SSLManager(config) { cronTime : crontime ? crontime : config.cronTime, scriptPath : nodeManager.getScriptPath(AUTO_UPDATE_SCRIPT), autoUpdateUrl : me.getAutoUpdateUrl(), - nodeId: balancerNode ? balancerNode.id : "" + nodeId: (balancerNode && config.nodeGroup == balancerNode.nodeGroup) ? balancerNode.id : "" }, "", true); };