From: Gabriel Goller <g.goller@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v2] restrict consent-banner text length
Date: Tue, 10 Dec 2024 16:48:57 +0100 [thread overview]
Message-ID: <20241210154857.351525-1-g.goller@proxmox.com> (raw)
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>
---
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..defb56b07132 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: 86016,
}
},
)]
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
next reply other threads:[~2024-12-10 15:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-10 15:48 Gabriel Goller [this message]
2024-12-10 15:51 ` Gabriel Goller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241210154857.351525-1-g.goller@proxmox.com \
--to=g.goller@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox