Commit graph

883 commits

Author SHA1 Message Date
Gabriel Goller
54db793f42 add consent-text parameter to datacenter config file
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>
2025-04-04 18:59:20 +02:00
Lukas Wagner
5f1b748a78 notify: add common_template_data
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>
2025-04-04 12:15:06 +02:00
Thomas Lamprecht
3749d370ac bump version to 8.0.10
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-18 22:20:01 +01:00
Stoiko Ivanov
6a1706e505 cfs: add 'sdn/mac-cache.json' to observed files
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>
2024-11-18 22:19:11 +01:00
Thomas Lamprecht
d2cc9918a9 bump version to 8.0.9
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-18 16:30:10 +01:00
Thomas Lamprecht
d8ef05cca8 cfs: add 'sdn/pve-ipam-state.json' to observed files
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>
2024-11-18 14:48:42 +01:00
Thomas Lamprecht
456814e946 setup: small code style clean-up
no semantic change intended at all

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-29 17:57:50 +01:00
Thomas Lamprecht
7407b49605 bump version to 8.0.8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-16 19:10:32 +02:00
Dominik Csapak
1db5cfcf93 fix #5728: pmxcfs: allow bigger writes than 4k for fuse
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>
2024-10-16 18:56:41 +02:00
Wolfgang Bumiller
ec2fb1da58 bump version to 8.0.7
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-04 11:04:06 +02:00
Wolfgang Bumiller
276ae14709 the notify update breaks older pve-{ha-,}manager
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-04 11:04:06 +02:00
Wolfgang Bumiller
7f49d19c6d bump pve-rs dependency for the notification update
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-04 11:03:54 +02:00
Lukas Wagner
25715ccf35 notify: use named template instead of passing template strings
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>
2024-06-03 14:20:33 +02:00
Aaron Lauterer
cc4b842c5c fix #5461: pvecm: use ssh_info_to_command for intra cluster ssh
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>
2024-05-22 10:15:08 +02:00
Thomas Lamprecht
0502066f94 bump version to 8.0.6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-19 08:36:05 +02:00
Fabian Grünbichler
b1302e9e32 pvecm: stop merging SSH known hosts by default
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>
2024-03-25 18:00:31 +01:00
Fabian Grünbichler
86c48829e6 ssh: expose SSH options on their own
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>
2024-03-25 18:00:31 +01:00
Fabian Grünbichler
1f3febdbf4 fix #4886: SSH: pin node's host key if available
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>
2024-03-25 18:00:31 +01:00
Fabian Grünbichler
a904dfe0d5 fix #4886: write node SSH hostkey to pmxcfs
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>
2024-03-25 17:59:43 +01:00
Lukas Wagner
996e1e7a8f datacenter config: mark notification settings as deprecated/unused
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>
2024-03-25 17:55:47 +01:00
Fabian Grünbichler
8193621220 ssh: default to 4096 bit keys when generating
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-03-25 08:45:02 +01:00
Fiona Ebner
2e276ccd9b cfs_write_file: fix accidental UTF-8 re-encoding
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>
2024-01-16 11:23:04 +01:00
Thomas Lamprecht
4d57ca97e2 bump version to 8.0.5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-17 14:40:36 +01:00
Thomas Lamprecht
f2bd2d47e0 d/control: bump versioned dependency for libpve-rs-perl to >= 0.8.7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-17 14:35:12 +01:00
Lukas Wagner
186bf9ecd5 notify: adapt to matcher based notification system
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>
2023-11-17 14:28:21 +01:00
Dominik Csapak
8ff6dd57b8 add profiles.cfg to cluster fs
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-11-17 14:27:39 +01:00
Alexandre Derumier
2b2ecfe8a7 add priv/macs.db
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>
2023-11-17 14:26:47 +01:00
Thomas Lamprecht
ebcef77ffd cluster setup: drop max-size override for file_get_contents calls
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>
2023-11-17 14:23:53 +01:00
Thomas Lamprecht
d6dcd53fe1 cluster setup: clean-up variable naming and consitency
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-17 14:16:52 +01:00
Thomas Lamprecht
e6c91e0012 datacenter config: avoid writing out default MAC prefix
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-29 18:06:37 +01:00
Thomas Lamprecht
f40a6d9c57 fix # 4764: datacenter config: default MAC prefix to official Proxmox OUI
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>
2023-10-29 17:49:02 +01:00
Thomas Lamprecht
a21d7e2203 datacenter config: add missing language codes and comment all
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>
2023-10-29 15:44:26 +01:00
Thomas Lamprecht
c274026b78 datacenter config: fix descriptions for user-tag-access schema
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-29 15:41:27 +01:00
Thomas Lamprecht
044f5dc6a4 datacenter config: update comment for removing applet console-viewer
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-02 13:09:35 +02:00
Fiona Ebner
ca2d1f2a79 bump version to 8.0.4
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-09-11 14:24:30 +02:00
Fiona Ebner
5a00b4d8a9 d/control: add/bump libpve-notify-perl dependency for libpve-common-perl to >= 8.0.9
Needed for the forcing UTF-8 encoding with file_set_contents().

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-09-11 14:24:28 +02:00
Fiona Ebner
a9d3c8b57c d/control: run wrap-and-sort -tkn
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-09-11 14:23:45 +02:00
Lukas Wagner
4a78dac0a2 fix #4937: notify: write configuration files in utf8 encoding
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>
2023-09-11 13:43:55 +02:00
Lukas Wagner
90c824bafe cluster fs: allow to force UTF-8 encoding for cfs_write_file
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>
2023-09-11 13:41:50 +02:00
Lukas Wagner
317a212f69 buildsys: add libpve-notify-perl package to $(LIB_DEB) variable
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
[w.bumiller@proxmox.com: add missing '_all' suffix
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-25 09:21:30 +02:00
Wolfgang Bumiller
26064fcae9 bump version to 8.0.3
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-24 15:10:18 +02:00
Wolfgang Bumiller
34aa4d7dd6 d/control: extended description for libpve-notify-perl
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-24 15:10:18 +02:00
Wolfgang Bumiller
0b65d8de38 d/control: libpve-notify-perl depneds on libproxmox-rs-perl 0.3.1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-24 14:38:06 +02:00
Wolfgang Bumiller
edd02d18a2 d/control: set libpve-rs-perl dep to 0.8.5
This will be the first one introducing the notify packages.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-24 14:38:06 +02:00
Lukas Wagner
c1b3b947f9 notify: use renamed Proxmox::RS::Notify
Suggested-by: Wolfgang Bugmiller <w.bumiller@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-07-24 14:38:06 +02:00
Lukas Wagner
d1606d46db add libpve-notify-perl package
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>
2023-07-24 12:02:27 +02:00
Lukas Wagner
d91e09cf84 datacenter: add APT/fencing/replication notification configuration
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>
2023-07-24 12:02:24 +02:00
Lukas Wagner
41ceede7a2 cluster files: add notifications.cfg
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-07-24 12:02:22 +02:00
Thomas Lamprecht
a56696c2a0 bump version to 8.0.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 19:29:38 +02:00
Thomas Lamprecht
b7f059ff36 d/control: bump dependency for libpve-common-perl to >= 8.0.6
to get new run_fork_with_timeout behavior in list context.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 19:29:38 +02:00