add PROXY to stream hosts - Working.

This commit is contained in:
baudneo
2022-10-10 17:10:54 -06:00
parent a9ca9527d8
commit 2d681b8dcc
5 changed files with 12 additions and 12 deletions

View File

@@ -43,7 +43,7 @@ exports.up = function (knex/*, Promise*/) {
stream.integer('stream_allow_proxy_protocol').notNull().unsigned().defaultTo(0); stream.integer('stream_allow_proxy_protocol').notNull().unsigned().defaultTo(0);
}) })
.then(() => { .then(() => {
logger.info('[' + migrate_name + '] stream Table altered - PROXY protocol added'); logger.info('[' + migrate_name + '] stream Table altered - "stream_allow_proxy_protocol" added');
}).catch((err) => { }).catch((err) => {
logger.error('[' + migrate_name + '] stream Table error migrating up: ' + err); logger.error('[' + migrate_name + '] stream Table error migrating up: ' + err);
}); });
@@ -51,15 +51,16 @@ exports.up = function (knex/*, Promise*/) {
stream.integer('stream_enable_proxy_protocol').notNull().unsigned().defaultTo(0); stream.integer('stream_enable_proxy_protocol').notNull().unsigned().defaultTo(0);
}) })
.then(() => { .then(() => {
logger.info('[' + migrate_name + '] stream Table altered - PROXY protocol added'); logger.info('[' + migrate_name + '] stream Table altered - "stream_enable_proxy_protocol" added');
}).catch((err) => { }).catch((err) => {
logger.error('[' + migrate_name + '] stream Table error migrating up: ' + err); logger.error('[' + migrate_name + '] stream Table error migrating up: ' + err);
}); });
knex.schema.table('stream', function (stream) { knex.schema.table('stream', function (stream) {
stream.integer('stream_load_balancer_ip').notNull().unsigned().defaultTo(''); stream.string('stream_load_balancer_ip').notNull().defaultTo('');
}) })
.then(() => { .then(() => {
logger.info('[' + migrate_name + '] stream Table altered - PROXY protocol added'); logger.info('[' + migrate_name + '] stream Table altered - "stream_load_balancer_ip" added');
}).catch((err) => { }).catch((err) => {
logger.error('[' + migrate_name + '] stream Table error migrating up: ' + err); logger.error('[' + migrate_name + '] stream Table error migrating up: ' + err);
}); });

View File

@@ -52,12 +52,11 @@
"type": "boolean" "type": "boolean"
}, },
"stream_allow_proxy_protocol": { "stream_allow_proxy_protocol": {
"description": "Enable PROXY Protocol passthrough", "description": "Enable PROXY Protocol pass through",
"example": true, "example": true,
"type": "boolean" "type": "boolean"
}, },
"stream_load_balancer_ip": { "stream_load_balancer_ip": {
"description": "Authorized TCP Load Balancer IP / CIDR for setting 'set_real_ip_from'",
"type": "string", "type": "string",
"minLength": 0, "minLength": 0,
"maxLength": 255 "maxLength": 255

View File

@@ -20,7 +20,6 @@ module.exports = Mn.View.extend({
cancel: 'button.cancel', cancel: 'button.cancel',
save: 'button.save', save: 'button.save',
stream_allow_proxy_protocol: 'input[name="stream_allow_proxy_protocol"]', stream_allow_proxy_protocol: 'input[name="stream_allow_proxy_protocol"]',
stream_enable_proxy_protocol: 'input[name="stream_enable_proxy_protocol"]',
stream_load_balancer_ip: 'input[name="stream_load_balancer_ip"]' stream_load_balancer_ip: 'input[name="stream_load_balancer_ip"]'
}, },

View File

@@ -134,8 +134,8 @@
"ignore-invalid-upstream-ssl": "Ignore Invalid SSL", "ignore-invalid-upstream-ssl": "Ignore Invalid SSL",
"custom-forward-host-help": "Add a path for sub-folder forwarding.\nExample: 203.0.113.25/path/", "custom-forward-host-help": "Add a path for sub-folder forwarding.\nExample: 203.0.113.25/path/",
"search": "Search Host…", "search": "Search Host…",
"enable-proxy-protocol": "Allow PROXY Protocol (Pass through)", "enable-proxy-protocol": "Allow PROXY Protocol",
"load-balancer-ip": "AUTHORIZED Load balancer or TCP proxy IP / CIDR range" "load-balancer-ip": "Load balancer or TCP proxy IP / CIDR range"
}, },
"redirection-hosts": { "redirection-hosts": {
"title": "Redirection Hosts", "title": "Redirection Hosts",
@@ -182,9 +182,9 @@
"help-title": "What is a Stream?", "help-title": "What is a Stream?",
"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.", "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.",
"search": "Search Incoming Port…", "search": "Search Incoming Port…",
"allow-proxy-protocol": "Allow PROXY Protocol (Pass through)", "allow-proxy-protocol": "Allow PROXY Protocol",
"enable-proxy-protocol": "Enable PROXY Protocol (Create and override PROXY protocol instead of passing through)", "enable-proxy-protocol": "Create PROXY Headers",
"load-balancer-ip": "AUTHORIZED Load balancer or TCP proxy IP / CIDR range" "load-balancer-ip": "Load balancer or TCP proxy IP / CIDR range"
}, },
"certificates": { "certificates": {
"title": "SSL Certificates", "title": "SSL Certificates",

View File

@@ -8,3 +8,4 @@ log() {
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -D "${MYSQL_DATABASE}" -e "DELETE from migrations where name = '22021010135303_stream_proxy_protocol.js';" mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -D "${MYSQL_DATABASE}" -e "DELETE from migrations where name = '22021010135303_stream_proxy_protocol.js';"
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -D "${MYSQL_DATABASE}" -e "DELETE from migrations where name = '22021010135304_stream_proxy_protocol.js';" mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -D "${MYSQL_DATABASE}" -e "DELETE from migrations where name = '22021010135304_stream_proxy_protocol.js';"
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -D "${MYSQL_DATABASE}" -e "DELETE from migrations where name = '20221010135304_stream_proxy_protocol.js';" mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -D "${MYSQL_DATABASE}" -e "DELETE from migrations where name = '20221010135304_stream_proxy_protocol.js';"
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -D "${MYSQL_DATABASE}" -e "DELETE from migrations where name = '20221011000001_stream_proxy_protocol.js';"