Skip to content

Commit dbd34bc

Browse files
authored
Merge branch 'NginxProxyManager:master' into master
2 parents 837c158 + 356eaa0 commit dbd34bc

38 files changed

+1028
-560
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.12.3
1+
2.12.6

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.3-green.svg?style=for-the-badge">
4+
<img src="https://img.shields.io/badge/version-2.12.6-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/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
const schema = require('./schema');
44
const logger = require('./logger').global;
55

6+
const IP_RANGES_FETCH_ENABLED = process.env.IP_RANGES_FETCH_ENABLED !== 'false';
7+
68
async function appStart () {
79
const migrate = require('./migrate');
810
const setup = require('./setup');
@@ -13,7 +15,16 @@ async function appStart () {
1315
return migrate.latest()
1416
.then(setup)
1517
.then(schema.getCompiledSchema)
16-
.then(internalIpRanges.fetch)
18+
.then(() => {
19+
if (IP_RANGES_FETCH_ENABLED) {
20+
logger.info('IP Ranges fetch is enabled');
21+
return internalIpRanges.fetch().catch((err) => {
22+
logger.error('IP Ranges fetch failed, continuing anyway:', err.message);
23+
});
24+
} else {
25+
logger.info('IP Ranges fetch is disabled by environment variable');
26+
}
27+
})
1728
.then(() => {
1829
internalCertificate.initTimer();
1930
internalIpRanges.initTimer();

backend/internal/stream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ const internalStream = {
375375
.where('is_deleted', 0)
376376
.groupBy('id')
377377
.allowGraph('[owner,certificate]')
378-
.orderByRaw('CAST(incoming_port AS INTEGER) ASC');
378+
.orderBy('incoming_port', 'ASC');
379379

380380
if (access_data.permission_visibility !== 'all') {
381381
query.andWhere('owner_user_id', access.token.getUserId(1));

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
/**

backend/models/dead_host.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ Model.knex(db);
1212

1313
const boolFields = [
1414
'is_deleted',
15+
'ssl_forced',
16+
'http2_support',
1517
'enabled',
18+
'hsts_enabled',
19+
'hsts_subdomains',
1620
];
1721

1822
class DeadHost extends Model {

backend/models/stream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const now = require('./now_helper');
88
Model.knex(db);
99

1010
const boolFields = [
11-
'enabled',
1211
'is_deleted',
12+
'enabled',
1313
'tcp_forwarding',
1414
'udp_forwarding',
1515
];

backend/routes/users.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ router
181181
return internalUser.setPassword(res.locals.access, payload);
182182
})
183183
.then((result) => {
184-
res.status(201)
184+
res.status(200)
185185
.send(result);
186186
})
187187
.catch(next);
@@ -212,7 +212,7 @@ router
212212
return internalUser.setPermissions(res.locals.access, payload);
213213
})
214214
.then((result) => {
215-
res.status(201)
215+
res.status(200)
216216
.send(result);
217217
})
218218
.catch(next);
@@ -238,7 +238,7 @@ router
238238
.post((req, res, next) => {
239239
internalUser.loginAs(res.locals.access, {id: parseInt(req.params.user_id, 10)})
240240
.then((result) => {
241-
res.status(201)
241+
res.status(200)
242242
.send(result);
243243
})
244244
.catch(next);

0 commit comments

Comments
 (0)