Compare commits

..

4 Commits

Author SHA1 Message Date
Sergey Kolesnik
299bc0854c Merge branch 'NginxProxyManager:develop' into develop 2024-12-24 10:34:32 -05:00
Sergey Kolesnik
75dbbebf8d Merge branch 'NginxProxyManager:develop' into develop 2024-12-23 19:18:09 -05:00
Sergey 'dreik' Kolesnik
f6abe27a8a eslint 2024-12-09 03:49:03 +03:00
Sergey 'dreik' Kolesnik
d8ca38cb26 client_max_body_size setting 2024-12-09 03:17:48 +03:00
13 changed files with 70 additions and 14 deletions

View File

@@ -0,0 +1,34 @@
const migrate_name = 'client_max_body_size';
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('proxy_host', function (proxy_host) {
proxy_host.integer('client_max_body_size').notNull().unsigned().defaultTo('1');
})
.then(() => {
logger.info('[' + migrate_name + '] proxy_host Table altered');
});
};
/**
* Undo Migrate
*
* @param {Object} knex
* @param {Promise} Promise
* @returns {Promise}
*/
exports.down = function (knex, Promise) {
logger.warn('[' + migrate_name + '] You can\'t migrate down this one.');
return Promise.resolve(true);
};

View File

@@ -9,6 +9,7 @@
"domain_names",
"forward_host",
"forward_port",
"client_max_body_size",
"access_list_id",
"certificate_id",
"ssl_forced",
@@ -52,6 +53,11 @@
"minimum": 1,
"maximum": 65535
},
"client_max_body_size": {
"type": "integer",
"minimum": 1,
"maximum": 4096
},
"access_list_id": {
"$ref": "../common.json#/properties/access_list_id"
},
@@ -112,6 +118,9 @@
"forward_port": {
"$ref": "#/properties/forward_port"
},
"client_max_body_size": {
"$ref": "#/properties/client_max_body_size"
},
"forward_path": {
"type": "string"
},

View File

@@ -34,6 +34,7 @@
"domain_names": ["test.example.com"],
"forward_host": "127.0.0.1",
"forward_port": 8989,
"client_max_body_size": 1,
"access_list_id": 0,
"certificate_id": 0,
"ssl_forced": false,

View File

@@ -34,6 +34,7 @@
"domain_names": ["test.example.com"],
"forward_host": "192.168.0.10",
"forward_port": 8989,
"client_max_body_size": 1,
"access_list_id": 0,
"certificate_id": 0,
"ssl_forced": false,

View File

@@ -41,6 +41,9 @@
"forward_port": {
"$ref": "../../../../components/proxy-host-object.json#/properties/forward_port"
},
"client_max_body_size": {
"$ref": "../../../../components/proxy-host-object.json#/properties/client_max_body_size"
},
"certificate_id": {
"$ref": "../../../../components/proxy-host-object.json#/properties/certificate_id"
},
@@ -100,6 +103,7 @@
"domain_names": ["test.example.com"],
"forward_host": "192.168.0.10",
"forward_port": 8989,
"client_max_body_size": 1,
"access_list_id": 0,
"certificate_id": 0,
"ssl_forced": false,

View File

@@ -29,6 +29,9 @@
"forward_port": {
"$ref": "../../../components/proxy-host-object.json#/properties/forward_port"
},
"client_max_body_size": {
"$ref": "../../../components/proxy-host-object.json#/properties/client_max_body_size"
},
"certificate_id": {
"$ref": "../../../components/proxy-host-object.json#/properties/certificate_id"
},
@@ -88,6 +91,7 @@
"domain_names": ["test.example.com"],
"forward_host": "127.0.0.1",
"forward_port": 8989,
"client_max_body_size": 1,
"access_list_id": 0,
"certificate_id": 0,
"ssl_forced": false,

View File

@@ -47,6 +47,8 @@ proxy_http_version 1.1;
}
{% endif %}
client_max_body_size {{ client_max_body_size }}m;
# Custom
include /data/nginx/custom/server_proxy[.]conf;
}

View File

@@ -81,7 +81,12 @@
</label>
</div>
</div>
<div class="col-sm-12 col-md-12">
<div class="form-group">
<label class="form-label"><%- i18n('proxy-hosts', 'client-max-body-size' ) %></label>
<input name="client_max_body_size" type="number" class="form-control text-monospace" placeholder="1" value="<%- client_max_body_size %>" required>
</div>
</div>
<div class="col-sm-12 col-md-12">
<div class="form-group">
<label class="form-label"><%- i18n('proxy-hosts', 'access-list') %></label>

View File

@@ -160,6 +160,7 @@ module.exports = Mn.View.extend({
// Manipulate
data.forward_port = parseInt(data.forward_port, 10);
data.client_max_body_size = parseInt(data.client_max_body_size, 10);
data.block_exploits = !!data.block_exploits;
data.caching_enabled = !!data.caching_enabled;
data.allow_websocket_upgrade = !!data.allow_websocket_upgrade;

View File

@@ -125,6 +125,7 @@
"forward-scheme": "Scheme",
"forward-host": "Forward Hostname / IP",
"forward-port": "Forward Port",
"client-max-body-size": "Max proxied upload size (Mb)",
"delete": "Delete Proxy Host",
"delete-confirm": "Are you sure you want to delete the Proxy host for: <strong>{domains}</strong>?",
"help-title": "What is a Proxy Host?",

View File

@@ -12,6 +12,7 @@ const model = Backbone.Model.extend({
forward_scheme: 'http',
forward_host: '',
forward_port: null,
client_max_body_size: 1,
access_list_id: 0,
certificate_id: 0,
ssl_forced: false,

View File

@@ -7,7 +7,7 @@
"credentials": "dns_acmedns_api_url = http://acmedns-server/\ndns_acmedns_registration_file = /data/acme-registration.json",
"full_plugin_name": "dns-acmedns"
},
"active24": {
"active24":{
"name": "Active24",
"package_name": "certbot-dns-active24",
"version": "~=1.5.1",
@@ -18,7 +18,7 @@
"aliyun": {
"name": "Aliyun",
"package_name": "certbot-dns-aliyun",
"version": "~=2.0.0",
"version": "~=0.38.1",
"dependencies": "",
"credentials": "dns_aliyun_access_key = 12345678\ndns_aliyun_access_key_secret = 1234567890abcdef1234567890abcdef",
"full_plugin_name": "dns-aliyun"
@@ -31,14 +31,6 @@
"credentials": "# This plugin supported API authentication using either Service Principals or utilizing a Managed Identity assigned to the virtual machine.\n# Regardless which authentication method used, the identity will need the “DNS Zone Contributor” role assigned to it.\n# As multiple Azure DNS Zones in multiple resource groups can exist, the config file needs a mapping of zone to resource group ID. Multiple zones -> ID mappings can be listed by using the key dns_azure_zoneX where X is a unique number. At least 1 zone mapping is required.\n\n# Using a service principal (option 1)\ndns_azure_sp_client_id = 912ce44a-0156-4669-ae22-c16a17d34ca5\ndns_azure_sp_client_secret = E-xqXU83Y-jzTI6xe9fs2YC~mck3ZzUih9\ndns_azure_tenant_id = ed1090f3-ab18-4b12-816c-599af8a88cf7\n\n# Using used assigned MSI (option 2)\n# dns_azure_msi_client_id = 912ce44a-0156-4669-ae22-c16a17d34ca5\n\n# Using system assigned MSI (option 3)\n# dns_azure_msi_system_assigned = true\n\n# Zones (at least one always required)\ndns_azure_zone1 = example.com:/subscriptions/c135abce-d87d-48df-936c-15596c6968a5/resourceGroups/dns1\ndns_azure_zone2 = example.org:/subscriptions/99800903-fb14-4992-9aff-12eaf2744622/resourceGroups/dns2",
"full_plugin_name": "dns-azure"
},
"beget": {
"name":"Beget",
"package_name": "certbot-beget-plugin",
"version": "~=1.0.0.dev9",
"dependencies": "",
"credentials": "# Beget API credentials used by Certbot\nbeget_plugin_username = username\nbeget_plugin_password = password",
"full_plugin_name": "beget-plugin"
},
"bunny": {
"name": "bunny.net",
"package_name": "certbot-dns-bunny",
@@ -418,7 +410,7 @@
"porkbun": {
"name": "Porkbun",
"package_name": "certbot-dns-porkbun",
"version": "~=0.9",
"version": "~=0.2",
"dependencies": "",
"credentials": "dns_porkbun_key=your-porkbun-api-key\ndns_porkbun_secret=your-porkbun-api-secret",
"full_plugin_name": "dns-porkbun"
@@ -511,7 +503,7 @@
"credentials": "dns_websupport_identifier = <api_key>\ndns_websupport_secret_key = <secret>",
"full_plugin_name": "dns-websupport"
},
"wedos": {
"wedos":{
"name": "Wedos",
"package_name": "certbot-dns-wedos",
"version": "~=2.2",
@@ -527,4 +519,4 @@
"credentials": "edgedns_client_secret = as3d1asd5d1a32sdfsdfs2d1asd5=\nedgedns_host = sdflskjdf-dfsdfsdf-sdfsdfsdf.luna.akamaiapis.net\nedgedns_access_token = kjdsi3-34rfsdfsdf-234234fsdfsdf\nedgedns_client_token = dkfjdf-342fsdfsd-23fsdfsdfsdf",
"full_plugin_name": "edgedns"
}
}
}

View File

@@ -18,6 +18,7 @@ describe('Proxy Hosts endpoints', () => {
forward_scheme: 'http',
forward_host: '1.1.1.1',
forward_port: 80,
client_max_body_size: 1,
access_list_id: '0',
certificate_id: 0,
meta: {