Re: [pve-devel] [PATCH v3 proxmox 06/66] notify: api: add API for sendmail endpoints

2023-07-19 Thread Lukas Wagner
On 7/18/23 14:36, Wolfgang Bumiller wrote: + +/// Get sendmail endpoint with given `name`. +/// +/// The caller is responsible for any needed permission checks. +/// Returns the endpoint or an `ApiError` if the endpoint was not found. +pub fn get_endpoint(config: &Config, name: &str) -> Result

Re: [pve-devel] [PATCH v3 proxmox-perl-rs 24/66] add PVE::RS::Notify module

2023-07-19 Thread Lukas Wagner
On 7/19/23 12:23, Wolfgang Bumiller wrote: +#[export(raw_return)] +fn parse_config( +#[raw] class: Value, +raw_config: &str, +raw_private_config: &str, I half-suspect that using &[u8] here - since that's what perl *actually* gives us if we just read the data out

Re: [pve-devel] [PATCH v3 many 00/66] fix #4156: introduce new notification system

2023-07-19 Thread Lukas Wagner
Hi again, On 7/18/23 14:34, Dominik Csapak wrote: * i found one bug, but not quite sure yet where it comes from exactly,   putting in emojis into a field (e.g. a comment or author) it's accepted,   but editing a different entry fails with: --->8--- could not serialize configuration: writing '

Re: [pve-devel] [PATCH v3 many 00/66] fix #4156: introduce new notification system

2023-07-18 Thread Lukas Wagner
On 7/18/23 15:58, Dominik Csapak wrote: I already have patches laying around that implement the additional filter matchers, but decided to not include them in the patch series yet. Before the new matchers are merged, I would need to 'stabilize' the properties associate with every single not

Re: [pve-devel] [PATCH v3 proxmox 08/66] notify: api: add API for gotify endpoints

2023-07-18 Thread Lukas Wagner
On 7/18/23 14:44, Wolfgang Bumiller wrote: +} + +if super::endpoint_exists(config, &endpoint_config.name) { (*could* dedup the whole if into a helper in `super` so we don't need to copy-pasta the message to every new endpoint - we already have this twice now ;-) ) Yup, a later com

Re: [pve-devel] [PATCH v3 many 00/66] fix #4156: introduce new notification system

2023-07-18 Thread Lukas Wagner
On 7/18/23 14:34, Dominik Csapak wrote: gave the series a quick spin, review of the gui patches comes later ;) a few high level comments from a user perspective: * the node fencing/replication edit windows always shows the warning that it shouldn't be   disabled, that should imo only be there

[pve-devel] [PATCH manager] ui: replication: backup: use renderEnabledIcon to render the enabled column

2023-07-18 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- www/manager6/dc/Backup.js| 3 +-- www/manager6/grid/Replication.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js index 03a02651..e662dd36 100644 --- a/www/manager6/dc/Backup.js

Re: [pve-devel] [PATCH v3 proxmox 02/66] notify: preparation for the first endpoint plugin

2023-07-18 Thread Lukas Wagner
Thanks for the review! On 7/17/23 17:48, Maximiliano Sandoval wrote: Lukas Wagner writes: Signed-off-by: Lukas Wagner --- Cargo.toml | 1 + proxmox-notify/Cargo.toml | 9 + proxmox-notify/src/config.rs| 51 + proxmox-notify/src

[pve-devel] [PATCH v3 pve-manager 51/66] api: notification: allow fetching notification targets

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 100 ++ 1 file changed, 100 insertions(+) diff --git a/PVE/API2/Cluster/Notifications.pm b/PVE/API2/Cluster/Notifications.pm index e358573c..32a873a7 100644 --- a/PVE/API2/Cluster/Notifications.pm

[pve-devel] [PATCH v3 pve-manager 48/66] api: notification: add api routes for sendmail endpoints

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 315 ++ 1 file changed, 315 insertions(+) diff --git a/PVE/API2/Cluster/Notifications.pm b/PVE/API2/Cluster/Notifications.pm index b1971911..aea571f0 100644 --- a/PVE/API2/Cluster/Notifications.pm

[pve-devel] [PATCH v3 proxmox 11/66] notify: add notification filter mechanism

2023-07-17 Thread Lukas Wagner
This commit adds a way to filter notifications based on severity. The filter module also has the necessary foundation work for more complex filters, e.g. matching on properties or for creating arbitarily complex filter structures using nested sub-filters. Signed-off-by: Lukas Wagner --- proxmox

[pve-devel] [PATCH v3 pve-manager 42/66] vzdump: send notifications via new notification module

2023-07-17 Thread Lukas Wagner
end_notification` - Breaking out some of the code into helper subs, hopefully reducing the spaghetti factor a bit Signed-off-by: Lukas Wagner --- PVE/API2/VZDump.pm | 10 +- PVE/VZDump.pm | 335 + test/mail_test.pl | 36 ++--- 3 files c

[pve-devel] [PATCH v3 proxmox 23/66] notify: add debian packaging

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/debian/changelog | 5 ++ proxmox-notify/debian/control | 108 proxmox-notify/debian/copyright | 16 + proxmox-notify/debian/debcargo.toml | 7 ++ 4 files changed, 136 insertions(+) create mode

[pve-devel] [PATCH v3 pve-manager 55/66] ui: backup: adapt backup job details to new notification params

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- www/manager6/dc/BackupJobDetail.js | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/www/manager6/dc/BackupJobDetail.js b/www/manager6/dc/BackupJobDetail.js index c4683a47..8b9bb749 100644 --- a/www/manager6/dc

[pve-devel] [PATCH v3 pve-manager 43/66] test: rename mail_test.pl to vzdump_notification_test.pl

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- test/Makefile | 8 test/{mail_test.pl => vzdump_notification_test.pl} | 0 2 files changed, 4 insertions(+), 4 deletions(-) rename test/{mail_test.pl => vzdump_notification_test.pl} (100%) diff --git a/test/Ma

[pve-devel] [PATCH v3 proxmox 21/66] notify: ensure that filter/group/endpoint names are unique

2023-07-17 Thread Lukas Wagner
Otherwise, a filter with the same name as an already existing endpoint or group can overwrite it. Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/filter.rs | 7 + proxmox-notify/src/api/gotify.rs | 10 +-- proxmox-notify/src/api/group.rs| 24 ++- proxmox

[pve-devel] [PATCH v3 proxmox 20/66] notify: on deletion, check if a filter/endp. is still used by anything

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/filter.rs | 1 + proxmox-notify/src/api/gotify.rs | 1 + proxmox-notify/src/api/mod.rs | 113 ++--- proxmox-notify/src/api/sendmail.rs | 1 + 4 files changed, 106 insertions(+), 10 deletions(-) diff

[pve-devel] [PATCH v3 proxmox-widget-toolkit 63/66] notification: add gui for notification groups

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- src/Makefile| 1 + src/Schema.js | 5 + src/panel/NotificationGroupEditPanel.js | 177 src/window/EndpointEditBase.js | 6 +- 4 files changed, 188 insertions(+), 1

[pve-devel] [PATCH v3 pve-manager 52/66] api: notification: allow to test targets

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 40 +++ 1 file changed, 40 insertions(+) diff --git a/PVE/API2/Cluster/Notifications.pm b/PVE/API2/Cluster/Notifications.pm index 32a873a7..fa2c1d9d 100644 --- a/PVE/API2/Cluster/Notifications.pm

[pve-devel] [PATCH v3 proxmox-perl-rs 27/66] notify: add api for sendmail endpoints

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/notify.rs | 88 1 file changed, 88 insertions(+) diff --git a/pve-rs/src/notify.rs b/pve-rs/src/notify.rs index cac233a..9490ea8 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -5,6 +5,9

[pve-devel] [PATCH v3 pve-manager 59/66] ui: perm path: load notification target/filter acl entries

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: I'm not sure if I like this solution, but adding notification targets to the resources API endpoint would not have make sense. Maybe we could create a new API endpoint that returns all possible ACL paths and then use a normal store fo

[pve-devel] [PATCH v3 pve-manager 53/66] api: notification: disallow removing targets if they are used

2023-07-17 Thread Lukas Wagner
Check notification targets configured in datacenter.cfg and jobs.cfg, failing if the group/endpoint to be removed is still in use there. Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 44 ++- 1 file changed, 43 insertions(+), 1 deletion(-) diff

[pve-devel] [PATCH v3 proxmox-perl-rs 33/66] notify: add wrapper for `get_referenced_entities`

2023-07-17 Thread Lukas Wagner
The function returns all other entities referenced by a filter/target. This is useful for permission checks, where the user must have the appropriate permissions for all entities. Signed-off-by: Lukas Wagner --- pve-rs/src/notify.rs | 9 + 1 file changed, 9 insertions(+) diff --git a

[pve-devel] [PATCH v3 proxmox-perl-rs 29/66] notify: add api for notification filters

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/notify.rs | 83 1 file changed, 83 insertions(+) diff --git a/pve-rs/src/notify.rs b/pve-rs/src/notify.rs index aa2c312..a6143fc 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -12,6 +12,9

[pve-devel] [PATCH v3 pve-manager 50/66] api: notification: add api routes for filters

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 263 ++ 1 file changed, 263 insertions(+) diff --git a/PVE/API2/Cluster/Notifications.pm b/PVE/API2/Cluster/Notifications.pm index 8f0b6429..e358573c 100644 --- a/PVE/API2/Cluster/Notifications.pm

[pve-devel] [PATCH v3 pve-cluster 34/66] cluster files: add notifications.cfg

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- src/PVE/Cluster.pm | 2 ++ src/pmxcfs/status.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/PVE/Cluster.pm b/src/PVE/Cluster.pm index c310a67..e3705b6 100644 --- a/src/PVE/Cluster.pm +++ b/src/PVE/Cluster.pm @@ -55,6 +55,8 @@ my $observed

[pve-devel] [PATCH v3 proxmox-perl-rs 32/66] notify: add context for getting http_proxy from datacenter.cfg

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/notify.rs | 11 +++ 1 file changed, 11 insertions(+) diff --git a/pve-rs/src/notify.rs b/pve-rs/src/notify.rs index 04e902c..0c00b03 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -60,6 +60,11 @@ impl Context for PVEContext

[pve-devel] [PATCH v3 proxmox-widget-toolkit 61/66] notification: add gui for sendmail notification endpoints

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- src/Makefile | 4 + src/Schema.js| 8 ++ src/data/model/NotificationConfig.js | 8 ++ src/panel/NotificationConfigView.js | 192 +++ src/panel/SendmailEditPanel.js | 140

[pve-devel] [PATCH v3 proxmox 13/66] notify: add template rendering

2023-07-17 Thread Lukas Wagner
rbatim-monospaced}}{{#verbatim-monospaced}} Do not reflow text. NOP for plain text, but for HTML output the text will be contained in a with a monospaced font. Signed-off-by: Lukas Wagner --- Cargo.toml | 1 + proxmox-notify/Cargo.toml| 6 +-

[pve-devel] [PATCH v3 pve-docs 66/66] add documentation for the new notification system

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- notifications.adoc | 159 +++ pve-admin-guide.adoc | 2 + pve-gui.adoc | 2 + vzdump.adoc | 5 ++ 4 files changed, 168 insertions(+) create mode 100644 notifications.adoc diff --git a

[pve-devel] [PATCH v3 pve-manager 54/66] ui: backup: allow to select notification target for jobs

2023-07-17 Thread Lukas Wagner
backup jobs. Some logic which automatically migrates from 'mailnotification' has been added. Signed-off-by: Lukas Wagner --- www/manager6/Makefile | 4 +- www/manager6/dc/Backup.js | 84 +-- www/manager6/form/Notifica

[pve-devel] [PATCH v3 proxmox-widget-toolkit 65/66] notification: add ui for managing notification filters

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- src/Makefile | 3 +- src/data/model/NotificationConfig.js | 9 ++ src/panel/NotificationConfigView.js | 119 +++ src/window/NotificationFilterEdit.js | 115 ++ 4 files changed, 245

[pve-devel] [PATCH v3 proxmox-widget-toolkit 64/66] notification: allow to select filter for notification targets

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- src/Makefile| 1 + src/form/NotificationFilterSelector.js | 58 + src/panel/GotifyEditPanel.js| 9 src/panel/NotificationConfigView.js | 4 ++ src/panel/NotificationGroupEditPanel.js | 9

[pve-devel] [PATCH v3 pve-manager 49/66] api: notification: add api routes for gotify endpoints

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 271 ++ 1 file changed, 271 insertions(+) diff --git a/PVE/API2/Cluster/Notifications.pm b/PVE/API2/Cluster/Notifications.pm index aea571f0..8f0b6429 100644 --- a/PVE/API2/Cluster/Notifications.pm

[pve-devel] [PATCH v3 pve-ha-manager 39/66] manager: send notifications via new notification module

2023-07-17 Thread Lukas Wagner
#x27; paramter which controls if notifications should be sent at all. If it is not set, we default to the old behavior, which is to send. Also add dependency to the `libpve-notify-perl` package to d/control. Signed-off-by: Lukas Wagner --- debian/control | 2 ++ src/PVE/HA/Env.pm|

[pve-devel] [PATCH v3 proxmox-widget-toolkit 62/66] notification: add gui for gotify notification endpoints

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- src/Makefile | 1 + src/Schema.js| 5 src/panel/GotifyEditPanel.js | 52 3 files changed, 58 insertions(+) create mode 100644 src/panel/GotifyEditPanel.js diff --git a/src/Makefile b/src

[pve-devel] [PATCH v3 pve-cluster 36/66] add libpve-notify-perl package

2023-07-17 Thread Lukas Wagner
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 --- debian/control

[pve-devel] [PATCH v3 pve-manager 44/66] api: apt: send notification via new notification module

2023-07-17 Thread Lukas Wagner
... instead of using sendmail directly If the new 'target-package-updates' is set, we send a notification to this target. If not, we continue to send a mail to root@pam (if the mail address is configured) Signed-off-by: Lukas Wagner --- PVE/API2/A

[pve-devel] [PATCH v3 many 00/66] fix #4156: introduce new notification system

2023-07-17 Thread Lukas Wagner
in `proxmox-perl-rs` and handler in `pve-manager`) - Integrated new notification channels in backup jobs/one-off backups (repo `pve-manager`) - Replication/APT/Fencing use an 'anonymous' channel with a temporary sendmail endpoint, sending mails to `root` - Added n

[pve-devel] [PATCH v3 pve-manager 46/66] api: prepare api handler module for notification config

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- PVE/API2/Cluster.pm | 7 +++ PVE/API2/Cluster/Makefile | 1 + PVE/API2/Cluster/Notifications.pm | 71 +++ 3 files changed, 79 insertions(+) create mode 100644 PVE/API2/Cluster/Notifications.pm diff --git a/PVE

[pve-devel] [PATCH v3 pve-manager 56/66] ui: backup: allow to set notification-target for one-off backups

2023-07-17 Thread Lukas Wagner
In essence the same change as for backup jobs. Signed-off-by: Lukas Wagner --- www/manager6/window/Backup.js | 35 ++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/www/manager6/window/Backup.js b/www/manager6/window/Backup.js index 4b21c746

[pve-devel] [PATCH v3 pve-manager 45/66] api: replication: send notifications via new notification module

2023-07-17 Thread Lukas Wagner
ls whether to send a notification at all. Signed-off-by: Lukas Wagner --- PVE/API2/Replication.pm | 63 - 1 file changed, 43 insertions(+), 20 deletions(-) diff --git a/PVE/API2/Replication.pm b/PVE/API2/Replication.pm index 89c5a802..d61518ba 100644 --- a/PVE/API2/

[pve-devel] [PATCH v3 pve-cluster 35/66] datacenter: add APT/fencing/replication notification configuration

2023-07-17 Thread Lukas Wagner
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 --- src/PVE

[pve-devel] [PATCH v3 pve-manager 58/66] ui: add notification target configuration panel

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- www/manager6/dc/Config.js | 16 1 file changed, 16 insertions(+) diff --git a/www/manager6/dc/Config.js b/www/manager6/dc/Config.js index aa025c8d..9ba7b301 100644 --- a/www/manager6/dc/Config.js +++ b/www/manager6/dc/Config.js @@ -329,6 +329,22

[pve-devel] [PATCH v3 pve-guest-common 37/66] vzdump: add config options for new notification backend

2023-07-17 Thread Lukas Wagner
dds the 'never' option. - Mark 'mailnotification' as deprecated in favor of 'notification-policy' - Clarify that 'mailto' is ignored if 'notification-target' is set Signed-off-by: Lukas Wagner --- src/PVE/VZDump/Common.pm | 21 +++-

[pve-devel] [PATCH v3 pve-manager 41/66] d/control: add dependency to `libpve-notify-perl`

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Did not add version number since I do not know which it will be yet. debian/control | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/control b/debian/control index 3206b514..b807dbfe 100644 --- a/debian/control +++ b/debian/control

[pve-devel] [PATCH v3 proxmox 16/66] notify: sendmail: allow users as recipients

2023-07-17 Thread Lukas Wagner
This introduces a new configuration parameter `mailto-user`. A user's email address will be looked up in the product-specific user database. Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/sendmail.rs | 32 --- proxmox-notify/src/context.rs

[pve-devel] [PATCH v3 proxmox-perl-rs 31/66] notify: implement context for getting default author/mailfrom

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/notify.rs | 33 - 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/pve-rs/src/notify.rs b/pve-rs/src/notify.rs index ea34bfe..04e902c 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -34,6

[pve-devel] [PATCH v3 proxmox-perl-rs 24/66] add PVE::RS::Notify module

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/Cargo.toml| 1 + pve-rs/Makefile | 1 + pve-rs/src/lib.rs| 1 + pve-rs/src/notify.rs | 71 4 files changed, 74 insertions(+) create mode 100644 pve-rs/src/notify.rs diff --git a/pve-rs

[pve-devel] [PATCH v3 pve-manager 57/66] ui: allow to configure notification event -> target mapping

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- www/manager6/Makefile | 1 + www/manager6/dc/Config.js | 12 ++ www/manager6/dc/NotificationEvents.js | 238 ++ 3 files changed, 251 insertions(+) create mode 100644 www/manager6/dc/NotificationEvents.js

[pve-devel] [PATCH v3 proxmox 08/66] notify: api: add API for gotify endpoints

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/gotify.rs | 284 +++ proxmox-notify/src/api/mod.rs| 6 + 2 files changed, 290 insertions(+) create mode 100644 proxmox-notify/src/api/gotify.rs diff --git a/proxmox-notify/src/api/gotify.rs b/proxmox

[pve-devel] [PATCH v3 proxmox 22/66] notify: additional logging when sending a notification

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/lib.rs | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/proxmox-notify/src/lib.rs b/proxmox-notify/src/lib.rs index 3c2b6d55..d2f15496 100644 --- a/proxmox-notify/src/lib.rs +++ b/proxmox-notify/src

[pve-devel] [PATCH v3 pve-manager 47/66] api: notification: add api routes for groups

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 254 ++ 1 file changed, 254 insertions(+) diff --git a/PVE/API2/Cluster/Notifications.pm b/PVE/API2/Cluster/Notifications.pm index 1efebbc1..b1971911 100644 --- a/PVE/API2/Cluster/Notifications.pm

[pve-devel] [PATCH v3 proxmox 17/66] notify: sendmail: query default author/mailfrom from context

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/context.rs| 2 ++ proxmox-notify/src/endpoints/sendmail.rs | 18 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/proxmox-notify/src/context.rs b/proxmox-notify/src/context.rs index 25be949a

[pve-devel] [PATCH v3 proxmox 06/66] notify: api: add API for sendmail endpoints

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/mod.rs | 7 + proxmox-notify/src/api/sendmail.rs | 254 + 2 files changed, 261 insertions(+) create mode 100644 proxmox-notify/src/api/sendmail.rs diff --git a/proxmox-notify/src/api/mod.rs b/proxmox

[pve-devel] [PATCH v3 proxmox 03/66] notify: preparation for the API

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/mod.rs | 94 +++ proxmox-notify/src/lib.rs | 1 + 2 files changed, 95 insertions(+) create mode 100644 proxmox-notify/src/api/mod.rs diff --git a/proxmox-notify/src/api/mod.rs b/proxmox-notify/src/api

[pve-devel] [PATCH v3 pve-manager 60/66] ui: perm path: increase width of the perm path selector combobox

2023-07-17 Thread Lukas Wagner
ACL paths for notification targets can become quite long, e.g.: /mappings/notifications/ Signed-off-by: Lukas Wagner --- www/manager6/form/PermPathSelector.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/manager6/form/PermPathSelector.js b/www/manager6/form/PermPathSelector.js index

[pve-devel] [PATCH v3 pve-manager 40/66] test: fix names of .PHONY targets

2023-07-17 Thread Lukas Wagner
They need to have the same name as the target. Took the opportunity to move the .PHONY right next to the target recipe, so that mistakes like these are hopefully easier caught. Signed-off-by: Lukas Wagner --- test/Makefile | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff

[pve-devel] [PATCH v3 proxmox-perl-rs 30/66] notify: sendmail: support the `mailto-user` parameter

2023-07-17 Thread Lukas Wagner
This parameter allows to send mails to the email address configured for users from the product's user database. `proxmox-notify` now has a `Context` that must be set via `proxmox_notify::context::set_context` before the crate is used. Signed-off-by: Lukas Wagner --- pve-rs/Cargo.toml

[pve-devel] [PATCH v3 pve-common 38/66] JSONSchema: increase maxLength of config-digest to 64

2023-07-17 Thread Lukas Wagner
The new notification backend is implemented in Rust where we use SHA256 for config digests. Signed-off-by: Lukas Wagner --- src/PVE/JSONSchema.pm | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm index 7589bba..49e0d7a

[pve-devel] [PATCH v3 proxmox 09/66] notify: add notification groups

2023-07-17 Thread Lukas Wagner
When notifying via a group, all endpoints contained in that group will send out the notification. Signed-off-by: Lukas Wagner --- proxmox-notify/src/config.rs | 9 ++ proxmox-notify/src/group.rs | 40 + proxmox-notify/src/lib.rs| 170 --- 3 files

[pve-devel] [PATCH v3 proxmox 12/66] notify: api: add API for filters

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/filter.rs | 231 + proxmox-notify/src/api/gotify.rs | 12 ++ proxmox-notify/src/api/group.rs| 7 + proxmox-notify/src/api/mod.rs | 1 + proxmox-notify/src/api/sendmail.rs | 10 ++ 5 files

[pve-devel] [PATCH v3 proxmox-perl-rs 28/66] notify: add api for gotify endpoints

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/notify.rs | 83 1 file changed, 83 insertions(+) diff --git a/pve-rs/src/notify.rs b/pve-rs/src/notify.rs index 9490ea8..aa2c312 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -5,6 +5,10

[pve-devel] [PATCH v3 proxmox 19/66] notify: api: allow to query entities referenced by filter/target

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/common.rs | 11 +++ proxmox-notify/src/api/mod.rs| 125 +++ 2 files changed, 136 insertions(+) diff --git a/proxmox-notify/src/api/common.rs b/proxmox-notify/src/api/common.rs index 518caa8f..48761fbb 100644

[pve-devel] [PATCH v3 proxmox-perl-rs 26/66] notify: add api for notification groups

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/notify.rs | 70 1 file changed, 70 insertions(+) diff --git a/pve-rs/src/notify.rs b/pve-rs/src/notify.rs index 74a872b..cac233a 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -5,6 +5,7

[pve-devel] [PATCH v3 proxmox 10/66] notify: api: add API for groups

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/group.rs | 264 proxmox-notify/src/api/mod.rs | 1 + 2 files changed, 265 insertions(+) create mode 100644 proxmox-notify/src/api/group.rs diff --git a/proxmox-notify/src/api/group.rs b/proxmox-notify

[pve-devel] [PATCH v3 proxmox-perl-rs 25/66] notify: add api for sending notifications/testing endpoints

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/notify.rs | 34 -- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/pve-rs/src/notify.rs b/pve-rs/src/notify.rs index 9677d8b..74a872b 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -2,10

[pve-devel] [PATCH v3 proxmox 18/66] notify: gotify: add proxy support

2023-07-17 Thread Lukas Wagner
The proxy configuration will be read from datacenter.cfg via a new method of the `Context` trait. Signed-off-by: Lukas Wagner --- proxmox-notify/src/context.rs | 1 + proxmox-notify/src/endpoints/gotify.rs | 22 -- 2 files changed, 17 insertions(+), 6 deletions

[pve-devel] [PATCH v3 proxmox 02/66] notify: preparation for the first endpoint plugin

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Cargo.toml | 1 + proxmox-notify/Cargo.toml | 9 + proxmox-notify/src/config.rs| 51 + proxmox-notify/src/endpoints/mod.rs | 0 proxmox-notify/src/lib.rs | 311 proxmox

[pve-devel] [PATCH v3 proxmox 14/66] notify: add example for template rendering

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/examples/render.rs | 63 +++ 1 file changed, 63 insertions(+) create mode 100644 proxmox-notify/examples/render.rs diff --git a/proxmox-notify/examples/render.rs b/proxmox-notify/examples/render.rs new file mode 100644

[pve-devel] [PATCH v3 proxmox 15/66] notify: add context

2023-07-17 Thread Lukas Wagner
Since `proxmox-notify` is intended to be used by multiple products, there needs to be a way to inject product-specific behavior. Signed-off-by: Lukas Wagner --- proxmox-notify/src/context.rs | 13 + proxmox-notify/src/lib.rs | 1 + 2 files changed, 14 insertions(+) create mode

[pve-devel] [PATCH v3 proxmox 07/66] notify: add gotify endpoint

2023-07-17 Thread Lukas Wagner
Add an endpoint for Gotify [1], showing the how easy it is to add new endpoint implementations. [1] https://gotify.net/ Signed-off-by: Lukas Wagner --- proxmox-notify/Cargo.toml | 6 +- proxmox-notify/src/config.rs | 23 + proxmox-notify/src/endpoints/gotify.rs

[pve-devel] [PATCH v3 proxmox 04/66] notify: api: add API for sending notifications/testing endpoints

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/common.rs | 44 proxmox-notify/src/api/mod.rs| 2 ++ 2 files changed, 46 insertions(+) create mode 100644 proxmox-notify/src/api/common.rs diff --git a/proxmox-notify/src/api/common.rs b/proxmox-notify

[pve-devel] [PATCH v3 proxmox 05/66] notify: add sendmail plugin

2023-07-17 Thread Lukas Wagner
This plugin uses the 'sendmail' command to send an email to one or more recipients. Signed-off-by: Lukas Wagner --- proxmox-notify/Cargo.toml| 9 ++- proxmox-notify/src/config.rs | 12 proxmox-notify/src/endpoints/mod.rs | 2 + proxmox-

[pve-devel] [PATCH v3 proxmox 01/66] add proxmox-notify crate

2023-07-17 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes v1 -> v2: - Renamed crate from 'proxmox-notification' to 'proxmox-notify' Cargo.toml| 1 + proxmox-notify/Cargo.toml | 10 ++ proxmox-notify/src/lib.rs | 0 3 files changed, 11 ins

Re: [pve-devel] [PATCH installer] tui: persist disk selection for zfs and btrfs

2023-06-27 Thread Lukas Wagner
On 6/27/23 15:34, Maximiliano Sandoval wrote: impl BtrfsBootdiskOptions { -pub fn defaults_from(disk: &Disk) -> Self { +pub fn defaults_from(disks: &[Disk]) -> Self { +let disk = &disks[0]; Self { disk_size: disk.size, +selected_disks: (

Re: [pve-devel] [PATCH v2 cluster/guest-common/manager/ha-manager/proxmox{, -perl-rs} 00/42] fix #4156: introduce new notification module

2023-05-26 Thread Lukas Wagner
On 5/24/23 15:56, Lukas Wagner wrote: - Channels: Logically, channel can be thought of as a 'group of endpoints'. Each endpoint can be included in one or more channels. If one is using the notification API to send a notification, a channel has to be specified

[pve-devel] [PATCH v2 pve-manager 40/42] api: add api routes for notification filters

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 327 ++ 1 file changed, 327 insertions(+) diff --git a/PVE/API2/Cluster/Notifications.pm b/PVE/API2/Cluster/Notifications.pm index 823e8107..61deb9b3 100644 --- a/PVE/API2/Cluster/Notifications.pm

[pve-devel] [PATCH v2 pve-manager 32/42] api: replication: send notifications via new notification module

2023-05-24 Thread Lukas Wagner
There is no way yet to configure a notification channel for replication notifications. Thus a temporary channel with a sendmail endpoint with root as recipient is added. Signed-off-by: Lukas Wagner --- PVE/API2/Replication.pm | 75 ++--- 1 file changed, 55

[pve-devel] [PATCH v2 pve-manager 37/42] api: add api routes for notification channels

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 251 ++ 1 file changed, 251 insertions(+) diff --git a/PVE/API2/Cluster/Notifications.pm b/PVE/API2/Cluster/Notifications.pm index 7d3bf53d..74538554 100644 --- a/PVE/API2/Cluster/Notifications.pm

[pve-devel] [PATCH v2 proxmox-perl-rs 21/42] notify: add api for notification channels

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/notify.rs | 67 1 file changed, 67 insertions(+) diff --git a/pve-rs/src/notify.rs b/pve-rs/src/notify.rs index a101416..c6483dc 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -5,6 +5,7

[pve-devel] [PATCH v2 proxmox 16/42] notify: add template rendering

2023-05-24 Thread Lukas Wagner
rbatim-monospaced}}{{#verbatim-monospaced}} Do not reflow text. NOP for plain text, but for HTML output the text will be contained in a with a monospaced font. Signed-off-by: Lukas Wagner --- Cargo.toml | 1 + proxmox-notify/Cargo.toml| 6 +-

[pve-devel] [PATCH v2 pve-manager 30/42] test: rename mail_test.pl to vzdump_notification_test.pl

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- test/Makefile | 8 test/{mail_test.pl => vzdump_notification_test.pl} | 0 2 files changed, 4 insertions(+), 4 deletions(-) rename test/{mail_test.pl => vzdump_notification_test.pl} (100%) diff --git a/test/Ma

[pve-devel] [PATCH v2 pve-manager 38/42] api: add api routes for sendmail endpoints

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 293 ++ 1 file changed, 293 insertions(+) diff --git a/PVE/API2/Cluster/Notifications.pm b/PVE/API2/Cluster/Notifications.pm index 74538554..53e447ad 100644 --- a/PVE/API2/Cluster/Notifications.pm

[pve-devel] [PATCH v2 pve-cluster 25/42] cluster files: add notifications.cfg

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- src/PVE/Cluster.pm | 2 ++ src/pmxcfs/status.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/PVE/Cluster.pm b/src/PVE/Cluster.pm index efca58f..6215c9c 100644 --- a/src/PVE/Cluster.pm +++ b/src/PVE/Cluster.pm @@ -55,6 +55,8 @@ my $observed

[pve-devel] [PATCH v2 pve-manager 41/42] ui: backup: disable notification mode selector for now

2023-05-24 Thread Lukas Wagner
I think it's best to not expose the notification channel feature until we have at least a basic managment GUI for endpoints/channels. Signed-off-by: Lukas Wagner --- www/manager6/dc/Backup.js | 1 + www/manager6/window/Backup.js | 4 ++-- 2 files changed, 3 insertions(+), 2 dele

[pve-devel] [PATCH v2 pve-guest-common 26/42] vzdump: add config options for new notification backend

2023-05-24 Thread Lukas Wagner
all be sent (if 'notification-mode' is set to 'channel') - Add new option 'notification-policy' Replacement for the now deprecated 'mailnotification' option. Mostly just a rename for consistency, but also adds the 'never' option. - Mark '

[pve-devel] [PATCH v2 proxmox 15/42] notify: api: add API for filters

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/filter.rs | 366 + proxmox-notify/src/api/gotify.rs | 7 + proxmox-notify/src/api/mod.rs | 1 + proxmox-notify/src/api/sendmail.rs | 5 + 4 files changed, 379 insertions(+) create mode 100644

[pve-devel] [PATCH v2 proxmox-perl-rs 24/42] notify: add api for notification filters

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/notify.rs | 87 1 file changed, 87 insertions(+) diff --git a/pve-rs/src/notify.rs b/pve-rs/src/notify.rs index 84bc184..9adeff5 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -13,6 +13,9

[pve-devel] [PATCH v2 pve-manager 36/42] api: prepare api handler module for notification config

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- PVE/API2/Cluster.pm | 7 ++ PVE/API2/Cluster/Makefile | 1 + PVE/API2/Cluster/Notifications.pm | 134 ++ 3 files changed, 142 insertions(+) create mode 100644 PVE/API2/Cluster/Notifications.pm diff --git a

[pve-devel] [PATCH v2 pve-manager 34/42] ui: backup: adapt backup job details to new notification params

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- www/manager6/dc/BackupJobDetail.js | 24 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/www/manager6/dc/BackupJobDetail.js b/www/manager6/dc/BackupJobDetail.js index c4683a47..f4a0d981 100644 --- a/www/manager6/dc

[pve-devel] [PATCH v2 proxmox 13/42] notify: api: add API for gotify endpoints

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/gotify.rs | 284 +++ proxmox-notify/src/api/mod.rs| 6 + 2 files changed, 290 insertions(+) create mode 100644 proxmox-notify/src/api/gotify.rs diff --git a/proxmox-notify/src/api/gotify.rs b/proxmox

[pve-devel] [PATCH v2 proxmox-perl-rs 19/42] add PVE::RS::Notify module

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/Cargo.toml| 1 + pve-rs/Makefile | 1 + pve-rs/src/lib.rs| 1 + pve-rs/src/notify.rs | 65 4 files changed, 68 insertions(+) create mode 100644 pve-rs/src/notify.rs diff --git a/pve-rs

[pve-devel] [PATCH v2 proxmox 11/42] notify: api: add API for sendmail endpoints

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/mod.rs | 7 + proxmox-notify/src/api/sendmail.rs | 254 + 2 files changed, 261 insertions(+) create mode 100644 proxmox-notify/src/api/sendmail.rs diff --git a/proxmox-notify/src/api/mod.rs b/proxmox

[pve-devel] [PATCH v2 cluster/guest-common/manager/ha-manager/proxmox{, -perl-rs} 00/42] fix #4156: introduce new notification module

2023-05-24 Thread Lukas Wagner
proxmox-notify/src/endpoints/mod.rs create mode 100644 proxmox-notify/src/endpoints/sendmail.rs create mode 100644 proxmox-notify/src/filter.rs create mode 100644 proxmox-notify/src/lib.rs create mode 100644 proxmox-notify/src/renderer/html.rs create mode 100644 proxmox-notify/src/renderer/mod.rs c

[pve-devel] [PATCH v2 pve-manager 27/42] test: fix names of .PHONY targets

2023-05-24 Thread Lukas Wagner
They need to have the same name as the target. Took the opportunity to move the .PHONY right next to the target recipe, so that mistakes like these are hopefully easier caught. Signed-off-by: Lukas Wagner --- test/Makefile | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff

[pve-devel] [PATCH v2 proxmox 05/42] notify: preparation for the first endpoint plugin

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Cargo.toml | 1 + proxmox-notify/Cargo.toml | 9 + proxmox-notify/src/config.rs| 51 + proxmox-notify/src/endpoints/mod.rs | 0 proxmox-notify/src/lib.rs | 299 proxmox

[pve-devel] [PATCH v2 proxmox 12/42] notify: add gotify endpoint

2023-05-24 Thread Lukas Wagner
Add an endpoint for Gotify [1], showing the how easy it is to add new endpoint implementations. [1] https://gotify.net/ Signed-off-by: Lukas Wagner --- proxmox-notify/Cargo.toml | 6 +- proxmox-notify/src/config.rs | 22 + proxmox-notify/src/endpoints/gotify.rs

[pve-devel] [PATCH v2 proxmox-perl-rs 23/42] notify: add api for gotify endpoints

2023-05-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- pve-rs/src/notify.rs | 79 1 file changed, 79 insertions(+) diff --git a/pve-rs/src/notify.rs b/pve-rs/src/notify.rs index 177e01d..84bc184 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -6,6 +6,10

[pve-devel] [PATCH v2 proxmox 08/42] notify: add notification channels

2023-05-24 Thread Lukas Wagner
endpoints have to be added/removed from *all* affected backup job configurations. Signed-off-by: Lukas Wagner --- proxmox-notify/src/channel.rs | 53 ++ proxmox-notify/src/config.rs | 9 +++ proxmox-notify/src/lib.rs | 133 ++ 3 files cha

<    4   5   6   7   8   9   10   >