Skip to content

Commit ed1d90e

Browse files
committed
Fix powerdns dns plugin install, deps are outrageously old ;(
1 parent 70894e5 commit ed1d90e

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

backend/lib/certbot.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const certbot = {
1111
/**
1212
* @param {array} pluginKeys
1313
*/
14-
installPlugins: async function (pluginKeys) {
14+
installPlugins: async (pluginKeys) => {
1515
let hasErrors = false;
1616

1717
return new Promise((resolve, reject) => {
@@ -21,7 +21,7 @@ const certbot = {
2121
}
2222

2323
batchflow(pluginKeys).sequential()
24-
.each((i, pluginKey, next) => {
24+
.each((_i, pluginKey, next) => {
2525
certbot.installPlugin(pluginKey)
2626
.then(() => {
2727
next();
@@ -51,7 +51,7 @@ const certbot = {
5151
* @param {string} pluginKey
5252
* @returns {Object}
5353
*/
54-
installPlugin: async function (pluginKey) {
54+
installPlugin: async (pluginKey) => {
5555
if (typeof dnsPlugins[pluginKey] === 'undefined') {
5656
// throw Error(`Certbot plugin ${pluginKey} not found`);
5757
throw new error.ItemNotFoundError(pluginKey);
@@ -63,8 +63,14 @@ 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 cmd = '. /opt/certbot/bin/activate && pip install --no-cache-dir ' + plugin.dependencies + ' ' + plugin.package_name + plugin.version + ' ' + ' && deactivate';
67-
return utils.exec(cmd)
66+
const opts = {};
67+
if (typeof plugin.env === 'object') {
68+
// include process.env in opts
69+
opts.env = Object.assign({}, process.env, plugin.env);
70+
}
71+
72+
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)
6874
.then((result) => {
6975
logger.complete(`Installed ${pluginKey}`);
7076
return result;

global/certbot-dns-plugins.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,10 @@
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"
480+
"full_plugin_name": "dns-powerdns",
481+
"env": {
482+
"SETUPTOOLS_USE_DISTUTILS": "stdlib"
483+
}
481484
},
482485
"regru": {
483486
"name": "reg.ru",

0 commit comments

Comments
 (0)