Skip to content

Commit 307cb94

Browse files
authored
Merge pull request #4651 from NginxProxyManager/develop
v2.12.5
2 parents b84762b + 63ae924 commit 307cb94

File tree

18 files changed

+90
-75
lines changed

18 files changed

+90
-75
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.12.4
1+
2.12.5

Jenkinsfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,17 @@ pipeline {
241241
}
242242
steps {
243243
script {
244-
npmGithubPrComment("""Docker Image for build ${BUILD_NUMBER} is available on
245-
[DockerHub](https://cloud.docker.com/repository/docker/nginxproxymanager/${IMAGE}-dev)
246-
as `nginxproxymanager/${IMAGE}-dev:${BRANCH_LOWER}`
244+
npmGithubPrComment("""Docker Image for build ${BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker/nginxproxymanager/${IMAGE}-dev):
245+
```
246+
nginxproxymanager/${IMAGE}-dev:${BRANCH_LOWER}
247+
```
247248
248-
**Note:** ensure you backup your NPM instance before testing this image! Especially if there are database changes
249-
**Note:** this is a different docker image namespace than the official image
249+
> [!NOTE]
250+
> Ensure you backup your NPM instance before testing this image! Especially if there are database changes.
251+
> This is a different docker image namespace than the official image.
252+
253+
> [!WARNING]
254+
> Changes and additions to DNS Providers require verification by at least 2 members of the community!
250255
""", true)
251256
}
252257
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<p align="center">
22
<img src="https://nginxproxymanager.com/github.png">
33
<br><br>
4-
<img src="https://img.shields.io/badge/version-2.12.4-green.svg?style=for-the-badge">
4+
<img src="https://img.shields.io/badge/version-2.12.5-green.svg?style=for-the-badge">
55
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
66
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
77
</a>

backend/lib/certbot.js

Lines changed: 12 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,15 @@ 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+
// SETUPTOOLS_USE_DISTUTILS is required for certbot plugins to install correctly
67+
// in new versions of Python
68+
let env = Object.assign({}, process.env, {SETUPTOOLS_USE_DISTUTILS: 'stdlib'});
69+
if (typeof plugin.env === 'object') {
70+
env = Object.assign(env, plugin.env);
71+
}
72+
73+
const cmd = `. /opt/certbot/bin/activate && pip install --no-cache-dir ${plugin.dependencies} ${plugin.package_name}${plugin.version} && deactivate`;
74+
return utils.exec(cmd, {env})
6875
.then((result) => {
6976
logger.complete(`Installed ${pluginKey}`);
7077
return result;

backend/lib/utils.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
const _ = require('lodash');
2-
const exec = require('child_process').exec;
3-
const execFile = require('child_process').execFile;
2+
const exec = require('node:child_process').exec;
3+
const execFile = require('node:child_process').execFile;
44
const { Liquid } = require('liquidjs');
55
const logger = require('../logger').global;
66
const error = require('./error');
77

88
module.exports = {
99

10-
exec: async function(cmd, options = {}) {
10+
exec: async (cmd, options = {}) => {
1111
logger.debug('CMD:', cmd);
1212

1313
const { stdout, stderr } = await new Promise((resolve, reject) => {
@@ -31,11 +31,11 @@ module.exports = {
3131
* @param {Array} args
3232
* @returns {Promise}
3333
*/
34-
execFile: function (cmd, args) {
34+
execFile: (cmd, args) => {
3535
// logger.debug('CMD: ' + cmd + ' ' + (args ? args.join(' ') : ''));
3636

3737
return new Promise((resolve, reject) => {
38-
execFile(cmd, args, function (err, stdout, /*stderr*/) {
38+
execFile(cmd, args, (err, stdout, /*stderr*/) => {
3939
if (err && typeof err === 'object') {
4040
reject(err);
4141
} else {
@@ -51,7 +51,7 @@ module.exports = {
5151
* @param {Array} omissions
5252
* @returns {Function}
5353
*/
54-
omitRow: function (omissions) {
54+
omitRow: (omissions) => {
5555
/**
5656
* @param {Object} row
5757
* @returns {Object}
@@ -67,7 +67,7 @@ module.exports = {
6767
* @param {Array} omissions
6868
* @returns {Function}
6969
*/
70-
omitRows: function (omissions) {
70+
omitRows: (omissions) => {
7171
/**
7272
* @param {Array} rows
7373
* @returns {Object}
@@ -83,9 +83,9 @@ module.exports = {
8383
/**
8484
* @returns {Object} Liquid render engine
8585
*/
86-
getRenderEngine: function () {
86+
getRenderEngine: () => {
8787
const renderEngine = new Liquid({
88-
root: __dirname + '/../templates/'
88+
root: `${__dirname}/../templates/`
8989
});
9090

9191
/**

docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/30-ownership.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@ chown -R "$PUID:$PGID" /etc/nginx/conf.d
2727
CERT_INIT_FLAG="/opt/certbot/.ownership_initialized"
2828

2929
if [ ! -f "$CERT_INIT_FLAG" ]; then
30-
# Prevents errors when installing python certbot plugins when non-root
31-
chown "$PUID:$PGID" /opt/certbot /opt/certbot/bin
32-
33-
# Handle all site-packages directories efficiently
34-
find /opt/certbot/lib -type d -name "site-packages" | while read -r SITE_PACKAGES_DIR; do
35-
chown -R "$PUID:$PGID" "$SITE_PACKAGES_DIR"
36-
done
37-
38-
# Create a flag file to skip this step on subsequent runs
39-
touch "$CERT_INIT_FLAG"
40-
chown "$PUID:$PGID" "$CERT_INIT_FLAG"
41-
fi
30+
# Prevents errors when installing python certbot plugins when non-root
31+
if [ "$SKIP_CERTBOT_OWNERSHIP" != "true" ]; then
32+
log_info 'Changing ownership of /opt/certbot directories ...'
33+
chown "$PUID:$PGID" /opt/certbot /opt/certbot/bin
34+
fi
35+
36+
# Handle all site-packages directories efficiently
37+
find /opt/certbot/lib -type d -name "site-packages" | while read -r SITE_PACKAGES_DIR; do
38+
chown -R "$PUID:$PGID" "$SITE_PACKAGES_DIR"
39+
done
40+
41+
# Create a flag file to skip this step on subsequent runs
42+
touch "$CERT_INIT_FLAG"
43+
chown "$PUID:$PGID" "$CERT_INIT_FLAG"
44+
fi

docker/scripts/install-s6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ BLUE='\E[1;34m'
88
GREEN='\E[1;32m'
99
RESET='\E[0m'
1010

11-
S6_OVERLAY_VERSION=3.2.0.2
11+
S6_OVERLAY_VERSION=3.2.1.0
1212
TARGETPLATFORM=${1:-linux/amd64}
1313

1414
# Determine the correct binary file for the architecture given

global/certbot-dns-plugins.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@
5656
"full_plugin_name": "dns-bunny"
5757
},
5858
"cdmon": {
59-
"name": "cdmon",
60-
"package_name": "certbot-dns-cdmon",
61-
"version": "~=0.4.1",
62-
"dependencies": "",
63-
"credentials": "dns_cdmon_api_key=your-cdmon-api-token\ndns_cdmon_domain=your_domain_is_optional",
64-
"full_plugin_name": "dns-cdmon"
65-
},
59+
"name": "cdmon",
60+
"package_name": "certbot-dns-cdmon",
61+
"version": "~=0.4.1",
62+
"dependencies": "",
63+
"credentials": "dns_cdmon_api_key=your-cdmon-api-token\ndns_cdmon_domain=your_domain_is_optional",
64+
"full_plugin_name": "dns-cdmon"
65+
},
6666
"cloudflare": {
6767
"name": "Cloudflare",
6868
"package_name": "certbot-dns-cloudflare",
6969
"version": "=={{certbot-version}}",
70-
"dependencies": "cloudflare==4.0.* acme=={{certbot-version}}",
71-
"credentials": "# Cloudflare API credentials used by Certbot\ndns_cloudflare_email = [email protected]\ndns_cloudflare_api_key = 0123456789abcdef0123456789abcdef01234",
70+
"dependencies": "acme=={{certbot-version}}",
71+
"credentials": "# Cloudflare API token\ndns_cloudflare_api_token=0123456789abcdef0123456789abcdef01234567",
7272
"full_plugin_name": "dns-cloudflare"
7373
},
7474
"cloudns": {

test/cypress/e2e/api/Certificates.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('Certificates endpoints', () => {
1010
});
1111
});
1212

13-
it('Validate custom certificate', function() {
13+
it('Validate custom certificate', () => {
1414
cy.task('backendApiPostFiles', {
1515
token: token,
1616
path: '/api/nginx/certificates/validate',
@@ -25,7 +25,7 @@ describe('Certificates endpoints', () => {
2525
});
2626
});
2727

28-
it('Custom certificate lifecycle', function() {
28+
it('Custom certificate lifecycle', () => {
2929
// Create custom cert
3030
cy.task('backendApiPost', {
3131
token: token,
@@ -73,7 +73,7 @@ describe('Certificates endpoints', () => {
7373
});
7474
});
7575

76-
it('Request Certificate - CVE-2024-46256/CVE-2024-46257', function() {
76+
it('Request Certificate - CVE-2024-46256/CVE-2024-46257', () => {
7777
cy.task('backendApiPost', {
7878
token: token,
7979
path: '/api/nginx/certificates',

test/cypress/e2e/api/Dashboard.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('Dashboard endpoints', () => {
99
});
1010
});
1111

12-
it('Should be able to get host counts', function() {
12+
it('Should be able to get host counts', () => {
1313
cy.task('backendApiGet', {
1414
token: token,
1515
path: '/api/reports/hosts'

0 commit comments

Comments
 (0)