[pve-devel] [PATCH proxmox-perl-rs 15/15] pmg-rs: acme: simplify acount config saving

2024-06-20 Thread Lukas Wagner
We already depend on proxmox_sys, so we can just use `replace_file`. Fixing a clippy warning (missing truncate setting for OpenOptions) is an added benefit. Signed-off-by: Lukas Wagner --- pmg-rs/src/acme.rs | 62 ++ 1 file changed, 13 insertions

[pve-devel] [PATCH proxmox-perl-rs 13/15] pmg-rs: tfa: clippy: useless conversion to the same type

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pmg-rs/src/tfa.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmg-rs/src/tfa.rs b/pmg-rs/src/tfa.rs index af69721..4e9ce8f 100644 --- a/pmg-rs/src/tfa.rs +++ b/pmg-rs/src/tfa.rs @@ -178,7 +178,7 @@ mod export { #[try_from_ref

[pve-devel] [PATCH proxmox-perl-rs 09/15] pmg-rs: tfa: clippy: unnecessary `pub(self)`

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pmg-rs/src/tfa.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmg-rs/src/tfa.rs b/pmg-rs/src/tfa.rs index 1924488..0680baa 100644 --- a/pmg-rs/src/tfa.rs +++ b/pmg-rs/src/tfa.rs @@ -17,7 +17,7 @@ use anyhow::{bail, format_err, Error}; use

[pve-devel] [PATCH proxmox-perl-rs 10/15] pmg-rs: tfa: clippy: question mark operator is useless here

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pmg-rs/src/tfa.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmg-rs/src/tfa.rs b/pmg-rs/src/tfa.rs index 0680baa..a97d171 100644 --- a/pmg-rs/src/tfa.rs +++ b/pmg-rs/src/tfa.rs @@ -441,11 +441,11 @@ mod export { #[export] fn

[pve-devel] [PATCH proxmox-perl-rs 14/15] pmg-rs: acme: clippy: reference is immediately deref'd by the compiler

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pmg-rs/src/acme.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmg-rs/src/acme.rs b/pmg-rs/src/acme.rs index 7ea78c6..e2e7327 100644 --- a/pmg-rs/src/acme.rs +++ b/pmg-rs/src/acme.rs @@ -403,7 +403,7 @@ pub mod export { this.inner

[pve-devel] [PATCH proxmox-perl-rs 08/15] pve-rs: tfa: clippy: stripping a prefix manually

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/tfa.rs | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pve-rs/src/tfa.rs b/pve-rs/src/tfa.rs index 1054169..66dca3d 100644 --- a/pve-rs/src/tfa.rs +++ b/pve-rs/src/tfa.rs @@ -736,10 +736,10 @@ fn decode_old_oath_entry

[pve-devel] [PATCH proxmox-perl-rs 05/15] pve-rs: tfa: clippy: borrowed expression impls the required traits

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/tfa.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pve-rs/src/tfa.rs b/pve-rs/src/tfa.rs index 9381ef0..7588d6d 100644 --- a/pve-rs/src/tfa.rs +++ b/pve-rs/src/tfa.rs @@ -1048,7 +1048,7 @@ impl proxmox_tfa::api

[pve-devel] [PATCH proxmox-perl-rs 12/15] pmg-rs: tfa: clippy: the borrowed expression implements the required traits

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pmg-rs/src/tfa.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmg-rs/src/tfa.rs b/pmg-rs/src/tfa.rs index 928b50b..af69721 100644 --- a/pmg-rs/src/tfa.rs +++ b/pmg-rs/src/tfa.rs @@ -178,7 +178,7 @@ mod export { #[try_from_ref

[pve-devel] [PATCH proxmox-perl-rs 06/15] pve-rs: tfa: clippy: accessing first element with `.get(0)`

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/tfa.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pve-rs/src/tfa.rs b/pve-rs/src/tfa.rs index 7588d6d..7ead18c 100644 --- a/pve-rs/src/tfa.rs +++ b/pve-rs/src/tfa.rs @@ -831,7 +831,7 @@ fn generate_legacy_config(out

[pve-devel] [PATCH proxmox-perl-rs 04/15] pve-rs: tfa: clippy: question mark operator is useless here

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/tfa.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pve-rs/src/tfa.rs b/pve-rs/src/tfa.rs index 6650151..9381ef0 100644 --- a/pve-rs/src/tfa.rs +++ b/pve-rs/src/tfa.rs @@ -490,11 +490,11 @@ mod export { #[export] fn

[pve-devel] [PATCH proxmox-perl-rs 11/15] pmg-rs: tfa: clippy: this function has too many arguments

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pmg-rs/src/tfa.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pmg-rs/src/tfa.rs b/pmg-rs/src/tfa.rs index a97d171..928b50b 100644 --- a/pmg-rs/src/tfa.rs +++ b/pmg-rs/src/tfa.rs @@ -361,6 +361,7 @@ mod export { methods::list_tfa(().unwrap

[pve-devel] [PATCH proxmox-perl-rs 07/15] pve-rs: tfa: clippy: redundant slicing of the whole range

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/tfa.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pve-rs/src/tfa.rs b/pve-rs/src/tfa.rs index 7ead18c..1054169 100644 --- a/pve-rs/src/tfa.rs +++ b/pve-rs/src/tfa.rs @@ -802,7 +802,7 @@ fn usize_from_perl(value: JsonValue

[pve-devel] [PATCH proxmox-perl-rs 03/15] pve-rs: tfa: clippy: this function has too many arguments

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/tfa.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pve-rs/src/tfa.rs b/pve-rs/src/tfa.rs index 798cdad..6650151 100644 --- a/pve-rs/src/tfa.rs +++ b/pve-rs/src/tfa.rs @@ -409,6 +409,7 @@ mod export { methods::list_tfa(().unwrap

[pve-devel] [PATCH proxmox-perl-rs 01/15] pve-rs: apt: clippy: the borrowed expression implements the required traits

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- common/src/apt/repositories.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/apt/repositories.rs b/common/src/apt/repositories.rs index e710819..6e0a196 100644 --- a/common/src/apt/repositories.rs +++ b/common/src/apt

[pve-devel] [PATCH proxmox-perl-rs 02/15] pve-rs: tfa: clippy: unnecessary `pub(self)`

2024-06-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/tfa.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pve-rs/src/tfa.rs b/pve-rs/src/tfa.rs index 2b61344..798cdad 100644 --- a/pve-rs/src/tfa.rs +++ b/pve-rs/src/tfa.rs @@ -20,7 +20,7 @@ use nix::errno::Errno; use nix::sys::stat

Re: [pve-devel] applied: [PATCH proxmox-perl-rs] pve-rs: pmg-rs: move deprecated .cargo/config to .cargo/config.toml

2024-06-20 Thread Lukas Wagner
On 2024-06-20 12:21, Fabian Grünbichler wrote: > with a follow-up to adapt the Makefiles - please test builds when > touching the build system ;) > Sorry, only did a `cargo build` - :S My bad -- - Lukas ___ pve-devel mailing list

Re: [pve-devel] [PATCH proxmox-perl-rs] pve-rs: pmg-rs: move deprecated .cargo/config to .cargo/config.toml

2024-06-20 Thread Lukas Wagner
Whoops, seems like I was on stable rust (1.78) and the warning only appears there but not on 1.77 (packaged rust) - but we can apply that already anyway, saves us the trouble once we are on 1.78 :) On 2024-06-20 10:59, Lukas Wagner wrote: > Fixes the following new warning that appeared af

[pve-devel] [PATCH proxmox-perl-rs] pve-rs: pmg-rs: move deprecated .cargo/config to .cargo/config.toml

2024-06-20 Thread Lukas Wagner
Fixes the following new warning that appeared after switching to rust 1.77: warning: `proxmox-perl-rs/pve-rs/.cargo/config` is deprecated in favor of `config.toml` Signed-off-by: Lukas Wagner --- pmg-rs/.cargo/{config => config.toml} | 0 pve-rs/.cargo/{config => config.toml} | 0 2

[pve-devel] [PATCH docs v7 19/19] notifications: backport some rephrased parts from PBS docs

2024-06-10 Thread Lukas Wagner
Most of the changes were done when adapting the PVE docs to the new PBS notification system, so now we 'backport' those improvements. Signed-off-by: Lukas Wagner --- notifications.adoc | 99 +++--- 1 file changed, 67 insertions(+), 32 deletions(-) diff

[pve-devel] [PATCH widget-toolkit v7 11/19] notification: matcher: match-field: show known fields/values

2024-06-10 Thread Lukas Wagner
of known fields/values is retrieved from new API endpoints. Some values are marked 'internal' by the backend. This means that the 'value' field was not user-created (counter example: backup job IDs) and can therefore be used as a base for translations. Signed-off-by: Lukas Wagner Tested

[pve-devel] [PATCH widget-toolkit v7 12/19] notification: matcher: move match-field formulas to local viewModel

2024-06-10 Thread Lukas Wagner
This should make the code more cohesive and easier to follow. No functional changes. Signed-off-by: Lukas Wagner Tested-by: Maximiliano Sandoval --- src/window/NotificationMatcherEdit.js | 189 +- 1 file changed, 95 insertions(+), 94 deletions(-) diff --git a/src

[pve-devel] [PATCH manager v7 09/19] ui: utils: add overrides for translatable notification fields/values

2024-06-10 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- www/manager6/Utils.js | 11 +++ 1 file changed, 11 insertions(+) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index 5b0d51eb..ea448bfb 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -2060,6 +2060,17 @@ Ext.define

[pve-devel] [PATCH manager v7 06/19] vzdump: apt: notification: do not include domain in 'hostname' field

2024-06-10 Thread Lukas Wagner
in soft-breakage for any users who have already relied on the domain being present. If there is need for it, it could include a fqdn metadata field. The hostname property used for rendering the notification template is unaffected for now. Signed-off-by: Lukas Wagner --- PVE/API2/APT.pm | 3

[pve-devel] [PATCH manager v7 02/19] api: jobs: vzdump: pass job 'job-id' parameter

2024-06-10 Thread Lukas Wagner
This allows us to access us the backup job id in the send_notification function, where we can set it as metadata for the notification. Signed-off-by: Lukas Wagner --- PVE/API2/VZDump.pm | 8 PVE/Jobs/VZDump.pm | 4 +++- PVE/VZDump.pm | 6 +++--- 3 files changed, 14 insertions

[pve-devel] [PATCH pve-guest-common v7 01/19] vzdump: common: allow 'job-id' as a parameter without being in schema

2024-06-10 Thread Lukas Wagner
'job-id' is passed when a backup as started as a job and will be passed to the notification system as matchable metadata. It it can be considered 'internal'. Signed-off-by: Lukas Wagner --- src/PVE/VZDump/Common.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE

[pve-devel] [PATCH widget-toolkit v7 14/19] notification: matcher: move match-severity fields to panel

2024-06-10 Thread Lukas Wagner
Also introduce a local viewModel that is linked to a parent viewModel, allowing us to move the formulas to the panel. This should make the code more cohesive and easier to follow. No functional changes. Signed-off-by: Lukas Wagner Tested-by: Maximiliano Sandoval --- src/window

[pve-devel] [PATCH widget-toolkit v7 13/19] notification: matcher: move match-calendar fields to panel

2024-06-10 Thread Lukas Wagner
Also introduce a local viewModel that is linked to a parent viewModel, allowing us to move the formulas to the panel. This should make the code more cohesive and easier to follow. No functional changes. Signed-off-by: Lukas Wagner Tested-by: Maximiliano Sandoval --- src/window

[pve-devel] [PATCH manager v7 08/19] api: notification: add API for getting known metadata fields/values

2024-06-10 Thread Lukas Wagner
This new API route returns known notification metadata fields and a list of known possible values. This will be used by the UI to provide suggestions when adding/modifying match rules. Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 139 ++ 1 file

[pve-devel] [PATCH docs v7 16/19] notifications: describe new notification metadata fields

2024-06-10 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- notifications.adoc | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/notifications.adoc b/notifications.adoc index 57053c8..dec878a 100644 --- a/notifications.adoc +++ b/notifications.adoc @@ -289,19 +289,21 @@ Notification

[pve-devel] [PATCH docs v7 18/19] notifications: fix typo in 'notification'

2024-06-10 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- notifications.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifications.adoc b/notifications.adoc index 07f0b3e..9c5228c 100644 --- a/notifications.adoc +++ b/notifications.adoc @@ -295,7 +295,7 @@ Notification Events [width=&quo

[pve-devel] [PATCH docs v7 15/19] notification: clarify that 'hostname' does not include the domain

2024-06-10 Thread Lukas Wagner
This was a bit inconsistent between the different notification types: - APT/VZDump included the domain part - fence notifications did not A decision has been made to unify this by removing the domain part from APT/VZDump notifications. Signed-off-by: Lukas Wagner --- notifications.adoc | 2

[pve-devel] [PATCH docs v7 17/19] notifications: match-field 'exact'-mode can now match multiple values

2024-06-10 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- notifications.adoc | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/notifications.adoc b/notifications.adoc index dec878a..07f0b3e 100644 --- a/notifications.adoc +++ b/notifications.adoc @@ -221,11 +221,16 @@ configurable

[pve-devel] [PATCH manager v7 10/19] d/control: bump proxmox-widget-toolkit dependency to 4.1.4

2024-06-10 Thread Lukas Wagner
We need "utils: add mechanism to add and override translatable notification event descriptions in the product specific UIs" otherwise there is an error in the browser console. Signed-off-by: Lukas Wagner --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[pve-devel] [PATCH many v7 00/19] notifications: notification metadata matching improvements

2024-06-10 Thread Lukas Wagner
ler in UI patches pve-guest-common: Lukas Wagner (1): vzdump: common: allow 'job-id' as a parameter without being in schema src/PVE/VZDump/Common.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) pve-manager: Lukas Wagner (9): api: jobs: vzdump: pass job 'job-id' parameter ui: dc

[pve-devel] [PATCH manager v7 04/19] ui: dc: backup: allow to set custom job id in advanced settings

2024-06-10 Thread Lukas Wagner
This might be useful if somebody wants to match on the new 'backup-job' field in a notification match rule. Signed-off-by: Lukas Wagner --- www/manager6/Utils.js | 1 + www/manager6/dc/Backup.js | 4 www/manager6/panel/BackupAdvancedOptions.js | 23

[pve-devel] [PATCH manager v7 07/19] api: replication: include 'hostname' field for notifications

2024-06-10 Thread Lukas Wagner
The field contains the hostname of the host (without any domain part) which sends the notification. This field can be used in match-field match rules. Signed-off-by: Lukas Wagner --- PVE/API2/Replication.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/API2/Replication.pm b/PVE/API2

[pve-devel] [PATCH manager v7 05/19] api: replication: add 'job-id' to notification metadata

2024-06-10 Thread Lukas Wagner
This allows users to create notification match rules for specific replication jobs, if they so desire. Signed-off-by: Lukas Wagner --- PVE/API2/Replication.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/API2/Replication.pm b/PVE/API2/Replication.pm index d84ac1ab

[pve-devel] [PATCH manager v7 03/19] ui: dc: backup: send 'job-id' property when starting a backup job manually

2024-06-10 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- www/manager6/dc/Backup.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js index 4ba80b31..4b45b5c6 100644 --- a/www/manager6/dc/Backup.js +++ b/www/manager6/dc/Backup.js @@ -604,11 +604,12

Re: [pve-devel] [PATCH v1 pve-manager 2/8] ceph: tools: update Ceph version regex

2024-06-05 Thread Lukas Wagner
On 2024-04-30 17:28, Max Carrara wrote: > Make the regex more maintainable declaring it as a variable, breaking it > up and commenting it by using the x flag. > > Also remove the part that parses our Debian revision (e.g. -pve1) from > the version, as we do not actually include that in our

Re: [pve-devel] [PATCH v1 pve-manager 8/8] ui: ceph: osd: rework rendering of version field & show build commit

2024-06-05 Thread Lukas Wagner
On 2024-04-30 17:28, Max Carrara wrote: > The logic of the `render_version` function is split up in order to > handle how the version is displayed depending on the type of the row. > > If the parsed version is `undefined` or the row marks the beginning of > the tree, an empty string is now

Re: [pve-devel] [PATCH v1 pve-manager 6/8] ui: ceph: services: parse and display build commit

2024-06-05 Thread Lukas Wagner
On 2024-04-30 17:28, Max Carrara wrote: > This commit adds `PVE.Utils.parse_ceph_buildcommit`, which can be used > to get the full hash "eccf199d..." in parentheses from a string like > the following: > > ceph version 17.2.7 (eccf199d63457659c09677399928203b7903c888) quincy > (stable) > >

Re: [pve-devel] [PATCH v1 pve-manager 0/8] Ceph Build Commit in UI

2024-06-05 Thread Lukas Wagner
et uses a different icon to signal an outdated OSD than the version column in the OSD tree view - maybe it would make sense to use the same icon here? - The 'Detail' view for OSDs could also show the commit hash, right now it only shows e.g. 18.2.2 (reef) With the nits

[pve-devel] [PATCH pve-ha-manager v3 5/8] env: notify: use named templates instead of passing template strings

2024-05-21 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- debian/pve-ha-manager.install | 3 +++ src/Makefile | 1 + src/PVE/HA/Env/PVE2.pm| 4 ++-- src/PVE/HA/NodeStatus.pm | 20 +-- src/PVE/HA/Sim/Env.pm

[pve-devel] [PATCH proxmox-perl-rs v3 2/8] notify: don't pass config structs by reference

2024-05-21 Thread Lukas Wagner
proxmox_notify's api functions have been changed so that they take ownership of config structs. Signed-off-by: Lukas Wagner --- common/src/notify.rs | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/common/src/notify.rs b/common/src/notify.rs index

[pve-devel] [PATCH many v3 0/8] notifications: move template strings to template files

2024-05-21 Thread Lukas Wagner
cosmetics/style proxmox-perl-rs: Lukas Wagner (3): notify: use file based notification templates notify: don't pass config structs by reference notify: adapt to Option> to Vec changes in proxmox_notify common/src/notify.rs | 48 +--- 1 file changed,

[pve-devel] [PATCH proxmox-perl-rs v3 3/8] notify: adapt to Option> to Vec changes in proxmox_notify

2024-05-21 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- common/src/notify.rs | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/src/notify.rs b/common/src/notify.rs index 00a6056..e1b006b 100644 --- a/common/src/notify.rs +++ b/common/src/notify.rs @@ -153,8 +153,8 @@ mod export

[pve-devel] [PATCH manager v3 8/8] notifications: use named templates instead of in-code templates

2024-05-21 Thread Lukas Wagner
This commit adapts notification sending for - package update - replication - backups to use named templates (installed in /usr/share/pve-manager/templates) instead of passing template strings defined in code to the notification stack. Signed-off-by: Lukas Wagner --- Makefile

[pve-devel] [PATCH manager v3 7/8] tests: remove vzdump_notification test

2024-05-21 Thread Lukas Wagner
testing if the backup logs are shortened if they ware too long - so they are just removed. Signed-off-by: Lukas Wagner --- test/Makefile| 6 +- test/vzdump_notification_test.pl | 101 --- 2 files changed, 1 insertion(+), 106 deletions(-) delete

[pve-devel] [PATCH manager v3 6/8] gitignore: ignore any test artifacts

2024-05-21 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index e8d1eb27..481ae1e0 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ dest/ /www/mobile/pvemanager-mobile.js /www/touch/touch-[0-9]*/ /pve-manager-[0-9

[pve-devel] [PATCH cluster v3 4/8] notify: use named template instead of passing template strings

2024-05-21 Thread Lukas Wagner
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 --- src/PVE/Notify.pm | 29 - 1 file changed, 12

[pve-devel] [PATCH proxmox-perl-rs v3 1/8] notify: use file based notification templates

2024-05-21 Thread Lukas Wagner
Instead of passing literal template strings to the notification system, we now only pass an identifier. This identifier will be used load the template files from a product-specific directory. Signed-off-by: Lukas Wagner --- common/src/notify.rs | 8 +++- 1 file changed, 3 insertions(+), 5

Re: [pve-devel] [PATCH docs v6 15/16] notifications: describe new notification metadata fields

2024-04-22 Thread Lukas Wagner
On 2024-04-22 11:10, Fiona Ebner wrote: >> +| Cluster node fenced |`fencing` | `error` | >> `hostname` >> +| Storage replication job failed |`replication` | `error` | >> `hostname`, `job-id` >> +| Backup succeeded |`vzdump` | `info`

[pve-devel] [PATCH docs v6 15/16] notifications: describe new notification metadata fields

2024-04-22 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- notifications.adoc | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/notifications.adoc b/notifications.adoc index 57053c8..dec878a 100644 --- a/notifications.adoc +++ b/notifications.adoc @@ -289,19 +289,21 @@ Notification

[pve-devel] [PATCH docs v6 16/16] notifications: match-field 'exact'-mode can now match multiple values

2024-04-22 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- notifications.adoc | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/notifications.adoc b/notifications.adoc index dec878a..07f0b3e 100644 --- a/notifications.adoc +++ b/notifications.adoc @@ -221,11 +221,16 @@ configurable

[pve-devel] [PATCH docs v6 14/16] notification: clarify that 'hostname' does not include the domain

2024-04-22 Thread Lukas Wagner
This was a bit inconsistent between the different notification types: - APT/VZDump included the domain part - fence notifications did not A decision has been made to unify this by removing the domain part from APT/VZDump notifications. Signed-off-by: Lukas Wagner --- notifications.adoc | 2

[pve-devel] [PATCH manager v6 07/16] api: replication: include 'hostname' field for notifications

2024-04-22 Thread Lukas Wagner
The field contains the hostname of the host (without any domain part) which sends the notification. This field can be used in match-field match rules. Signed-off-by: Lukas Wagner --- PVE/API2/Replication.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/API2/Replication.pm b/PVE/API2

[pve-devel] [PATCH manager v6 04/16] ui: dc: backup: allow to set custom job id in advanced settings

2024-04-22 Thread Lukas Wagner
This might be useful if somebody wants to match on the new 'backup-job' field in a notification match rule. Signed-off-by: Lukas Wagner --- www/manager6/Utils.js | 1 + www/manager6/panel/BackupAdvancedOptions.js | 15 +++ 2 files changed, 16 insertions

[pve-devel] [PATCH manager v6 05/16] api: replication: add 'job-id' to notification metadata

2024-04-22 Thread Lukas Wagner
This allows users to create notification match rules for specific replication jobs, if they so desire. Signed-off-by: Lukas Wagner --- PVE/API2/Replication.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/API2/Replication.pm b/PVE/API2/Replication.pm index 0dc944c9

[pve-devel] [PATCH manager v6 09/16] ui: utils: add overrides for translatable notification fields/values

2024-04-22 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- www/manager6/Utils.js | 11 +++ 1 file changed, 11 insertions(+) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index 5216198b..89929d21 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -2060,6 +2060,17 @@ Ext.define

[pve-devel] [PATCH widget-toolkit v6 10/16] notification: matcher: match-field: show known fields/values

2024-04-22 Thread Lukas Wagner
of known fields/values is retrieved from new API endpoints. Some values are marked 'internal' by the backend. This means that the 'value' field was not user-created (counter example: backup job IDs) and can therefore be used as a base for translations. Signed-off-by: Lukas Wagner Tested

[pve-devel] [PATCH widget-toolkit v6 13/16] notification: matcher: move match-severity fields to panel

2024-04-22 Thread Lukas Wagner
Also introduce a local viewModel that is linked to a parent viewModel, allowing us to move the formulas to the panel. This should make the code more cohesive and easier to follow. No functional changes. Signed-off-by: Lukas Wagner Tested-by: Maximiliano Sandoval --- src/window

[pve-devel] [PATCH widget-toolkit v6 11/16] notification: matcher: move match-field formulas to local viewModel

2024-04-22 Thread Lukas Wagner
This should make the code more cohesive and easier to follow. No functional changes. Signed-off-by: Lukas Wagner Tested-by: Maximiliano Sandoval --- src/window/NotificationMatcherEdit.js | 186 +- 1 file changed, 92 insertions(+), 94 deletions(-) diff --git a/src

[pve-devel] [PATCH manager v6 08/16] api: notification: add API for getting known metadata fields/values

2024-04-22 Thread Lukas Wagner
This new API route returns known notification metadata fields and a list of known possible values. This will be used by the UI to provide suggestions when adding/modifying match rules. Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 139 ++ 1 file

[pve-devel] [PATCH widget-toolkit v6 12/16] notification: matcher: move match-calendar fields to panel

2024-04-22 Thread Lukas Wagner
Also introduce a local viewModel that is linked to a parent viewModel, allowing us to move the formulas to the panel. This should make the code more cohesive and easier to follow. No functional changes. Signed-off-by: Lukas Wagner Tested-by: Maximiliano Sandoval --- src/window

[pve-devel] [PATCH docs/guest-common/manager/widget-toolkit v6 00/16] notifications: notification metadata matching improvements

2024-04-22 Thread Lukas Wagner
-b trailer in UI patches pve-guest-common: Lukas Wagner (1): vzdump: common: allow 'job-id' as a parameter without being in schema src/PVE/VZDump/Common.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) pve-manager: Lukas Wagner (8): api: jobs: vzdump: pass job 'job-id' parameter

[pve-devel] [PATCH manager v6 06/16] vzdump: apt: notification: do not include domain in 'hostname' field

2024-04-22 Thread Lukas Wagner
in soft-breakage for any users who have already relied on the domain being present. If there is need for it, it could include a fqdn metadata field. The hostname property used for rendering the notification template is unaffected for now. Signed-off-by: Lukas Wagner --- PVE/API2/APT.pm | 3

[pve-devel] [PATCH manager v6 02/16] api: jobs: vzdump: pass job 'job-id' parameter

2024-04-22 Thread Lukas Wagner
This allows us to access us the backup job id in the send_notification function, where we can set it as metadata for the notification. Signed-off-by: Lukas Wagner --- PVE/API2/VZDump.pm | 8 PVE/Jobs/VZDump.pm | 4 +++- PVE/VZDump.pm | 6 +++--- 3 files changed, 14 insertions

[pve-devel] [PATCH manager v6 03/16] ui: dc: backup: send 'job-id' property when starting a backup job manually

2024-04-22 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- www/manager6/dc/Backup.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js index 2619a77b..d68f553c 100644 --- a/www/manager6/dc/Backup.js +++ b/www/manager6/dc/Backup.js @@ -586,11 +586,12

[pve-devel] [PATCH pve-guest-common v6 01/16] vzdump: common: allow 'job-id' as a parameter without being in schema

2024-04-22 Thread Lukas Wagner
'job-id' is passed when a backup as started as a job and will be passed to the notification system as matchable metadata. It it can be considered 'internal'. Signed-off-by: Lukas Wagner --- src/PVE/VZDump/Common.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE

[pve-devel] [PATCH proxmox v2 01/20] notify: switch to file-based templating system

2024-04-19 Thread Lukas Wagner
' HTML/plaintext formatting. However, in hindsight this turned out to be pretty finicky. Since the current changes lay the foundations for user-customizable notification templates, I ripped these abstractions out. Now there are simply two templates, one for plaintext, one for HTML. Signed-off-by: Lukas

[pve-devel] [PATCH proxmox v2 02/20] notify: make api methods take config struct ownership

2024-04-19 Thread Lukas Wagner
This saves us from some of the awkward cloning steps when updating. Suggested-by: Wolfgang Bumiller Signed-off-by: Lukas Wagner Tested-by: Folke Gleumes Reviewed-by: Fiona Ebner --- proxmox-notify/src/api/gotify.rs | 46 +- proxmox-notify/src/api/matcher.rs | 38

[pve-devel] [PATCH proxmox v2 03/20] notify: convert Option> -> Vec in config structs

2024-04-19 Thread Lukas Wagner
Suggested-by: Wolfgang Bumiller Signed-off-by: Lukas Wagner Tested-by: Folke Gleumes Reviewed-by: Fiona Ebner --- proxmox-notify/src/api/matcher.rs | 27 +++ proxmox-notify/src/api/mod.rs | 22 +--- proxmox-notify/src/api/sendmail.rs | 22

[pve-devel] [PATCH proxmox-perl-rs v2 14/20] notify: don't pass config structs by reference

2024-04-19 Thread Lukas Wagner
proxmox_notify's api functions have been changed so that they take ownership of config structs. Signed-off-by: Lukas Wagner Tested-by: Folke Gleumes Reviewed-by: Fiona Ebner --- common/src/notify.rs | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git

[pve-devel] [PATCH proxmox v2 09/20] notify: derive `api` for Deleteable*Property

2024-04-19 Thread Lukas Wagner
The API endpoints in Proxmox Backup Server require ApiType to be implemented for any deserialized parameter. Signed-off-by: Lukas Wagner Reviewed-by: Fiona Ebner --- proxmox-notify/src/endpoints/gotify.rs | 3 +++ proxmox-notify/src/endpoints/sendmail.rs | 7 +++ proxmox-notify/src

[pve-devel] [PATCH proxmox-perl-rs v2 13/20] notify: use file based notification templates

2024-04-19 Thread Lukas Wagner
Instead of passing literal template strings to the notification system, we now only pass an identifier. This identifier will be used load the template files from a product-specific directory. Signed-off-by: Lukas Wagner Tested-by: Folke Gleumes Reviewed-by: Fiona Ebner --- common/src

[pve-devel] [PATCH proxmox-perl-rs v2 15/20] notify: adapt to Option> to Vec changes in proxmox_notify

2024-04-19 Thread Lukas Wagner
Signed-off-by: Lukas Wagner Tested-by: Folke Gleumes Reviewed-by: Fiona Ebner --- common/src/notify.rs | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/src/notify.rs b/common/src/notify.rs index 00a6056..e1b006b 100644 --- a/common/src/notify.rs +++ b

[pve-devel] [PATCH proxmox v2 10/20] notify: derive Deserialize/Serialize for Notification struct

2024-04-19 Thread Lukas Wagner
Signed-off-by: Lukas Wagner Reviewed-by: Fiona Ebner --- proxmox-notify/src/lib.rs | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/proxmox-notify/src/lib.rs b/proxmox-notify/src/lib.rs index 91c0b61..292396b 100644 --- a/proxmox-notify/src/lib.rs +++ b/proxmox

[pve-devel] [PATCH proxmox v2 11/20] notify: pbs context: include nodename in default sendmail author

2024-04-19 Thread Lukas Wagner
The old notification stack in proxmox-backup includes the nodename, so we include it here as well. Signed-off-by: Lukas Wagner Reviewed-by: Fiona Ebner --- proxmox-notify/src/context/pbs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxmox-notify/src/context/pbs.rs b

[pve-devel] [PATCH proxmox v2 08/20] notify: api: add get_targets

2024-04-19 Thread Lukas Wagner
This method allows us to get a list of all notification targets. Signed-off-by: Lukas Wagner Reviewed-by: Fiona Ebner --- proxmox-notify/src/api/mod.rs | 77 +++ 1 file changed, 77 insertions(+) diff --git a/proxmox-notify/src/api/mod.rs b/proxmox-notify/src

[pve-devel] [PATCH proxmox v2 07/20] notify: give each notification a unique ID

2024-04-19 Thread Lukas Wagner
We need this for queuing notifications on PBS from the unprivileged proxy process. Signed-off-by: Lukas Wagner Reviewed-by: Fiona Ebner --- proxmox-notify/Cargo.toml | 1 + proxmox-notify/src/lib.rs | 11 +++ 2 files changed, 12 insertions(+) diff --git a/proxmox-notify/Cargo.toml b

[pve-devel] [PATCH manager v2 20/20] notifications: use named templates instead of in-code templates

2024-04-19 Thread Lukas Wagner
This commit adapts notification sending for - package update - replication - backups to use named templates (installed in /usr/share/pve-manager/templates) instead of passing template strings defined in code to the notification stack. Signed-off-by: Lukas Wagner Tested-by: Folke

[pve-devel] [PATCH pve-ha-manager v2 17/20] env: notify: use named templates instead of passing template strings

2024-04-19 Thread Lukas Wagner
Signed-off-by: Lukas Wagner Tested-by: Folke Gleumes Reviewed-by: Fiona Ebner --- debian/pve-ha-manager.install | 3 +++ src/Makefile | 1 + src/PVE/HA/Env/PVE2.pm| 4 ++-- src/PVE/HA/NodeStatus.pm

[pve-devel] [PATCH manager v2 19/20] tests: remove vzdump_notification test

2024-04-19 Thread Lukas Wagner
testing if the backup logs are shortened if they ware too long - so they are just removed. Signed-off-by: Lukas Wagner Reviewed-by: Fiona Ebner --- test/Makefile| 6 +- test/vzdump_notification_test.pl | 101 --- 2 files changed, 1 insertion

[pve-devel] [PATCH cluster v2 16/20] notify: use named template instead of passing template strings

2024-04-19 Thread Lukas Wagner
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 Tested-by: Folke Gleumes Reviewed-by: Fiona Ebner --- src/PVE/Notify.pm | 29

[pve-devel] [PATCH proxmox v2 04/20] notify: don't make tests require pve-context

2024-04-19 Thread Lukas Wagner
Tests now have their own context, so requiring pve-context is not necessary any more. Signed-off-by: Lukas Wagner Tested-by: Folke Gleumes Reviewed-by: Fiona Ebner --- proxmox-notify/src/api/gotify.rs | 2 +- proxmox-notify/src/api/matcher.rs | 2 +- proxmox-notify/src/api/sendmail.rs

[pve-devel] [PATCH manager v2 18/20] gitignore: ignore any test artifacts

2024-04-19 Thread Lukas Wagner
Signed-off-by: Lukas Wagner Reviewed-by: Fiona Ebner --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index e8d1eb27..481ae1e0 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ dest/ /www/mobile/pvemanager-mobile.js /www/touch/touch-[0-9

[pve-devel] [PATCH proxmox v2 12/20] notify: renderer: add relative-percentage helper from PBS

2024-04-19 Thread Lukas Wagner
Signed-off-by: Lukas Wagner Reviewed-by: Fiona Ebner --- proxmox-notify/src/renderer/mod.rs | 29 + 1 file changed, 29 insertions(+) diff --git a/proxmox-notify/src/renderer/mod.rs b/proxmox-notify/src/renderer/mod.rs index a51ece6..ddb241d 100644 --- a/proxmox

[pve-devel] [PATCH proxmox v2 06/20] notify: cargo.toml: add spaces before curly braces

2024-04-19 Thread Lukas Wagner
Signed-off-by: Lukas Wagner Reviewed-by: Fiona Ebner --- proxmox-notify/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxmox-notify/Cargo.toml b/proxmox-notify/Cargo.toml index 3e8d253..185b50a 100644 --- a/proxmox-notify/Cargo.toml +++ b/proxmox-notify

[pve-devel] [PATCH proxmox v2 05/20] notify: make the `mail-forwarder` feature depend on proxmox-sys

2024-04-19 Thread Lukas Wagner
It uses proxmox_sys::nodename - the dep is needed, otherwise the code does not compile in some feature flag permutations. Signed-off-by: Lukas Wagner Tested-by: Folke Gleumes Reviewed-by: Fiona Ebner --- proxmox-notify/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[pve-devel] [PATCH many v2 00/20] notifications: move template strings to template files; PBS preparations

2024-04-19 Thread Lukas Wagner
noteworthy: Change template path from /usr/share/proxmox-ve to /usr/share/ - apart from that mostly just cosmetics/style proxmox: Lukas Wagner (12): notify: switch to file-based templating system notify: make api methods take config struct ownership notify: convert Option> -&g

Re: [pve-devel] [PATCH manager v5 08/16] api: notification: add API for getting known metadata fields/values

2024-04-19 Thread Lukas Wagner
On 2024-04-19 15:45, Fiona Ebner wrote: > Am 15.04.24 um 10:26 schrieb Lukas Wagner: >> + >> +__PACKAGE__->register_method ({ >> +name => 'get_field_values', >> +path => 'values', >> +method => 'GET', >> +descrip

Re: [pve-devel] [PATCH manager v5 05/16] api: replication: add 'replication-job' to notification metadata

2024-04-19 Thread Lukas Wagner
On 2024-04-19 15:11, Fiona Ebner wrote: > Am 19.04.24 um 14:22 schrieb Lukas Wagner: >> >> >> On 2024-04-19 14:02, Fiona Ebner wrote: >>> Am 15.04.24 um 10:26 schrieb Lukas Wagner: >>>> This allows users to create notification match rules for specifi

Re: [pve-devel] [PATCH proxmox 07/19] notify: api: add get_targets

2024-04-19 Thread Lukas Wagner
On 2024-04-19 10:34, Fiona Ebner wrote: > Am 09.04.24 um 15:25 schrieb Lukas Wagner: >> +/// Get a list of all notification targets. >> +pub fn get_targets(config: ) -> Result, HttpError> { >> +let mut targets = Vec::new(); >> + >> +#[cfg(fe

Re: [pve-devel] [PATCH proxmox 09/19] notify: derive Deserialize/Serialize for Notification struct

2024-04-19 Thread Lukas Wagner
On 2024-04-19 10:45, Fiona Ebner wrote: > Nit: I always like a quick sentence for who needs it for such changes. > > Am 09.04.24 um 15:25 schrieb Lukas Wagner: >> Signed-off-by: Lukas Wagner >> --- >> proxmox-notify/src/lib.rs | 10 +++--- >> 1 file chan

Re: [pve-devel] [PATCH manager v5 04/16] ui: dc: backup: allow to set custom job id in advanced settings

2024-04-19 Thread Lukas Wagner
On 2024-04-19 12:31, Fiona Ebner wrote: > Am 15.04.24 um 10:26 schrieb Lukas Wagner: >> This might be useful if somebody wants to match on the new >> 'backup-job' field in a notification match rule. >> >> Signed-off-by: Lukas Wagner >> --- >> www/

Re: [pve-devel] [PATCH manager v5 05/16] api: replication: add 'replication-job' to notification metadata

2024-04-19 Thread Lukas Wagner
On 2024-04-19 14:02, Fiona Ebner wrote: > Am 15.04.24 um 10:26 schrieb Lukas Wagner: >> This allows users to create notification match rules for specific >> replication jobs, if they so desire. >> >> Signed-off-by: Lukas Wagner >> --- >> PVE/API2/Repl

Re: [pve-devel] [PATCH many 00/19] notifications: move template strings to template files; PBS preparations

2024-04-19 Thread Lukas Wagner
On 2024-04-19 13:22, Fabian Grünbichler wrote: > On April 19, 2024 12:09 pm, Fiona Ebner wrote: >> Am 09.04.24 um 15:25 schrieb Lukas Wagner: >>> Bumps/dependencies: >>> - proxmox_notify >>> - libproxmox-rs-perl/libpve-rs-perl (needs bumped proxmox_n

Re: [pve-devel] [PATCH manager 19/19] notifications: use named templates instead of in-code templates

2024-04-19 Thread Lukas Wagner
On 2024-04-19 11:59, Fiona Ebner wrote: > Am 09.04.24 um 15:25 schrieb Lukas Wagner: >> diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm >> index 152eb3e5..2ea626f0 100644 >> --- a/PVE/VZDump.pm >> +++ b/PVE/VZDump.pm > > The existing $subject_template and $body_tem

Re: [pve-devel] [PATCH proxmox 01/19] notify: switch to file-based templating system

2024-04-19 Thread Lukas Wagner
On 2024-04-19 10:57, Fiona Ebner wrote: > Am 19.04.24 um 10:45 schrieb Lukas Wagner: >>> Who adds the template files? I don't see a patch for proxmox-ve in this >>> series. Does this series require some versioned breaks to some package? >> >> The pve-manage

Re: [pve-devel] [PATCH proxmox 01/19] notify: switch to file-based templating system

2024-04-19 Thread Lukas Wagner
On 2024-04-19 10:14, Fiona Ebner wrote: > Am 09.04.24 um 15:25 schrieb Lukas Wagner: >> Instead of passing the template strings for subject and body when >> constructing a notification, we pass only the name of a template. >> When rendering the template, the name of

  1   2   3   4   5   6   7   8   9   >