Browse Source

Always install additional dependencies for dns plugins

chaptergy 5 years ago
parent
commit
60a40197f1

+ 1 - 1
backend/internal/certificate.js

@@ -790,7 +790,7 @@ const internalCertificate = {
 
 		const credentials_loc = '/etc/letsencrypt/credentials/credentials-' + certificate.id;
 		const credentials_cmd = 'echo \'' + certificate.meta.dns_provider_credentials.replace('\'', '\\\'') + '\' > \'' + credentials_loc + '\' && chmod 600 \'' + credentials_loc + '\'';
-		const prepare_cmd     = 'pip3 install ' + dns_plugin.package_name + '==' + dns_plugin.package_version;
+		const prepare_cmd     = 'pip3 install ' + dns_plugin.package_name + '==' + dns_plugin.package_version + ' ' + dns_plugin.dependencies;
 
 		// Whether the plugin has a --<name>-credentials argument
 		const has_config_arg = certificate.meta.dns_provider !== 'route53';

+ 2 - 2
backend/setup.js

@@ -176,9 +176,9 @@ const setupCertbotPlugins = () => {
 				certificates.map(function (certificate) {
 					if (certificate.meta && certificate.meta.dns_challenge === true) {
 						const dns_plugin         = dns_plugins[certificate.meta.dns_provider];
-						const package_to_install = `${dns_plugin.package_name}==${dns_plugin.package_version}`;
+						const packages_to_install = `${dns_plugin.package_name}==${dns_plugin.package_version} ${dns_plugin.dependencies}`;
 
-						if (plugins.indexOf(package_to_install) === -1) plugins.push(package_to_install);
+						if (plugins.indexOf(packages_to_install) === -1) plugins.push(packages_to_install);
 
 						// Make sure credentials file exists
 						const credentials_loc = '/etc/letsencrypt/credentials/credentials-' + certificate.id; 

+ 1 - 0
docker/Dockerfile

@@ -38,6 +38,7 @@ COPY global							/app/global
 
 WORKDIR /app
 RUN yarn install
+RUN mkdir -p /etc/letsencrypt/credentials
 
 # Remove frontend service not required for prod, dev nginx config as well
 RUN rm -rf /etc/services.d/frontend RUN rm -f /etc/nginx/conf.d/dev.conf

+ 1 - 0
docker/dev/Dockerfile

@@ -18,6 +18,7 @@ RUN cd /usr \
 
 COPY rootfs /
 RUN rm -f /etc/nginx/conf.d/production.conf
+RUN mkdir -p /etc/letsencrypt/credentials
 
 # s6 overlay
 RUN curl -L -o /tmp/s6-overlay-amd64.tar.gz "https://github.com/just-containers/s6-overlay/releases/download/v1.22.1.0/s6-overlay-amd64.tar.gz" \

+ 1 - 1
global/certbot-dns-plugins.js

@@ -24,7 +24,7 @@ module.exports = {
 		display_name:     'Cloudflare',
 		package_name:     'certbot-dns-cloudflare',
 		package_version:  '1.8.0',
-		dependencies: 	  '',
+		dependencies: 	  'cloudflare',
 		credentials:      `# Cloudflare API token
 dns_cloudflare_api_token = 0123456789abcdef0123456789abcdef01234567`,
 		full_plugin_name: 'dns-cloudflare',