Skip to content

Commit e923db7

Browse files
authored
Merge pull request #29 from jc21/develop
Http2 support
2 parents 9fd480c + e53d9fa commit e923db7

21 files changed

+194
-29
lines changed

Jenkinsfile

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,38 @@ pipeline {
1818
sh 'docker pull $DOCKER_CI_TOOLS'
1919
}
2020
}
21-
stage('Build') {
21+
stage('Build Develop') {
22+
when {
23+
branch 'develop'
24+
}
25+
steps {
26+
ansiColor('xterm') {
27+
// Codebase
28+
sh 'docker run --rm -v $(pwd):/app -w /app $BASE_IMAGE_NAME yarn install'
29+
sh 'docker run --rm -v $(pwd):/app -w /app $BASE_IMAGE_NAME npm run-script build'
30+
sh 'rm -rf node_modules'
31+
sh 'docker run --rm -v $(pwd):/app -w /app $BASE_IMAGE_NAME yarn install --prod'
32+
sh 'docker run --rm -v $(pwd):/data $DOCKER_CI_TOOLS node-prune'
33+
34+
// Docker Build
35+
sh 'docker build --pull --no-cache --squash --compress -t $TEMP_IMAGE_NAME .'
36+
37+
// Private Registry
38+
sh 'docker tag $TEMP_IMAGE_NAME $DOCKER_PRIVATE_REGISTRY/$IMAGE_NAME:develop'
39+
sh 'docker push $DOCKER_PRIVATE_REGISTRY/$IMAGE_NAME:develop'
40+
41+
// Dockerhub
42+
sh 'docker tag $TEMP_IMAGE_NAME docker.io/jc21/$IMAGE_NAME:develop'
43+
withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) {
44+
sh "docker login -u '${duser}' -p '$dpass'"
45+
sh 'docker push docker.io/jc21/$IMAGE_NAME:develop'
46+
}
47+
48+
sh 'docker rmi $TEMP_IMAGE_NAME'
49+
}
50+
}
51+
}
52+
stage('Build Master') {
2253
parallel {
2354
stage('x86_64') {
2455
when {

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Nginx Proxy Manager
44

5-
![Version](https://img.shields.io/badge/version-2.0.5-green.svg?style=for-the-badge)
5+
![Version](https://img.shields.io/badge/version-2.0.6-green.svg?style=for-the-badge)
66
![Stars](https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge)
77
![Pulls](https://img.shields.io/docker/pulls/jc21/nginx-proxy-manager.svg?style=for-the-badge)
88

TODO.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

doc/DOCKERHUB.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Nginx Proxy Manager
44

5-
![Version](https://img.shields.io/badge/version-2.0.5-green.svg?style=for-the-badge)
5+
![Version](https://img.shields.io/badge/version-2.0.6-green.svg?style=for-the-badge)
66
![Stars](https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge)
77
![Pulls](https://img.shields.io/docker/pulls/jc21/nginx-proxy-manager.svg?style=for-the-badge)
88

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nginx-proxy-manager",
3-
"version": "2.0.5",
3+
"version": "2.0.6",
44
"description": "A beautiful interface for creating Nginx endpoints",
55
"main": "src/backend/index.js",
66
"devDependencies": {
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
'use strict';
2+
3+
const migrate_name = 'http2_support';
4+
const logger = require('../logger').migrate;
5+
6+
/**
7+
* Migrate
8+
*
9+
* @see http://knexjs.org/#Schema
10+
*
11+
* @param {Object} knex
12+
* @param {Promise} Promise
13+
* @returns {Promise}
14+
*/
15+
exports.up = function (knex/*, Promise*/) {
16+
logger.info('[' + migrate_name + '] Migrating Up...');
17+
18+
return knex.schema.table('proxy_host', function (proxy_host) {
19+
proxy_host.integer('http2_support').notNull().unsigned().defaultTo(0);
20+
})
21+
.then(() => {
22+
logger.info('[' + migrate_name + '] proxy_host Table altered');
23+
24+
return knex.schema.table('redirection_host', function (redirection_host) {
25+
redirection_host.integer('http2_support').notNull().unsigned().defaultTo(0);
26+
});
27+
})
28+
.then(() => {
29+
logger.info('[' + migrate_name + '] redirection_host Table altered');
30+
31+
return knex.schema.table('dead_host', function (dead_host) {
32+
dead_host.integer('http2_support').notNull().unsigned().defaultTo(0);
33+
});
34+
})
35+
.then(() => {
36+
logger.info('[' + migrate_name + '] dead_host Table altered');
37+
});
38+
};
39+
40+
/**
41+
* Undo Migrate
42+
*
43+
* @param {Object} knex
44+
* @param {Promise} Promise
45+
* @returns {Promise}
46+
*/
47+
exports.down = function (knex, Promise) {
48+
logger.warn('[' + migrate_name + '] You can\'t migrate down this one.');
49+
return Promise.resolve(true);
50+
};
51+

src/backend/schema/definitions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@
186186
"type": "string",
187187
"pattern": "^(letsencrypt|other)$"
188188
},
189+
"http2_support": {
190+
"description": "HTTP2 Protocol Support",
191+
"example": false,
192+
"type": "boolean"
193+
},
189194
"block_exploits": {
190195
"description": "Should we block common exploits",
191196
"example": true,

src/backend/schema/endpoints/dead-hosts.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"ssl_forced": {
2525
"$ref": "../definitions.json#/definitions/ssl_forced"
2626
},
27+
"http2_support": {
28+
"$ref": "../definitions.json#/definitions/http2_support"
29+
},
2730
"advanced_config": {
2831
"type": "string"
2932
},
@@ -50,6 +53,9 @@
5053
"ssl_forced": {
5154
"$ref": "#/definitions/ssl_forced"
5255
},
56+
"http2_support": {
57+
"$ref": "#/definitions/http2_support"
58+
},
5359
"advanced_config": {
5460
"$ref": "#/definitions/advanced_config"
5561
},
@@ -101,6 +107,9 @@
101107
"ssl_forced": {
102108
"$ref": "#/definitions/ssl_forced"
103109
},
110+
"http2_support": {
111+
"$ref": "#/definitions/http2_support"
112+
},
104113
"advanced_config": {
105114
"$ref": "#/definitions/advanced_config"
106115
},
@@ -138,6 +147,9 @@
138147
"ssl_forced": {
139148
"$ref": "#/definitions/ssl_forced"
140149
},
150+
"http2_support": {
151+
"$ref": "#/definitions/http2_support"
152+
},
141153
"advanced_config": {
142154
"$ref": "#/definitions/advanced_config"
143155
},

src/backend/schema/endpoints/proxy-hosts.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
"ssl_forced": {
3535
"$ref": "../definitions.json#/definitions/ssl_forced"
3636
},
37+
"http2_support": {
38+
"$ref": "../definitions.json#/definitions/http2_support"
39+
},
3740
"block_exploits": {
3841
"$ref": "../definitions.json#/definitions/block_exploits"
3942
},
@@ -80,6 +83,9 @@
8083
"ssl_forced": {
8184
"$ref": "#/definitions/ssl_forced"
8285
},
86+
"http2_support": {
87+
"$ref": "#/definitions/http2_support"
88+
},
8389
"block_exploits": {
8490
"$ref": "#/definitions/block_exploits"
8591
},
@@ -151,6 +157,9 @@
151157
"ssl_forced": {
152158
"$ref": "#/definitions/ssl_forced"
153159
},
160+
"http2_support": {
161+
"$ref": "#/definitions/http2_support"
162+
},
154163
"block_exploits": {
155164
"$ref": "#/definitions/block_exploits"
156165
},
@@ -206,6 +215,9 @@
206215
"ssl_forced": {
207216
"$ref": "#/definitions/ssl_forced"
208217
},
218+
"http2_support": {
219+
"$ref": "#/definitions/http2_support"
220+
},
209221
"block_exploits": {
210222
"$ref": "#/definitions/block_exploits"
211223
},

src/backend/schema/endpoints/redirection-hosts.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
"ssl_forced": {
3333
"$ref": "../definitions.json#/definitions/ssl_forced"
3434
},
35+
"http2_support": {
36+
"$ref": "../definitions.json#/definitions/http2_support"
37+
},
3538
"block_exploits": {
3639
"$ref": "../definitions.json#/definitions/block_exploits"
3740
},
@@ -67,6 +70,9 @@
6770
"ssl_forced": {
6871
"$ref": "#/definitions/ssl_forced"
6972
},
73+
"http2_support": {
74+
"$ref": "#/definitions/http2_support"
75+
},
7076
"block_exploits": {
7177
"$ref": "#/definitions/block_exploits"
7278
},
@@ -128,6 +134,9 @@
128134
"ssl_forced": {
129135
"$ref": "#/definitions/ssl_forced"
130136
},
137+
"http2_support": {
138+
"$ref": "#/definitions/http2_support"
139+
},
131140
"block_exploits": {
132141
"$ref": "#/definitions/block_exploits"
133142
},
@@ -174,6 +183,9 @@
174183
"ssl_forced": {
175184
"$ref": "#/definitions/ssl_forced"
176185
},
186+
"http2_support": {
187+
"$ref": "#/definitions/http2_support"
188+
},
177189
"block_exploits": {
178190
"$ref": "#/definitions/block_exploits"
179191
},

src/backend/templates/_listen.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
listen 80;
22
{% if certificate -%}
3-
listen 443 ssl;
3+
listen 443 ssl{% if http2_support %} http2{% endif %};
44
{% endif %}
5-
server_name {{ domain_names | join: " " }};
5+
server_name {{ domain_names | join: " " }};

src/frontend/js/app/nginx/dead/form.ejs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</select>
3737
</div>
3838
</div>
39-
<div class="col-sm-12 col-md-12">
39+
<div class="col-sm-6 col-md-6">
4040
<div class="form-group">
4141
<label class="custom-switch">
4242
<input type="checkbox" class="custom-switch-input" name="ssl_forced" value="1"<%- ssl_forced ? ' checked' : '' %><%- certificate_id ? '' : ' disabled' %>>
@@ -45,6 +45,15 @@
4545
</label>
4646
</div>
4747
</div>
48+
<div class="col-sm-6 col-md-6">
49+
<div class="form-group">
50+
<label class="custom-switch">
51+
<input type="checkbox" class="custom-switch-input" name="http2_support" value="1"<%- http2_support ? ' checked' : '' %><%- certificate_id ? '' : ' disabled' %>>
52+
<span class="custom-switch-indicator"></span>
53+
<span class="custom-switch-description"><%- i18n('all-hosts', 'http2-support') %></span>
54+
</label>
55+
</div>
56+
</div>
4857

4958
<!-- Lets encrypt -->
5059
<div class="col-sm-12 col-md-12 letsencrypt">

src/frontend/js/app/nginx/dead/form.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = Mn.View.extend({
2222
save: 'button.save',
2323
certificate_select: 'select[name="certificate_id"]',
2424
ssl_forced: 'input[name="ssl_forced"]',
25+
http2_support: 'input[name="http2_support"]',
2526
letsencrypt: '.letsencrypt'
2627
},
2728

@@ -35,7 +36,11 @@ module.exports = Mn.View.extend({
3536
}
3637

3738
let enabled = id === 'new' || parseInt(id, 10) > 0;
38-
this.ui.ssl_forced.prop('disabled', !enabled).parents('.form-group').css('opacity', enabled ? 1 : 0.5);
39+
this.ui.ssl_forced.add(this.ui.http2_support)
40+
.prop('disabled', !enabled)
41+
.parents('.form-group')
42+
.css('opacity', enabled ? 1 : 0.5);
43+
this.ui.http2_support.prop('disabled', !enabled);
3944
},
4045

4146
'click @ui.save': function (e) {
@@ -54,6 +59,10 @@ module.exports = Mn.View.extend({
5459
data.ssl_forced = true;
5560
}
5661

62+
if (typeof data.http2_support !== 'undefined') {
63+
data.http2_support = !!data.http2_support;
64+
}
65+
5766
if (typeof data.domain_names === 'string' && data.domain_names) {
5867
data.domain_names = data.domain_names.split(',');
5968
}

src/frontend/js/app/nginx/proxy/form.ejs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
</select>
8383
</div>
8484
</div>
85-
<div class="col-sm-12 col-md-12">
85+
<div class="col-sm-6 col-md-6">
8686
<div class="form-group">
8787
<label class="custom-switch">
8888
<input type="checkbox" class="custom-switch-input" name="ssl_forced" value="1"<%- ssl_forced ? ' checked' : '' %><%- certificate_id ? '' : ' disabled' %>>
@@ -91,6 +91,15 @@
9191
</label>
9292
</div>
9393
</div>
94+
<div class="col-sm-6 col-md-6">
95+
<div class="form-group">
96+
<label class="custom-switch">
97+
<input type="checkbox" class="custom-switch-input" name="http2_support" value="1"<%- http2_support ? ' checked' : '' %><%- certificate_id ? '' : ' disabled' %>>
98+
<span class="custom-switch-indicator"></span>
99+
<span class="custom-switch-description"><%- i18n('all-hosts', 'http2-support') %></span>
100+
</label>
101+
</div>
102+
</div>
94103

95104
<!-- Lets encrypt -->
96105
<div class="col-sm-12 col-md-12 letsencrypt">

src/frontend/js/app/nginx/proxy/form.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = Mn.View.extend({
2525
certificate_select: 'select[name="certificate_id"]',
2626
access_list_select: 'select[name="access_list_id"]',
2727
ssl_forced: 'input[name="ssl_forced"]',
28+
http2_support: 'input[name="http2_support"]',
2829
letsencrypt: '.letsencrypt'
2930
},
3031

@@ -38,7 +39,12 @@ module.exports = Mn.View.extend({
3839
}
3940

4041
let enabled = id === 'new' || parseInt(id, 10) > 0;
41-
this.ui.ssl_forced.prop('disabled', !enabled).parents('.form-group').css('opacity', enabled ? 1 : 0.5);
42+
this.ui.ssl_forced.add(this.ui.http2_support)
43+
.prop('disabled', !enabled)
44+
.parents('.form-group')
45+
.css('opacity', enabled ? 1 : 0.5);
46+
47+
this.ui.http2_support.prop('disabled', !enabled);
4248
},
4349

4450
'click @ui.save': function (e) {
@@ -62,6 +68,10 @@ module.exports = Mn.View.extend({
6268
data.ssl_forced = true;
6369
}
6470

71+
if (typeof data.http2_support !== 'undefined') {
72+
data.http2_support = !!data.http2_support;
73+
}
74+
6575
if (typeof data.domain_names === 'string' && data.domain_names) {
6676
data.domain_names = data.domain_names.split(',');
6777
}

0 commit comments

Comments
 (0)