Skip to content

v2.8.1 #955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2357354
Bump ini from 1.3.5 to 1.3.8 in /frontend
dependabot[bot] Jan 6, 2021
fe13b12
Removed the need to restart Nginx Proxy Manager after generating JWT …
jlesage Feb 8, 2021
6df7b72
Forward scheme and http code added for redirection hosts
baruffaldi Feb 9, 2021
8ba6c4f
Added http_code definition
baruffaldi Feb 10, 2021
e35138e
Added scheme to definitions
baruffaldi Feb 10, 2021
ebeda63
Globalization done
baruffaldi Feb 10, 2021
77a2ee9
Updated list table
baruffaldi Feb 10, 2021
329d0ec
Added forward scheme to table columns
baruffaldi Feb 10, 2021
1f122e9
Database migrations created
baruffaldi Feb 10, 2021
eb20add
Migrations hotfix
baruffaldi Feb 10, 2021
9b83d35
Migrations
baruffaldi Feb 10, 2021
49b0f11
migrations
baruffaldi Feb 10, 2021
4060718
Hotfix: This group of assignments is not aligned
baruffaldi Feb 10, 2021
49fbf03
$scheme is displayed as "auto" on hosts listing
baruffaldi Feb 10, 2021
7e7032c
Prevent activating nginx config after editing disabled proxy host
ogarai Feb 18, 2021
7f243e6
Bump prismjs from 1.21.0 to 1.23.0 in /docs
dependabot[bot] Mar 1, 2021
cfcb657
Bump elliptic from 6.5.3 to 6.5.4 in /frontend
dependabot[bot] Mar 10, 2021
1e5d9df
Bump elliptic from 6.5.3 to 6.5.4 in /docs
dependabot[bot] Mar 10, 2021
afbec0a
Fix CI, use docker for a yarn command
jc21 Mar 10, 2021
bb5fc58
Revert "Fix CI, use docker for a yarn command"
jc21 Mar 10, 2021
607fb83
Added transIP certbot dns plugin
nielscil Mar 11, 2021
bd0324d
credentials property naming for transip
nielscil Mar 11, 2021
967e0dd
Update README.md
phantomski77 Mar 11, 2021
ead1991
Add ACME-DNS certbot plugin
ijaron Mar 12, 2021
1c64252
Update _hsts.conf template
phantomski77 Mar 13, 2021
f29ff15
Update README.md
GurjinderSingh Mar 14, 2021
e2e3109
Fix CI, no var needed for this
jc21 Mar 16, 2021
3bf1c1e
Merge pull request #948 from GurjinderSingh/patch-1
jc21 Mar 16, 2021
9951446
Merge pull request #946 from ijaron/dns-acme
jc21 Mar 16, 2021
5bf774b
Merge branch 'develop' into develop-certbot-dns-transip
jc21 Mar 16, 2021
9bb68ad
Merge pull request #937 from jc21/dependabot/npm_and_yarn/docs/ellipt…
jc21 Mar 16, 2021
9c39de3
Merge pull request #935 from jc21/dependabot/npm_and_yarn/frontend/el…
jc21 Mar 16, 2021
1fe9e24
Merge pull request #920 from jc21/dependabot/npm_and_yarn/docs/prismj…
jc21 Mar 16, 2021
e4988f3
Merge pull request #943 from phantomski77/patch-1
jc21 Mar 16, 2021
9469b9c
fixed closing brace
nielscil Mar 16, 2021
d0a0c77
acmedns indentation fix
nielscil Mar 16, 2021
b7fb2cf
Merge pull request #947 from phantomski77/patch-2
jc21 Mar 16, 2021
d36dbb8
Merge pull request #942 from nielscil/develop-certbot-dns-transip
jc21 Mar 16, 2021
c9c53d9
Merge pull request #903 from ogarai/edit-disabled-host
jc21 Mar 16, 2021
b127f02
Added upgrade steps
jc21 Mar 16, 2021
6e67352
Merge pull request #880 from jlesage/jwt-key-pair-no-restart
jc21 Mar 17, 2021
74db000
Merge pull request #883 from baruffaldi/master
jc21 Mar 17, 2021
3b10471
Restrict redirect http code
jc21 Mar 17, 2021
4eddb5d
Merge pull request #769 from jc21/dependabot/npm_and_yarn/frontend/in…
jc21 Mar 17, 2021
ba5f0c2
Bumped version
jc21 Mar 17, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.0
2.8.1
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ pipeline {
always {
sh 'docker-compose down --rmi all --remove-orphans --volumes -t 30'
sh 'echo Reverting ownership'
sh 'docker run --rm -v $(pwd):/data ${DOCKER_CI_TOOLS} chown -R $(id -u):$(id -g) /data'
sh 'docker run --rm -v $(pwd):/data jc21/ci-tools chown -R $(id -u):$(id -g) /data'
}
success {
juxtapose event: 'success'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<img src="https://nginxproxymanager.com/github.png">
<br><br>
<img src="https://img.shields.io/badge/version-2.8.0-green.svg?style=for-the-badge">
<img src="https://img.shields.io/badge/version-2.8.1-green.svg?style=for-the-badge">
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
</a>
Expand Down
4 changes: 4 additions & 0 deletions backend/internal/proxy-host.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ const internalProxyHost = {
expand: ['owner', 'certificate', 'access_list.[clients,items]']
})
.then((row) => {
if (!row.enabled) {
// No need to add nginx config if host is disabled
return row;
}
// Configure nginx
return internalNginx.configure(proxyHostModel, 'proxy_host', row)
.then((new_meta) => {
Expand Down
41 changes: 41 additions & 0 deletions backend/migrations/20210210154702_redirection_scheme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const migrate_name = 'redirection_scheme';
const logger = require('../logger').migrate;

/**
* Migrate
*
* @see http://knexjs.org/#Schema
*
* @param {Object} knex
* @param {Promise} Promise
* @returns {Promise}
*/
exports.up = function (knex/*, Promise*/) {

logger.info('[' + migrate_name + '] Migrating Up...');

return knex.schema.table('redirection_host', (table) => {
table.string('forward_scheme').notNull().defaultTo('$scheme');
})
.then(function () {
logger.info('[' + migrate_name + '] redirection_host Table altered');
});
};

/**
* Undo Migrate
*
* @param {Object} knex
* @param {Promise} Promise
* @returns {Promise}
*/
exports.down = function (knex/*, Promise*/) {
logger.info('[' + migrate_name + '] Migrating Down...');

return knex.schema.table('redirection_host', (table) => {
table.dropColumn('forward_scheme');
})
.then(function () {
logger.info('[' + migrate_name + '] redirection_host Table altered');
});
};
41 changes: 41 additions & 0 deletions backend/migrations/20210210154703_redirection_status_code.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const migrate_name = 'redirection_status_code';
const logger = require('../logger').migrate;

/**
* Migrate
*
* @see http://knexjs.org/#Schema
*
* @param {Object} knex
* @param {Promise} Promise
* @returns {Promise}
*/
exports.up = function (knex/*, Promise*/) {

logger.info('[' + migrate_name + '] Migrating Up...');

return knex.schema.table('redirection_host', (table) => {
table.integer('forward_http_code').notNull().unsigned().defaultTo(302);
})
.then(function () {
logger.info('[' + migrate_name + '] redirection_host Table altered');
});
};

/**
* Undo Migrate
*
* @param {Object} knex
* @param {Promise} Promise
* @returns {Promise}
*/
exports.down = function (knex/*, Promise*/) {
logger.info('[' + migrate_name + '] Migrating Down...');

return knex.schema.table('redirection_host', (table) => {
table.dropColumn('forward_http_code');
})
.then(function () {
logger.info('[' + migrate_name + '] redirection_host Table altered');
});
};
17 changes: 14 additions & 3 deletions backend/models/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@
*/

const _ = require('lodash');
const config = require('config');
const jwt = require('jsonwebtoken');
const crypto = require('crypto');
const error = require('../lib/error');
const ALGO = 'RS256';

let public_key = null;
let private_key = null;

function checkJWTKeyPair() {
if (!public_key || !private_key) {
let config = require('config');
public_key = config.get('jwt.pub');
private_key = config.get('jwt.key');
}
}

module.exports = function () {
const public_key = config.get('jwt.pub');
const private_key = config.get('jwt.key');

let token_data = {};

Expand All @@ -32,6 +40,8 @@ module.exports = function () {
.toString('base64')
.substr(-8);

checkJWTKeyPair();

return new Promise((resolve, reject) => {
jwt.sign(payload, private_key, options, (err, token) => {
if (err) {
Expand All @@ -53,6 +63,7 @@ module.exports = function () {
*/
load: function (token) {
return new Promise((resolve, reject) => {
checkJWTKeyPair();
try {
if (!token || token === null || token === 'null') {
reject(new error.AuthError('Empty token'));
Expand Down
13 changes: 13 additions & 0 deletions backend/schema/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,19 @@
"pattern": "^(?:\\*\\.)?(?:[^.*]+\\.?)+[^.]$"
}
},
"http_code": {
"description": "Redirect HTTP Status Code",
"example": 302,
"type": "integer",
"minimum": 300,
"maximum": 308
},
"scheme": {
"description": "RFC Protocol",
"example": "HTTPS or $scheme",
"type": "string",
"minLength": 4
},
"enabled": {
"description": "Is Enabled",
"example": true,
Expand Down
26 changes: 26 additions & 0 deletions backend/schema/endpoints/redirection-hosts.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
"domain_names": {
"$ref": "../definitions.json#/definitions/domain_names"
},
"forward_http_code": {
"$ref": "../definitions.json#/definitions/http_code"
},
"forward_scheme": {
"$ref": "../definitions.json#/definitions/scheme"
},
"forward_domain_name": {
"$ref": "../definitions.json#/definitions/domain_name"
},
Expand Down Expand Up @@ -67,6 +73,12 @@
"domain_names": {
"$ref": "#/definitions/domain_names"
},
"forward_http_code": {
"$ref": "#/definitions/forward_http_code"
},
"forward_scheme": {
"$ref": "#/definitions/forward_scheme"
},
"forward_domain_name": {
"$ref": "#/definitions/forward_domain_name"
},
Expand Down Expand Up @@ -134,12 +146,20 @@
"additionalProperties": false,
"required": [
"domain_names",
"forward_scheme",
"forward_http_code",
"forward_domain_name"
],
"properties": {
"domain_names": {
"$ref": "#/definitions/domain_names"
},
"forward_http_code": {
"$ref": "#/definitions/forward_http_code"
},
"forward_scheme": {
"$ref": "#/definitions/forward_scheme"
},
"forward_domain_name": {
"$ref": "#/definitions/forward_domain_name"
},
Expand Down Expand Up @@ -195,6 +215,12 @@
"domain_names": {
"$ref": "#/definitions/domain_names"
},
"forward_http_code": {
"$ref": "#/definitions/forward_http_code"
},
"forward_scheme": {
"$ref": "#/definitions/forward_scheme"
},
"forward_domain_name": {
"$ref": "#/definitions/forward_domain_name"
},
Expand Down
5 changes: 2 additions & 3 deletions backend/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ const setupJwt = () => {
reject(err);
} else {
logger.info('Wrote JWT key pair to config file: ' + filename);

logger.warn('Restarting interface to apply new configuration');
process.exit(0);
delete require.cache[require.resolve('config')];
resolve();
}
});
} else {
Expand Down
6 changes: 3 additions & 3 deletions backend/templates/_hsts.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% if certificate and certificate_id > 0 -%}
{% if ssl_forced == 1 or ssl_forced == true %}
{% if hsts_enabled == 1 or hsts_enabled == true %}
# HSTS (ngx_http_headers_module is required) (31536000 seconds = 1 year)
add_header Strict-Transport-Security "max-age=31536000;{% if hsts_subdomains == 1 or hsts_subdomains == true -%} includeSubDomains;{% endif %} preload" always;
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security "max-age=63072000;{% if hsts_subdomains == 1 or hsts_subdomains == true -%} includeSubDomains;{% endif %} preload" always;
{% endif %}
{% endif %}
{% endif %}
{% endif %}
4 changes: 2 additions & 2 deletions backend/templates/redirection_host.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ server {
{% include "_hsts.conf" %}

{% if preserve_path == 1 or preserve_path == true %}
return 301 $scheme://{{ forward_domain_name }}$request_uri;
return {{ forward_http_code }} {{ forward_scheme }}://{{ forward_domain_name }}$request_uri;
{% else %}
return 301 $scheme://{{ forward_domain_name }};
return {{ forward_http_code }} {{ forward_scheme }}://{{ forward_domain_name }};
{% endif %}
}
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module.exports = {
["/screenshots/", "Screenshots"],
["/setup/", "Setup Instructions"],
["/advanced-config/", "Advanced Configuration"],
["/upgrading/", "Upgrading"],
["/faq/", "Frequently Asked Questions"],
["/third-party/", "Third Party"]
]
Expand Down
12 changes: 12 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,15 @@ Password: changeme
```

Immediately after logging in with this default user you will be asked to modify your details and change your password.

5. Upgrading to new versions

```bash
docker-compose pull
docker-compose up -d
```

This project will automatically update any databases or other requirements so you don't have to follow
any crazy instructions. These steps above will pull the latest updates and recreate the docker
containers.

6 changes: 6 additions & 0 deletions docs/advanced-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ services:
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
secrets:
- MYSQL_PWD
depends_on:
- db
db:
Expand All @@ -106,6 +108,9 @@ services:
MYSQL_PASSWORD__FILE: /run/secrets/MYSQL_PWD
volumes:
- ./data/mysql:/var/lib/mysql
secrets:
- DB_ROOT_PWD
- MYSQL_PWD
```


Expand All @@ -132,6 +137,7 @@ NPM has the ability to include different custom configuration snippets in differ
You can add your custom configuration snippet files at `/data/nginx/custom` as follow:

- `/data/nginx/custom/root.conf`: Included at the very end of nginx.conf
- `/data/nginx/custom/http_top.conf`: Included at the top of the main http block
- `/data/nginx/custom/http.conf`: Included at the end of the main http block
- `/data/nginx/custom/stream.conf`: Included at the end of the main stream block
- `/data/nginx/custom/server_proxy.conf`: Included at the end of every proxy server block
Expand Down
11 changes: 11 additions & 0 deletions docs/upgrading/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Upgrading

```bash
docker-compose pull
docker-compose up -d
```

This project will automatically update any databases or other requirements so you don't have to follow
any crazy instructions. These steps above will pull the latest updates and recreate the docker
containers.

Loading