Skip to content

Commit 4fef9b5

Browse files
committed
Adjusted the way pip is invoked.
1 parent a1fe8d7 commit 4fef9b5

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/nginx-proxy-manager/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ curl -# -L -f ${NGINX_PROXY_MANAGER_URL} | tar xz --strip 1 -C /tmp/nginx-proxy-
7373
sed -i "s/\"version\": \"0.0.0\",/\"version\": \"${NGINX_PROXY_MANAGER_VERSION}\",/" /tmp/nginx-proxy-manager/frontend/package.json
7474
sed -i "s/\"version\": \"0.0.0\",/\"version\": \"${NGINX_PROXY_MANAGER_VERSION}\",/" /tmp/nginx-proxy-manager/backend/package.json
7575

76+
log "Patching Nginx Proxy Manager backend..."
77+
patch -p1 -d /tmp/nginx-proxy-manager < "$SCRIPT_DIR"/pip-install.patch
78+
7679
cp -r /tmp/nginx-proxy-manager /app
7780

7881
log "Building Nginx Proxy Manager frontend..."
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/backend/internal/certificate.js b/backend/internal/certificate.js
2+
index da104a2..730d826 100644
3+
--- a/backend/internal/certificate.js
4+
+++ b/backend/internal/certificate.js
5+
@@ -871,7 +871,7 @@ const internalCertificate = {
6+
const escapedCredentials = certificate.meta.dns_provider_credentials.replaceAll('\'', '\\\'').replaceAll('\\', '\\\\');
7+
const credentialsCmd = 'mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo \'' + escapedCredentials + '\' > \'' + credentialsLocation + '\' && chmod 600 \'' + credentialsLocation + '\'';
8+
// we call `. /opt/certbot/bin/activate` (`.` is alternative to `source` in dash) to access certbot venv
9+
- let prepareCmd = '. /opt/certbot/bin/activate && pip install ' + dns_plugin.package_name + (dns_plugin.version_requirement || '') + ' ' + dns_plugin.dependencies + ' && deactivate';
10+
+ let prepareCmd = 'pip install ' + dns_plugin.package_name + (dns_plugin.version_requirement || '') + ' ' + dns_plugin.dependencies;
11+
12+
// Whether the plugin has a --<name>-credentials argument
13+
const hasConfigArg = certificate.meta.dns_provider !== 'route53';
14+
diff --git a/backend/setup.js b/backend/setup.js
15+
index a4b51c9..6d3d3e3 100644
16+
--- a/backend/setup.js
17+
+++ b/backend/setup.js
18+
@@ -189,7 +189,7 @@ const setupCertbotPlugins = () => {
19+
});
20+
21+
if (plugins.length) {
22+
- const install_cmd = '. /opt/certbot/bin/activate && pip install ' + plugins.join(' ') + ' && deactivate';
23+
+ const install_cmd = 'pip install ' + plugins.join(' ');
24+
promises.push(utils.exec(install_cmd));
25+
}
26+

0 commit comments

Comments
 (0)