From 5f54490d86fa79f2abccbdbcee3e01f656525959 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Wed, 9 Jul 2025 12:35:20 +1000 Subject: [PATCH] Set SETUPTOOLS_USE_DISTUTILS for all plugin installs, seems like they all need it. --- backend/lib/certbot.js | 9 +++++---- global/certbot-dns-plugins.json | 5 +---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/backend/lib/certbot.js b/backend/lib/certbot.js index 0f491883..96d94710 100644 --- a/backend/lib/certbot.js +++ b/backend/lib/certbot.js @@ -63,14 +63,15 @@ const certbot = { plugin.version = plugin.version.replace(/{{certbot-version}}/g, CERTBOT_VERSION_REPLACEMENT); plugin.dependencies = plugin.dependencies.replace(/{{certbot-version}}/g, CERTBOT_VERSION_REPLACEMENT); - const opts = {}; + // SETUPTOOLS_USE_DISTUTILS is required for certbot plugins to install correctly + // in new versions of Python + let env = Object.assign({}, process.env, {SETUPTOOLS_USE_DISTUTILS: 'stdlib'}); if (typeof plugin.env === 'object') { - // include process.env in opts - opts.env = Object.assign({}, process.env, plugin.env); + env = Object.assign(env, plugin.env); } const cmd = `. /opt/certbot/bin/activate && pip install --no-cache-dir ${plugin.dependencies} ${plugin.package_name}${plugin.version} && deactivate`; - return utils.exec(cmd, opts) + return utils.exec(cmd, {env}) .then((result) => { logger.complete(`Installed ${pluginKey}`); return result; diff --git a/global/certbot-dns-plugins.json b/global/certbot-dns-plugins.json index 87e1de60..9f878809 100644 --- a/global/certbot-dns-plugins.json +++ b/global/certbot-dns-plugins.json @@ -477,10 +477,7 @@ "version": "~=0.2.1", "dependencies": "PyYAML==5.3.1", "credentials": "dns_powerdns_api_url = https://api.mypowerdns.example.org\ndns_powerdns_api_key = AbCbASsd!@34", - "full_plugin_name": "dns-powerdns", - "env": { - "SETUPTOOLS_USE_DISTUTILS": "stdlib" - } + "full_plugin_name": "dns-powerdns" }, "regru": { "name": "reg.ru",