Add Custom PIP URL

This commit is contained in:
老周部落 2022-11-23 23:36:59 +08:00 committed by GitHub
parent aa08c440b9
commit 38e86afc56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -17,6 +17,7 @@ const certbotCommand = 'certbot';
const archiver = require('archiver');
const path = require('path');
const { isArray } = require('lodash');
const PIP_URL = process.env.PIP_URL !== '' ? process.env.PIP_URL : 'https://www.piwheels.org/simple';
function omissions() {
return ['is_deleted'];
@ -878,7 +879,7 @@ const internalCertificate = {
// Special case for cloudflare
if (dns_plugin.package_name === 'certbot-dns-cloudflare') {
prepareCmd = 'pip install certbot-dns-cloudflare --index-url https://www.piwheels.org/simple --prefer-binary';
prepareCmd = 'pip install certbot-dns-cloudflare --prefer-binary --index-url ' + PIP_URL;
}
// Whether the plugin has a --<name>-credentials argument

View file

@ -10,6 +10,7 @@ const authModel = require('./models/auth');
const settingModel = require('./models/setting');
const dns_plugins = require('./global/certbot-dns-plugins');
const debug_mode = process.env.NODE_ENV !== 'production' || !!process.env.DEBUG;
const PIP_URL = process.env.PIP_URL !== '' ? process.env.PIP_URL : 'https://www.piwheels.org/simple';
/**
* Creates a new JWT RSA Keypair if not alread set on the config
@ -199,7 +200,7 @@ const setupCertbotPlugins = () => {
}
if (install_cloudflare_plugin) {
promises.push(utils.exec('pip install certbot-dns-cloudflare --index-url https://www.piwheels.org/simple --prefer-binary'));
promises.push(utils.exec('pip install certbot-dns-cloudflare --prefer-binary --index-url ' + PIP_URL));
}
if (promises.length) {