Skip to content

Commit 2d681b8

Browse files
committed
add PROXY to stream hosts - Working.
1 parent a9ca952 commit 2d681b8

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

backend/migrations/20221011000001_stream_proxy_protocol.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,24 @@ exports.up = function (knex/*, Promise*/) {
4343
stream.integer('stream_allow_proxy_protocol').notNull().unsigned().defaultTo(0);
4444
})
4545
.then(() => {
46-
logger.info('[' + migrate_name + '] stream Table altered - PROXY protocol added');
46+
logger.info('[' + migrate_name + '] stream Table altered - "stream_allow_proxy_protocol" added');
4747
}).catch((err) => {
4848
logger.error('[' + migrate_name + '] stream Table error migrating up: ' + err);
4949
});
5050
knex.schema.table('stream', function (stream) {
5151
stream.integer('stream_enable_proxy_protocol').notNull().unsigned().defaultTo(0);
5252
})
5353
.then(() => {
54-
logger.info('[' + migrate_name + '] stream Table altered - PROXY protocol added');
54+
logger.info('[' + migrate_name + '] stream Table altered - "stream_enable_proxy_protocol" added');
5555
}).catch((err) => {
5656
logger.error('[' + migrate_name + '] stream Table error migrating up: ' + err);
5757
});
58+
5859
knex.schema.table('stream', function (stream) {
59-
stream.integer('stream_load_balancer_ip').notNull().unsigned().defaultTo('');
60+
stream.string('stream_load_balancer_ip').notNull().defaultTo('');
6061
})
6162
.then(() => {
62-
logger.info('[' + migrate_name + '] stream Table altered - PROXY protocol added');
63+
logger.info('[' + migrate_name + '] stream Table altered - "stream_load_balancer_ip" added');
6364
}).catch((err) => {
6465
logger.error('[' + migrate_name + '] stream Table error migrating up: ' + err);
6566
});

backend/schema/endpoints/streams.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@
5252
"type": "boolean"
5353
},
5454
"stream_allow_proxy_protocol": {
55-
"description": "Enable PROXY Protocol passthrough",
55+
"description": "Enable PROXY Protocol pass through",
5656
"example": true,
5757
"type": "boolean"
5858
},
5959
"stream_load_balancer_ip": {
60-
"description": "Authorized TCP Load Balancer IP / CIDR for setting 'set_real_ip_from'",
6160
"type": "string",
6261
"minLength": 0,
6362
"maxLength": 255

frontend/js/app/nginx/stream/form.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ module.exports = Mn.View.extend({
2020
cancel: 'button.cancel',
2121
save: 'button.save',
2222
stream_allow_proxy_protocol: 'input[name="stream_allow_proxy_protocol"]',
23-
stream_enable_proxy_protocol: 'input[name="stream_enable_proxy_protocol"]',
2423
stream_load_balancer_ip: 'input[name="stream_load_balancer_ip"]'
2524
},
2625

frontend/js/i18n/messages.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@
134134
"ignore-invalid-upstream-ssl": "Ignore Invalid SSL",
135135
"custom-forward-host-help": "Add a path for sub-folder forwarding.\nExample: 203.0.113.25/path/",
136136
"search": "Search Host…",
137-
"enable-proxy-protocol": "Allow PROXY Protocol (Pass through)",
138-
"load-balancer-ip": "AUTHORIZED Load balancer or TCP proxy IP / CIDR range"
137+
"enable-proxy-protocol": "Allow PROXY Protocol",
138+
"load-balancer-ip": "Load balancer or TCP proxy IP / CIDR range"
139139
},
140140
"redirection-hosts": {
141141
"title": "Redirection Hosts",
@@ -182,9 +182,9 @@
182182
"help-title": "What is a Stream?",
183183
"help-content": "A relatively new feature for Nginx, a Stream will serve to forward TCP/UDP traffic directly to another computer on the network.\nIf you're running game servers, FTP or SSH servers this can come in handy.",
184184
"search": "Search Incoming Port…",
185-
"allow-proxy-protocol": "Allow PROXY Protocol (Pass through)",
186-
"enable-proxy-protocol": "Enable PROXY Protocol (Create and override PROXY protocol instead of passing through)",
187-
"load-balancer-ip": "AUTHORIZED Load balancer or TCP proxy IP / CIDR range"
185+
"allow-proxy-protocol": "Allow PROXY Protocol",
186+
"enable-proxy-protocol": "Create PROXY Headers",
187+
"load-balancer-ip": "Load balancer or TCP proxy IP / CIDR range"
188188
},
189189
"certificates": {
190190
"title": "SSL Certificates",

scripts/npm_db_fix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ log() {
88
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -D "${MYSQL_DATABASE}" -e "DELETE from migrations where name = '22021010135303_stream_proxy_protocol.js';"
99
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -D "${MYSQL_DATABASE}" -e "DELETE from migrations where name = '22021010135304_stream_proxy_protocol.js';"
1010
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -D "${MYSQL_DATABASE}" -e "DELETE from migrations where name = '20221010135304_stream_proxy_protocol.js';"
11+
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -D "${MYSQL_DATABASE}" -e "DELETE from migrations where name = '20221011000001_stream_proxy_protocol.js';"

0 commit comments

Comments
 (0)