The consent-text parameter is the base64-encoded content of the
optional consent-banner which can be displayed before login. The limit
is 64 kiB, which is less than the pmxcfs file limit, but still enough
to also encode some small images.
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
This commit add the `common_template_data` sub to PVE::Notify,
providing a convenient way to get a hash with properties that
should be accessible from all templates, namely hostname, fqdn
and cluster-name.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
follows commit:
d8ef05c (cfs: add 'sdn/pve-ipam-state.json' to observed files)
with the same motivation - the data in the macs.db file is a cache, to
prevent unneccessary lookups to external IPAM modules - is not private
in the sense of secrets for external resources.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
We want to migrate from the unnecessary restricted ipam.db file inside
the root-only priv/ directory as that is reserved for secrets that
allow access to (external) resources with high exposure.
The ipam.db was for internal state, while that is somewhat sensitive
information it's not more so than the raw configuration files for
storage, guests, ha and so on, and all those files are not directly
accessible to the user as we always have the API in front of the
pmxcfs anyway.
The background here is that moving that file out of priv/ allows
non-root daemons like pveproxy to read it, which is required for some
firewall related development. And in general we want to go more in the
direction of less stuff running as root, not more stuff.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
by default libfuse2 limits writes to 4k size, which means that on writes
bigger than that, we do a whole write cycle for each 4k block that comes
in. To avoid that, add the option 'big_writes' to allow writes bigger
than 4k at once (namely up to 128 KiB).
This means that if we update a file with more than 4KiB data, the
following pattern occurs:
* cfs_fuse_write is called with at offset 0 with 4096 size
* sqlite writes the partial file to disk since it's a transaction
* cfs_fuse_write is called with an offset 4096 and with 4096 size
* sqlite updates the data and writes again
* repeat until all data reached cfs_fuse_write
So when cfs_fuse_write accepts bigger chunks, we have less
cfs_fuse_write -> sqlite write cycles, leading to a reduced disk
activity.
Note that sqlite itself uses 4096 byte blocks to write to the file
system layer below.
Most files on pmxcfs are written with `file_set_contents`, which writes
the file into a tmp file and renames it, so we always have some write
overhead.
Previous to pve-common commit
ef0bcc9 (tools: file_set_contents: use syswrite instead of print)
it used `print` to write, which uses an internal 8k buffer, and after
the commit it uses `syswrite`, which writes the file unbuffered in one
go. (Fuse still splits writes at it's defined maximum)
The commit message of that patch includes benchmarks for various sizes
of writes on pmxcfs with this patch included. Results show that we can
reduce the amount of bytes written to disk for files larger than 4 KiB
by a significant amount (with both patches we can reduce the
amplification at 8KiB from ~15x to ~11x, and for 1024KiB from ~360x to
~15x)
When we change to libfuse3, we have to remove this option again, since
it got removed and is the default there.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
The notification system will now load template files from a defined
location. The template to use is now passed to proxmox_notify, instead
of separate template strings for subject/body.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
because otherwise the SSH calls to other nodes in the cluster will fail
on newer clusters that only have the ssh host keys located in the
pmxcfs.
With ssh_info_to_command we get all the needed SSH options that set the
alias and point to the right known_hosts file.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
and allow explicitly unmerging to remove the symlink altogether.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Hannes Duerr <h.duerr@proxmox.com>
for example, to re-use with an scp command.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Hannes Duerr <h.duerr@proxmox.com>
if the target node has already stored their SSH host key on pmxcfs, pin it and
ignore the global known hosts information.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Hannes Duerr <h.duerr@proxmox.com>
so that we can explicitly pin just this key when doing intra-cluster SSH
connections. this works similar to the certificate cache we use for API
proxying, but without automatic invalidation, since node A doesn't have access
to node B's host key..
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Hannes Duerr <h.duerr@proxmox.com>
These were part of the first version of the notification overhaul
which was already rolled out in pvetest. To avoid breakage for users
who may have used the version from pvetest, we do not remove them yet
and only mark them as unused or deprecated. They can be removed at
some point in the future.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
by correclty passing the $force_utf8 flag to
PVE::Tools::file_set_contents(). The idea was that only callers that
are ready will opt-in to the behavior.
When reading files with PVE::Tools::file_get_contents() or
ipcc_get_config(), the UTF-8 flag on the Perl string is not set, even
if the data is UTF-8. Such data would then be encoded a second time,
as reported in the community forum [0] and bug tracker [1].
[0]: https://forum.proxmox.com/threads/139282/
[1]: https://bugzilla.proxmox.com/show_bug.cgi?id=1909#c1
Fixes: 90c824b ("cluster fs: allow to force UTF-8 encoding for cfs_write_file")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Filip Schauer <f.schauer@proxmox.com>
This commit removes the target paramters from all notify calls. Also,
the default 'mail-to-root' target is not added automatically any more
- this target will be added by an dpkg hook in the future.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
use to cache mac-ip list association.
can be use by external ipam, firewall,etc for fast lookup
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
We switched the default to match pmxcfs again (after its limit
increase for Proxmox VE 7) to 1024 * 1024 (= 1 MiB), so not required
to override the limit here, as we actually made it lower, not higher.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Proxmox Server Solutions GmbH got the OUI BC-24-11 assigned for a MA-L
(large) address block that provides 24 bits (16 777 216) of space
available for guests.
Use this as new default, effectively disallowing a fully random MAC,
and extend the descriptions with some background.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Croatian, Georgian, Ukrainian were all added only recently, so add
them to this map here.
Arabic, Korean and Dutch was missing too, and we had those in since
quite a while.
While at it, comment the long form for every language.
Copied over from widget-toolkit's language_map, then transformed with
some vim sed foo.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Strings that are returned from the Rust implementation are encoded as
utf8. To avoid issues with certain special characters (e.g. german
umlauts), we also need to explicitly store the configuration files in
utf8 encoding.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
[FE: use flag parameter instead of encoding as a string]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Since this function is used to store utf8-encoded strings that come
from Rust, we need to be able to save the file in proper utf8 encoding
as well.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
[FE: use flag parameter instead of encoding as a string]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
The package contains the PVE::Notify. It is a very thin wrapper
around the Proxmox::RS::Notify module, feeding the configuration
from the new 'notifications.cfg' and 'priv/notifications.cfg' files
into it.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
These options allow setting the notification target for package update
notifications, node fencing notifications and replication notifications.
Also, fencing and replication has now new options that allow disabling
notifications altogether.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>