public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Gabriel Goller <g.goller@proxmox.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH cluster 2/3] add consent-text paramter to datacenter config file
Date: Wed, 4 Dec 2024 11:16:18 +0100	[thread overview]
Message-ID: <38857b04-2a3a-4610-889e-a4455444e24d@proxmox.com> (raw)
In-Reply-To: <5vjnedsr2m26s6ijmuhalowo3uma3f4gbw7r3syetzn2fufovf@hltd47ok6oon>

Am 04.12.24 um 10:16 schrieb Gabriel Goller:
> On 03.12.2024 18:24, Thomas Lamprecht wrote:
>> Am 03.12.24 um 16:29 schrieb Gabriel Goller:
>>> The consent-text paramter is the base64-encoded content of the optional
>>> consent-banner which can be displayed before login.
>>
>> This can get quite big, would be good to set some relatively high limit here,
>> I think, as our pmxcfs files have a max size and not being able to change other
>> options due to this property being close to the pmxcfs file size limit would
>> not be ideal.
> 
> To keep the textareafield widget generic, I would add the maxLength
> parameters to pbs and pve separately.
> 
> About the limit itself, the example banner in the bug report [0] has 500
> characters and these legal texts can sometimes get quite long – so maybe
> a limit of 1000 characters?

The one I copied over from some example link [0] comes out as 3733 B in base64,
but I did not encode the image it contained as base64 data-url, so might be
bigger if the text should spot some logo, or patriotic flag image like it was
in my example ^^
To get a real world example for how much bigger I encoded the image from [0]
now, and it comes out as ~ 350 KiB of base64, if converted to WebP format first
it  gets down to ~ 32 KiB.

So maybe go for bigger limit, say 128 KiB, as that still gives quite a bit of
headroom to the pmxcfs per-file limit and allows (efficiently encoded) data-URL
images. Btw. your Ext.htmlEncode() breaks images with data URLs, our wrapper
around the Markdown parser we use already sanitizes problematic HTML, so an
additional HTML encode step might not be warranted here?

[0]: https://businessportal.dla.mil/scon/sys-msg/index-ext.html

> [0]: https://bugzilla.proxmox.com/show_bug.cgi?id=5463
> 
>> btw. Did we ever talk about placing this into a dedicated, separate file?
>> (just out of interest, might be also an option to consider here if we did
>> not talked already about it)
> 
> Yep, my first version used a separate file – this was discussed here:
> https://lore.proxmox.com/pbs-devel/fc22ec23-a300-488d-821f-bea1285881a8@proxmox.com/

Hmm, I remember now; with the future-proofing this format makes sense, but
we could have also split content and how it's acted on, e.g., use a separate
file for the notes and add the settings for a future enforcement or the like
to the datacenter.cfg once it happens, I could have thought about that variant
back then already, sorry. The reason I asked this is that for PDM we use a
separate file for the generic notes to avoid cluttering config files comments
with that potential bigger encoded text. But for PBS we already went this way,
and it's OK enough (with an explicit limit enforced by the API schema) so fine
by me to keep as is.


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

  reply	other threads:[~2024-12-04 10:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03 15:29 [pve-devel] [PATCH cluster/docs/manager 0/3] fix #5463: add optional Consent Banner on login Gabriel Goller
2024-12-03 15:29 ` [pve-devel] [PATCH manager 1/3] show optional consent-banner before login Gabriel Goller
2024-12-03 17:24   ` Thomas Lamprecht
2024-12-04  8:48     ` Gabriel Goller
2024-12-03 15:29 ` [pve-devel] [PATCH cluster 2/3] add consent-text paramter to datacenter config file Gabriel Goller
2024-12-03 17:24   ` Thomas Lamprecht
2024-12-04  9:16     ` Gabriel Goller
2024-12-04 10:16       ` Thomas Lamprecht [this message]
2024-12-05 10:45         ` Gabriel Goller
2024-12-03 15:29 ` [pve-devel] [PATCH docs 3/3] add consent-banner description Gabriel Goller
2024-12-06 11:19 ` [pve-devel] [PATCH cluster/docs/manager 0/3] fix #5463: add optional Consent Banner on login 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=38857b04-2a3a-4610-889e-a4455444e24d@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=g.goller@proxmox.com \
    --cc=pve-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal