public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup v3] restrict consent-banner text length
@ 2024-12-10 15:53 Gabriel Goller
  2025-04-08 11:08 ` Thomas Lamprecht
  0 siblings, 1 reply; 5+ messages in thread
From: Gabriel Goller @ 2024-12-10 15:53 UTC (permalink / raw)
  To: pbs-devel

Add a maxLength in of 63*1024 in the frontend. We allow a max body
size of 64*1204 in the api and to allow some other properties to
coexist, reserve 1024 characters. In the backend we set the limit to
128000 (128kB), which is the same as in pve.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---

v3:
 - forgot to update the actual number in code

v2, thanks @Thomas:
 - limit consent-text in the backend as well
 - set the limit according to the max body size

 src/config/node.rs           | 5 +++++
 www/config/NodeOptionView.js | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/src/config/node.rs b/src/config/node.rs
index 2b29cb02afed..99c900cabf74 100644
--- a/src/config/node.rs
+++ b/src/config/node.rs
@@ -174,6 +174,11 @@ pub enum Translation {
         "description" : {
             optional: true,
             schema: MULTI_LINE_COMMENT_SCHEMA,
+        },
+        "consent-text" : {
+            optional: true,
+            type: String,
+            max_length: 128000,
         }
     },
 )]
diff --git a/www/config/NodeOptionView.js b/www/config/NodeOptionView.js
index c327356f7f24..042086a8ded5 100644
--- a/www/config/NodeOptionView.js
+++ b/www/config/NodeOptionView.js
@@ -59,6 +59,9 @@ Ext.define('PBS.NodeOptionView', {
 	    name: 'consent-text',
 	    text: gettext('Consent Text'),
 	    deleteEmpty: true,
+	    fieldOpts: {
+		maxLength: 63 * 1024,
+	    },
 	    onlineHelp: 'consent_banner',
 	},
     ],
-- 
2.39.5



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-backup v3] restrict consent-banner text length
  2024-12-10 15:53 [pbs-devel] [PATCH proxmox-backup v3] restrict consent-banner text length Gabriel Goller
@ 2025-04-08 11:08 ` Thomas Lamprecht
  2025-04-08 12:58   ` Gabriel Goller
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Lamprecht @ 2025-04-08 11:08 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Gabriel Goller

Am 10.12.24 um 16:53 schrieb Gabriel Goller:
> Add a maxLength in of 63*1024 in the frontend. We allow a max body
> size of 64*1204 in the api and to allow some other properties to
> coexist, reserve 1024 characters. In the backend we set the limit to
> 128000 (128kB), which is the same as in pve.

I reduced it in PVE a bit again; might also make sense to increase the
max POST size to 512 KiB just like in PVE, the rust based HTTP server
should handle these sizes without a sweat if the perl one can do that.


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-backup v3] restrict consent-banner text length
  2025-04-08 11:08 ` Thomas Lamprecht
@ 2025-04-08 12:58   ` Gabriel Goller
  2025-04-08 13:01     ` Gabriel Goller
  0 siblings, 1 reply; 5+ messages in thread
From: Gabriel Goller @ 2025-04-08 12:58 UTC (permalink / raw)
  To: Thomas Lamprecht; +Cc: Proxmox Backup Server development discussion

On 08.04.2025 13:08, Thomas Lamprecht wrote:
>Am 10.12.24 um 16:53 schrieb Gabriel Goller:
>> Add a maxLength in of 63*1024 in the frontend. We allow a max body
>> size of 64*1204 in the api and to allow some other properties to
>> coexist, reserve 1024 characters. In the backend we set the limit to
>> 128000 (128kB), which is the same as in pve.
>
>I reduced it in PVE a bit again; might also make sense to increase the
>max POST size to 512 KiB just like in PVE, the rust based HTTP server
>should handle these sizes without a sweat if the perl one can do that.

I'll send a patch soon with a limit of 64kB on both frontend and api.
The increasing of the max body size is IMO better in a future patch as
that will need some testing.



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-backup v3] restrict consent-banner text length
  2025-04-08 12:58   ` Gabriel Goller
@ 2025-04-08 13:01     ` Gabriel Goller
  2025-04-08 13:08       ` Thomas Lamprecht
  0 siblings, 1 reply; 5+ messages in thread
From: Gabriel Goller @ 2025-04-08 13:01 UTC (permalink / raw)
  To: Thomas Lamprecht, Proxmox Backup Server development discussion

On 08.04.2025 14:58, Gabriel Goller wrote:
>On 08.04.2025 13:08, Thomas Lamprecht wrote:
>>Am 10.12.24 um 16:53 schrieb Gabriel Goller:
>>>Add a maxLength in of 63*1024 in the frontend. We allow a max body
>>>size of 64*1204 in the api and to allow some other properties to
>>>coexist, reserve 1024 characters. In the backend we set the limit to
>>>128000 (128kB), which is the same as in pve.
>>
>>I reduced it in PVE a bit again; might also make sense to increase the
>>max POST size to 512 KiB just like in PVE, the rust based HTTP server
>>should handle these sizes without a sweat if the perl one can do that.
>
>I'll send a patch soon with a limit of 64kB on both frontend and api.
>The increasing of the max body size is IMO better in a future patch as
>that will need some testing.

*63kB oops, we still need to let some room for other properties.


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-backup v3] restrict consent-banner text length
  2025-04-08 13:01     ` Gabriel Goller
@ 2025-04-08 13:08       ` Thomas Lamprecht
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2025-04-08 13:08 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion

Am 08.04.25 um 15:01 schrieb Gabriel Goller:
> On 08.04.2025 14:58, Gabriel Goller wrote:
>> On 08.04.2025 13:08, Thomas Lamprecht wrote:
>>> Am 10.12.24 um 16:53 schrieb Gabriel Goller:
>>>> Add a maxLength in of 63*1024 in the frontend. We allow a max body
>>>> size of 64*1204 in the api and to allow some other properties to
>>>> coexist, reserve 1024 characters. In the backend we set the limit to
>>>> 128000 (128kB), which is the same as in pve.
>>>
>>> I reduced it in PVE a bit again; might also make sense to increase the
>>> max POST size to 512 KiB just like in PVE, the rust based HTTP server
>>> should handle these sizes without a sweat if the perl one can do that.
>>
>> I'll send a patch soon with a limit of 64kB on both frontend and api.
>> The increasing of the max body size is IMO better in a future patch as
>> that will need some testing.
> 
> *63kB oops, we still need to let some room for other properties.

That's why I'd increase the post size limit, it's a trivial logical
check, not really sure what's much to test there?


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-08 13:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-10 15:53 [pbs-devel] [PATCH proxmox-backup v3] restrict consent-banner text length Gabriel Goller
2025-04-08 11:08 ` Thomas Lamprecht
2025-04-08 12:58   ` Gabriel Goller
2025-04-08 13:01     ` Gabriel Goller
2025-04-08 13:08       ` Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal