File tree 2 files changed +5
-18
lines changed
2 files changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -874,12 +874,8 @@ const internalCertificate = {
874
874
// Escape single quotes and backslashes
875
875
const escapedCredentials = certificate . meta . dns_provider_credentials . replaceAll ( '\'' , '\\\'' ) . replaceAll ( '\\' , '\\\\' ) ;
876
876
const credentialsCmd = 'mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo \'' + escapedCredentials + '\' > \'' + credentialsLocation + '\' && chmod 600 \'' + credentialsLocation + '\'' ;
877
- let prepareCmd = 'pip install ' + dns_plugin . package_name + ( dns_plugin . version_requirement || '' ) + ' ' + dns_plugin . dependencies ;
878
-
879
- // Special case for cloudflare
880
- if ( dns_plugin . package_name === 'certbot-dns-cloudflare' ) {
881
- prepareCmd = 'pip install certbot-dns-cloudflare --index-url https://www.piwheels.org/simple --prefer-binary' ;
882
- }
877
+ // we call `. /opt/certbot/bin/activate` (`.` is alternative to `source` in dash) to access certbot venv
878
+ let prepareCmd = '. /opt/certbot/bin/activate && pip install ' + dns_plugin . package_name + ( dns_plugin . version_requirement || '' ) + ' ' + dns_plugin . dependencies + " && deactivate" ;
883
879
884
880
// Whether the plugin has a --<name>-credentials argument
885
881
const hasConfigArg = certificate . meta . dns_provider !== 'route53' ;
Original file line number Diff line number Diff line change @@ -171,18 +171,13 @@ const setupCertbotPlugins = () => {
171
171
if ( certificates && certificates . length ) {
172
172
let plugins = [ ] ;
173
173
let promises = [ ] ;
174
- let install_cloudflare_plugin = false ;
175
174
176
175
certificates . map ( function ( certificate ) {
177
176
if ( certificate . meta && certificate . meta . dns_challenge === true ) {
178
177
const dns_plugin = dns_plugins [ certificate . meta . dns_provider ] ;
179
178
180
- if ( dns_plugin . package_name === 'certbot-dns-cloudflare' ) {
181
- install_cloudflare_plugin = true ;
182
- } else {
183
- const packages_to_install = `${ dns_plugin . package_name } ${ dns_plugin . version_requirement || '' } ${ dns_plugin . dependencies } ` ;
184
- if ( plugins . indexOf ( packages_to_install ) === - 1 ) plugins . push ( packages_to_install ) ;
185
- }
179
+ const packages_to_install = `${ dns_plugin . package_name } ${ dns_plugin . version_requirement || '' } ${ dns_plugin . dependencies } ` ;
180
+ if ( plugins . indexOf ( packages_to_install ) === - 1 ) plugins . push ( packages_to_install ) ;
186
181
187
182
// Make sure credentials file exists
188
183
const credentials_loc = '/etc/letsencrypt/credentials/credentials-' + certificate . id ;
@@ -194,14 +189,10 @@ const setupCertbotPlugins = () => {
194
189
} ) ;
195
190
196
191
if ( plugins . length ) {
197
- const install_cmd = 'pip install ' + plugins . join ( ' ' ) ;
192
+ const install_cmd = '. /opt/certbot/bin/activate && pip install ' + plugins . join ( ' ' ) + " && deactivate" ;
198
193
promises . push ( utils . exec ( install_cmd ) ) ;
199
194
}
200
195
201
- if ( install_cloudflare_plugin ) {
202
- promises . push ( utils . exec ( 'pip install certbot-dns-cloudflare --index-url https://www.piwheels.org/simple --prefer-binary' ) ) ;
203
- }
204
-
205
196
if ( promises . length ) {
206
197
return Promise . all ( promises )
207
198
. then ( ( ) => {
You can’t perform that action at this time.
0 commit comments