Skip to content

Commit cc6d249

Browse files
authored
Merge branch 'NginxProxyManager:develop' into develop
2 parents 54864f4 + 2a06384 commit cc6d249

File tree

42 files changed

+1516
-1105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1516
-1105
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.9.21
1+
2.10.3

Jenkinsfile

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ pipeline {
1414
ansiColor('xterm')
1515
}
1616
environment {
17-
IMAGE = "nginx-proxy-manager"
17+
IMAGE = 'nginx-proxy-manager'
1818
BUILD_VERSION = getVersion()
19-
MAJOR_VERSION = "2"
19+
MAJOR_VERSION = '2'
2020
BRANCH_LOWER = "${BRANCH_NAME.toLowerCase().replaceAll('/', '-')}"
2121
COMPOSE_PROJECT_NAME = "npm_${BRANCH_LOWER}_${BUILD_NUMBER}"
2222
COMPOSE_FILE = 'docker/docker-compose.ci.yml'
@@ -90,20 +90,24 @@ pipeline {
9090
steps {
9191
// Bring up a stack
9292
sh 'docker-compose up -d fullstack-sqlite'
93-
sh './scripts/wait-healthy $(docker-compose ps -q fullstack-sqlite) 120'
93+
sh './scripts/wait-healthy $(docker-compose ps --all -q fullstack-sqlite) 120'
94+
// Stop and Start it, as this will test it's ability to restart with existing data
95+
sh 'docker-compose stop fullstack-sqlite'
96+
sh 'docker-compose start fullstack-sqlite'
97+
sh './scripts/wait-healthy $(docker-compose ps --all -q fullstack-sqlite) 120'
9498

9599
// Run tests
96100
sh 'rm -rf test/results'
97101
sh 'docker-compose up cypress-sqlite'
98102
// Get results
99-
sh 'docker cp -L "$(docker-compose ps -q cypress-sqlite):/test/results" test/'
103+
sh 'docker cp -L "$(docker-compose ps --all -q cypress-sqlite):/test/results" test/'
100104
}
101105
post {
102106
always {
103107
// Dumps to analyze later
104108
sh 'mkdir -p debug'
105-
sh 'docker-compose logs fullstack-sqlite | gzip > debug/docker_fullstack_sqlite.log.gz'
106-
sh 'docker-compose logs db | gzip > debug/docker_db.log.gz'
109+
sh 'docker-compose logs fullstack-sqlite > debug/docker_fullstack_sqlite.log'
110+
sh 'docker-compose logs db > debug/docker_db.log'
107111
// Cypress videos and screenshot artifacts
108112
dir(path: 'test/results') {
109113
archiveArtifacts allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml'
@@ -116,20 +120,20 @@ pipeline {
116120
steps {
117121
// Bring up a stack
118122
sh 'docker-compose up -d fullstack-mysql'
119-
sh './scripts/wait-healthy $(docker-compose ps -q fullstack-mysql) 120'
123+
sh './scripts/wait-healthy $(docker-compose ps --all -q fullstack-mysql) 120'
120124

121125
// Run tests
122126
sh 'rm -rf test/results'
123127
sh 'docker-compose up cypress-mysql'
124128
// Get results
125-
sh 'docker cp -L "$(docker-compose ps -q cypress-mysql):/test/results" test/'
129+
sh 'docker cp -L "$(docker-compose ps --all -q cypress-mysql):/test/results" test/'
126130
}
127131
post {
128132
always {
129133
// Dumps to analyze later
130134
sh 'mkdir -p debug'
131-
sh 'docker-compose logs fullstack-mysql | gzip > debug/docker_fullstack_mysql.log.gz'
132-
sh 'docker-compose logs db | gzip > debug/docker_db.log.gz'
135+
sh 'docker-compose logs fullstack-mysql > debug/docker_fullstack_mysql.log'
136+
sh 'docker-compose logs db > debug/docker_db.log'
133137
// Cypress videos and screenshot artifacts
134138
dir(path: 'test/results') {
135139
archiveArtifacts allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml'

README.md

Lines changed: 4 additions & 2 deletions
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.9.19-green.svg?style=for-the-badge">
4+
<img src="https://img.shields.io/badge/version-2.10.3-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>
@@ -56,7 +56,7 @@ I won't go in to too much detail here but here are the basics for someone new to
5656
2. Create a docker-compose.yml file similar to this:
5757

5858
```yml
59-
version: '3'
59+
version: '3.8'
6060
services:
6161
app:
6262
image: 'jc21/nginx-proxy-manager:latest'
@@ -70,6 +70,8 @@ services:
7070
- ./letsencrypt:/etc/letsencrypt
7171
```
7272
73+
This is the bare minimum configuration required. See the [documentation](https://nginxproxymanager.com/setup/) for more.
74+
7375
3. Bring up your stack by running
7476
7577
```bash

backend/app.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const express = require('express');
22
const bodyParser = require('body-parser');
33
const fileUpload = require('express-fileupload');
44
const compression = require('compression');
5+
const config = require('./lib/config');
56
const log = require('./logger').express;
67

78
/**
@@ -24,7 +25,7 @@ app.enable('trust proxy', ['loopback', 'linklocal', 'uniquelocal']);
2425
app.enable('strict routing');
2526

2627
// pretty print JSON when not live
27-
if (process.env.NODE_ENV !== 'production') {
28+
if (config.debug()) {
2829
app.set('json spaces', 2);
2930
}
3031

@@ -65,7 +66,7 @@ app.use(function (err, req, res, next) {
6566
}
6667
};
6768

68-
if (process.env.NODE_ENV === 'development' || (req.baseUrl + req.path).includes('nginx/certificates')) {
69+
if (config.debug() || (req.baseUrl + req.path).includes('nginx/certificates')) {
6970
payload.debug = {
7071
stack: typeof err.stack !== 'undefined' && err.stack ? err.stack.split('\n') : null,
7172
previous: err.previous
@@ -74,7 +75,7 @@ app.use(function (err, req, res, next) {
7475

7576
// Not every error is worth logging - but this is good for now until it gets annoying.
7677
if (typeof err.stack !== 'undefined' && err.stack) {
77-
if (process.env.NODE_ENV === 'development' || process.env.DEBUG) {
78+
if (config.debug()) {
7879
log.debug(err.stack);
7980
} else if (typeof err.public == 'undefined' || !err.public) {
8081
log.warn(err.message);

backend/db.js

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
1-
const config = require('config');
1+
const config = require('./lib/config');
22

33
if (!config.has('database')) {
4-
throw new Error('Database config does not exist! Please read the instructions: https://github.com/jc21/nginx-proxy-manager/blob/master/doc/INSTALL.md');
4+
throw new Error('Database config does not exist! Please read the instructions: https://nginxproxymanager.com/setup/');
55
}
66

77
function generateDbConfig() {
8-
if (config.database.engine === 'knex-native') {
9-
return config.database.knex;
10-
} else
11-
return {
12-
client: config.database.engine,
13-
connection: {
14-
host: config.database.host,
15-
user: config.database.user,
16-
password: config.database.password,
17-
database: config.database.name,
18-
port: config.database.port
19-
},
20-
migrations: {
21-
tableName: 'migrations'
22-
}
23-
};
8+
const cfg = config.get('database');
9+
if (cfg.engine === 'knex-native') {
10+
return cfg.knex;
11+
}
12+
return {
13+
client: cfg.engine,
14+
connection: {
15+
host: cfg.host,
16+
user: cfg.user,
17+
password: cfg.password,
18+
database: cfg.name,
19+
port: cfg.port
20+
},
21+
migrations: {
22+
tableName: 'migrations'
23+
}
24+
};
2425
}
2526

26-
27-
let data = generateDbConfig();
28-
29-
if (typeof config.database.version !== 'undefined') {
30-
data.version = config.database.version;
31-
}
32-
33-
module.exports = require('knex')(data);
27+
module.exports = require('knex')(generateDbConfig());

0 commit comments

Comments
 (0)