Skip to content

Commit 5f54490

Browse files
committed
Set SETUPTOOLS_USE_DISTUTILS for all plugin installs, seems like they all need it.
1 parent c97b8a3 commit 5f54490

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

backend/lib/certbot.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@ const certbot = {
6363
plugin.version = plugin.version.replace(/{{certbot-version}}/g, CERTBOT_VERSION_REPLACEMENT);
6464
plugin.dependencies = plugin.dependencies.replace(/{{certbot-version}}/g, CERTBOT_VERSION_REPLACEMENT);
6565

66-
const opts = {};
66+
// SETUPTOOLS_USE_DISTUTILS is required for certbot plugins to install correctly
67+
// in new versions of Python
68+
let env = Object.assign({}, process.env, {SETUPTOOLS_USE_DISTUTILS: 'stdlib'});
6769
if (typeof plugin.env === 'object') {
68-
// include process.env in opts
69-
opts.env = Object.assign({}, process.env, plugin.env);
70+
env = Object.assign(env, plugin.env);
7071
}
7172

7273
const cmd = `. /opt/certbot/bin/activate && pip install --no-cache-dir ${plugin.dependencies} ${plugin.package_name}${plugin.version} && deactivate`;
73-
return utils.exec(cmd, opts)
74+
return utils.exec(cmd, {env})
7475
.then((result) => {
7576
logger.complete(`Installed ${pluginKey}`);
7677
return result;

global/certbot-dns-plugins.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,7 @@
477477
"version": "~=0.2.1",
478478
"dependencies": "PyYAML==5.3.1",
479479
"credentials": "dns_powerdns_api_url = https://api.mypowerdns.example.org\ndns_powerdns_api_key = AbCbASsd!@34",
480-
"full_plugin_name": "dns-powerdns",
481-
"env": {
482-
"SETUPTOOLS_USE_DISTUTILS": "stdlib"
483-
}
480+
"full_plugin_name": "dns-powerdns"
484481
},
485482
"regru": {
486483
"name": "reg.ru",

0 commit comments

Comments
 (0)