[pve-devel] [PATCH v4 proxmox-widget-toolkit 65/69] notification: add gui for gotify notification endpoints

2023-07-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - Use items/advancedItems instead of columns src/Makefile | 1 + src/Schema.js| 5 src/panel/GotifyEditPanel.js | 44 3 files changed, 50 insertions

[pve-devel] [PATCH v4 pve-manager 51/69] api: notification: add api routes for gotify endpoints

2023-07-20 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 v4 many 00/69] fix #4156: introduce new notification system

2023-07-20 Thread Lukas Wagner
#x27; channel with a temporary sendmail endpoint, sending mails to `root` - Added new options for backup jobs - Reworked git history Versions of this patch series: v3: https://lists.proxmox.com/pipermail/pve-devel/2023-July/058158.html v2: https://lists.proxmox.com/pipermail/pve-devel/2023-Ma

[pve-devel] [PATCH v4 proxmox-widget-toolkit 67/69] notification: allow to select filter for notification targets

2023-07-20 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 v4 pve-manager 52/69] api: notification: add api routes for filters

2023-07-20 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 v4 pve-docs 69/69] add documentation for the new notification system

2023-07-20 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 v4 pve-manager 44/69] vzdump: send notifications via new notification module

2023-07-20 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 v4 proxmox 09/69] notify: add gotify endpoint

2023-07-20 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 v4 proxmox 15/69] notify: add template rendering

2023-07-20 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 v4 pve-manager 61/69] ui: perm path: add ACL paths for notifications, usb and pci mappings

2023-07-20 Thread Lukas Wagner
Suggested-by: Dominik Csapak Signed-off-by: Lukas Wagner --- Notes: In future, we could create a new API endpoint that returns all possible ACL and then use a normal store for the perm path combobox? Changes since v3: - Removed API calls that fetch targets/filters

[pve-devel] [PATCH v4 pve-manager 54/69] api: notification: allow to test targets

2023-07-20 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 v4 proxmox 17/69] notify: add context

2023-07-20 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 --- Notes: Changes since v3: - Use OnceCell instead of Mutex proxmox-notify/Cargo.toml | 1 + proxmox-notify/src

[pve-devel] [PATCH v4 pve-manager 50/69] api: notification: add api routes for sendmail endpoints

2023-07-20 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 v4 proxmox 19/69] notify: sendmail: query default author/mailfrom from context

2023-07-20 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 c31a243b

[pve-devel] [PATCH v4 proxmox 20/69] notify: gotify: add proxy support

2023-07-20 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 v4 proxmox-perl-rs 33/69] notify: implement context for getting default author/mailfrom

2023-07-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - lookup_datacenter_config_key: move string formatting outside the loop pve-rs/src/notify.rs | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/pve-rs/src

[pve-devel] [PATCH v4 proxmox 23/69] notify: ensure that filter/group/endpoint names are unique

2023-07-20 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 v4 pve-manager 59/69] ui: allow to configure notification event -> target mapping

2023-07-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - Show warnings only if 'never' is selected - Also show a warning for disabled package update notifications - Some code style touch ups - Added some comments www/manager6/Makefile |

[pve-devel] [PATCH v4 pve-manager 60/69] ui: add notification target configuration panel

2023-07-20 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 v4 proxmox 24/69] notify: additional logging when sending a notification

2023-07-20 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 0059e44b..6a52db06 100644 --- a/proxmox-notify/src/lib.rs +++ b/proxmox-notify/src

[pve-devel] [PATCH v4 proxmox-perl-rs 30/69] notify: add api for gotify endpoints

2023-07-20 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 2f8c9b6..1d612f1 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -5,6 +5,10

[pve-devel] [PATCH v4 proxmox-perl-rs 26/69] add PVE::RS::Notify module

2023-07-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - parse_config now takes a &[u8] instead of a &str in order to avoid encoding issues pve-rs/Cargo.toml| 1 + pve-rs/Makefile | 1 + pve-rs/src/lib.rs| 1 + pve-rs/src/notify

[pve-devel] [PATCH v4 proxmox 13/69] notify: add notification filter mechanism

2023-07-20 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 v4 proxmox 18/69] notify: sendmail: allow users as recipients

2023-07-20 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 v4 proxmox 10/69] notify: api: add API for gotify endpoints

2023-07-20 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 v4 proxmox-perl-rs 28/69] notify: add api for notification groups

2023-07-20 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 cff1b44..8014e6d 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -5,6 +5,7

[pve-devel] [PATCH v4 proxmox 04/69] notify: preparation for the first endpoint plugin

2023-07-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - Derive Clone for Config - Remove private_digest from Config - Add explanatory comment on why Rc>> is needed in the test code - Avoid linear search in Vec for private_configs - Minor sty

[pve-devel] [PATCH v4 pve-cluster 36/69] cluster files: add notifications.cfg

2023-07-20 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 v4 proxmox-perl-rs 35/69] notify: add wrapper for `get_referenced_entities`

2023-07-20 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 v4 proxmox-perl-rs 29/69] notify: add api for sendmail endpoints

2023-07-20 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 8014e6d..2f8c9b6 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -5,6 +5,9

[pve-devel] [PATCH v4 proxmox 14/69] notify: api: add API for filters

2023-07-20 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 v4 pve-common 40/69] JSONSchema: increase maxLength of config-digest to 64

2023-07-20 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 v4 pve-guest-common 39/69] vzdump: add config options for new notification backend

2023-07-20 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 v4 proxmox-perl-rs 32/69] notify: sendmail: support the `mailto-user` parameter

2023-07-20 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 v4 pve-cluster 37/69] datacenter: add APT/fencing/replication notification configuration

2023-07-20 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 v4 pve-cluster 38/69] add libpve-notify-perl package

2023-07-20 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 --- Notes: Changes since

[pve-devel] [PATCH v4 pve-ha-manager 41/69] manager: send notifications via new notification module

2023-07-20 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 v4 proxmox-widget-toolkit 66/69] notification: add gui for notification groups

2023-07-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - Use items/advancedItems instead of columns - Call initField in EndpointSelector - Minor code style improvements src/Makefile| 1 + src/Schema.js | 5 + src

[pve-devel] [PATCH v4 pve-manager 56/69] ui: backup: allow to select notification target for jobs

2023-07-20 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 v4 proxmox-widget-toolkit 64/69] notification: add gui for sendmail notification endpoints

2023-07-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - extracted validator function - use items/advancedItems instead of columns src/Makefile | 4 + src/Schema.js| 8 ++ src/data/model/NotificationConfig.js | 8 ++ src

[pve-devel] [PATCH v4 pve-manager 46/69] api: apt: send notification via new notification module

2023-07-20 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 v4 proxmox 22/69] notify: on deletion, check if a filter/endp. is still used by anything

2023-07-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - get_referrers: minor stylistic touchups proxmox-notify/src/api/filter.rs | 1 + proxmox-notify/src/api/gotify.rs | 1 + proxmox-notify/src/api/mod.rs | 111 ++--- proxmox-notify/src/api

[pve-devel] [PATCH v4 proxmox-widget-toolkit 68/69] notification: add ui for managing notification filters

2023-07-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - use items/advancedItems instead of columns src/Makefile | 3 +- src/data/model/NotificationConfig.js | 9 ++ src/panel/NotificationConfigView.js | 119 +++ src/window

[pve-devel] [PATCH v4 pve-manager 49/69] api: notification: add api routes for groups

2023-07-20 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 v4 proxmox 25/69] notify: add debian packaging

2023-07-20 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - update d/copyright to new format proxmox-notify/debian/changelog | 5 ++ proxmox-notify/debian/control | 112 proxmox-notify/debian/copyright | 18 + proxmox-notify/debian

[pve-devel] [PATCH v4 pve-manager 45/69] test: rename mail_test.pl to vzdump_notification_test.pl

2023-07-20 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 manager 3/3] headerbar: center search box, make it adapt to the width of the browser

2023-07-21 Thread Lukas Wagner
Also adding a minWidth/maxWidth so that it doesn't become comically large or small. The minimum size is roughly the same size as the search bar was before. The maxmium size is the same size as the results grid, making them align nicely. Signed-off-by: Lukas Wagner --- Notes: Played aro

[pve-devel] [PATCH manager 2/3] headerbar: show shortcut for search in emptyText

2023-07-21 Thread Lukas Wagner
The shortcut is not really documented anywhere, so I think it make it a bit more obvious to the user. Signed-off-by: Lukas Wagner --- www/manager6/form/GlobalSearchField.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/manager6/form/GlobalSearchField.js b/www/manager6

[pve-devel] [PATCH manager 1/3] headerbar: use same height and padding for product name as PBS and PMG

2023-07-21 Thread Lukas Wagner
This makes the header bar look a bit less cramped and ensures consistency if web interfaces are used side-by-side, e.g. on an ultrawide screen. Signed-off-by: Lukas Wagner --- Notes: Disadvantage: We loose 8px of vertical space. However, I really think this is negligible. www/manager6

Re: [pve-devel] [PATCH manager 2/3] headerbar: show shortcut for search in emptyText

2023-07-21 Thread Lukas Wagner
On 7/21/23 15:31, Thomas Lamprecht wrote: On 21/07/2023 11:39, Lukas Wagner wrote: The shortcut is not really documented anywhere, so I think it make it a bit more obvious to the user. style not: commit message should wrap text at 70 character columns. https://pve.proxmox.com/wiki

Re: [pve-devel] [PATCH manager 3/3] headerbar: center search box, make it adapt to the width of the browser

2023-07-21 Thread Lukas Wagner
nd a few people quite liked it, so I thought I'd give it a shot. On 21/07/2023 11:39, Lukas Wagner wrote: Also adding a minWidth/maxWidth so that it doesn't become comically large or small. The minimum size is roughly the same size as the you can use numbers here, IMO 168 px and 200 p

Re: [pve-devel] [PATCH manager 1/3] headerbar: use same height and padding for product name as PBS and PMG

2023-07-24 Thread Lukas Wagner
On 7/21/23 16:04, Thomas Lamprecht wrote: well we could also meed in the middle, if having 32, 34 or 36 px is enough to make it "less cramped"? Yeah, the main reason for 38px was the consistency to other products. Now that I play around a bit with different heights, I feel like the major visua

[pve-devel] [PATCH manager] vzdump: use as a convention for virtual endpoints/groups

2023-07-24 Thread Lukas Wagner
Virtual (or anonymous) endpoints/groups are used for sending one-off notifications to a target that does not exist in the config. VZDump uses this to send out notification mails to those addresses configured by the `mailto` parameter. Suggested-by: Wolfgang Bumiller Signed-off-by: Lukas Wagner

[pve-devel] [PATCH cluster] notify: use renamed Proxmox::RS::Notify

2023-07-24 Thread Lukas Wagner
Suggested-by: Wolfgang Bugmiller Signed-off-by: Lukas Wagner --- src/PVE/Notify.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PVE/Notify.pm b/src/PVE/Notify.pm index 48ef772..0464362 100644 --- a/src/PVE/Notify.pm +++ b/src/PVE/Notify.pm @@ -4,7 +4,7 @@ use

[pve-devel] [PATCH proxmox-perl-rs] notify: rename PVE::RS::Notify to Proxmox::RS::Notify

2023-07-24 Thread Lukas Wagner
Also splitting PVE-specific context into its own file. Suggested-by: Wolfgang Bumiller Signed-off-by: Lukas Wagner --- common/pkg/Makefile | 1 + common/src/mod.rs| 1 + {pve-rs => common}/src/notify.rs | 123 +-- pve-rs/src/lib

[pve-devel] [PATCH proxmox 1/2] notify: fix build warnings if not all features are enabled

2023-07-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/mod.rs | 3 ++- proxmox-notify/src/config.rs | 1 + proxmox-notify/src/context.rs | 1 + proxmox-notify/src/lib.rs | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/proxmox-notify/src/api/mod.rs b/proxmox-notify/src

[pve-devel] [PATCH proxmox 2/2] notify: fix tests if not all features are enabled

2023-07-24 Thread Lukas Wagner
Some tests are now disabled if not all required features are enabled. Signed-off-by: Lukas Wagner --- proxmox-notify/src/api/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxmox-notify/src/api/mod.rs b/proxmox-notify/src/api/mod.rs index a4e0e40f..9372443a 100644

[pve-devel] [PATCH cluster] buildsys: add libpve-notify-perl package to $(LIB_DEB) variable

2023-07-24 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 3c4ecec..8b2259c 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ GITVERSION:=$(shell git rev-parse HEAD) DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_BUILD_ARCH).deb LIB_DEB

Re: [pve-devel] [PATCH v4 pve-manager 55/69] api: notification: disallow removing targets if they are used

2023-07-24 Thread Lukas Wagner
On 7/24/23 15:50, Wolfgang Bumiller wrote: +sub target_used_by { +my ($target) = @_; + +my $used_by = []; + +# Check keys in datacenter.cfg +my $dc_conf = PVE::Cluster::cfs_read_file('datacenter.cfg'); +for my $key (qw(target-package-updates target-replication target-fencin

[pve-devel] [PATCH v5 pve-manager 02/30] d/control: add dependency to `libpve-notify-perl`

2023-07-26 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 v5 pve-manager 05/30] api: apt: send notification via new notification module

2023-07-26 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 v5 pve-manager 16/30] ui: backup: adapt backup job details to new notification params

2023-07-26 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 880784a2..e154fec1 100644 --- a/www/manager6/dc

[pve-devel] [PATCH v5 pve-manager 13/30] api: notification: allow to test targets

2023-07-26 Thread Lukas Wagner
This API call allows the user to test a notification target. 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

[pve-devel] [PATCH v5 pve-manager 08/30] api: notification: add api routes for groups

2023-07-26 Thread Lukas Wagner
code. Signed-off-by: Lukas Wagner --- Notes: Changes since v4: - Explain the changes a bit more in the commit message - Factor out permission checks into a common helper - Minor code style improvements PVE/API2/Cluster/Notifications.pm | 263 ++ 1

[pve-devel] [PATCH v5 pve-manager 12/30] api: notification: allow fetching notification targets

2023-07-26 Thread Lukas Wagner
The API call returns all entities that can be used as notification targets (endpoints, groups). Only targets for which the user has appropriate permissions are returned. Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 81 +++ 1 file changed, 81

[pve-devel] [PATCH v5 pve-manager 14/30] api: notification: disallow removing targets if they are used

2023-07-26 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 v5 many 00/30] fix #4156: introduce new notification system

2023-07-26 Thread Lukas Wagner
a temporary sendmail endpoint, sending mails to `root` - Added new options for backup jobs - Reworked git history Versions of this patch series: v4: https://lists.proxmox.com/pipermail/pve-devel/2023-July/058315.html v3: https://lists.proxmox.com/pipermail/pve-devel/2023-July/058

[pve-devel] [PATCH v5 pve-manager 21/30] ui: perm path: increase width of the perm path selector combobox

2023-07-26 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 v5 pve-manager 04/30] test: rename mail_test.pl to vzdump_notification_test.pl

2023-07-26 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 v5 pve-manager 17/30] ui: backup: allow to set notification-target for one-off backups

2023-07-26 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 v5 pve-manager 22/30] ui: dc: remove notify key from datacenter option view

2023-07-26 Thread Lukas Wagner
Settings for notifications have been moved to their own view. Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - New in v4 www/manager6/dc/OptionView.js | 20 1 file changed, 20 deletions(-) diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc

[pve-devel] [PATCH v5 pve-manager 11/30] api: notification: add api routes for filters

2023-07-26 Thread Lukas Wagner
code. Signed-off-by: Lukas Wagner --- Notes: Changes since v4: - Explain the changes a bit more in the commit message - Factor out permission checks into a common helper - Minor code style improvements PVE/API2/Cluster/Notifications.pm | 255 ++ 1

[pve-devel] [PATCH v5 proxmox-widget-toolkit 27/30] notification: add gui for notification groups

2023-07-26 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - Use items/advancedItems instead of columns - Call initField in EndpointSelector - Minor code style improvements src/Makefile| 1 + src/Schema.js | 5 + src

[pve-devel] [PATCH v5 proxmox-widget-toolkit 29/30] notification: add ui for managing notification filters

2023-07-26 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - use items/advancedItems instead of columns src/Makefile | 3 +- src/data/model/NotificationConfig.js | 9 ++ src/panel/NotificationConfigView.js | 119 +++ src/window

[pve-devel] [PATCH v5 pve-manager 09/30] api: notification: add api routes for sendmail endpoints

2023-07-26 Thread Lukas Wagner
code. Signed-off-by: Lukas Wagner --- Notes: Changes since v4: - Explain the changes a bit more in the commit message - Factor out permission checks into a common helper - Minor code style improvements PVE/API2/Cluster/Notifications.pm | 305 ++ 1

[pve-devel] [PATCH v5 proxmox-widget-toolkit 25/30] notification: add gui for sendmail notification endpoints

2023-07-26 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - extracted validator function - use items/advancedItems instead of columns src/Makefile | 4 + src/Schema.js| 8 ++ src/data/model/NotificationConfig.js | 8 ++ src

[pve-devel] [PATCH v5 proxmox-widget-toolkit 28/30] notification: allow to select filter for notification targets

2023-07-26 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 v5 pve-manager 07/30] api: prepare api handler module for notification config

2023-07-26 Thread Lukas Wagner
This commit adds a new Perl module, PVE::API2::Cluster::Notification. The module will contain all API handlers for the new notification subsystem. Signed-off-by: Lukas Wagner --- PVE/API2/Cluster.pm | 7 +++ PVE/API2/Cluster/Makefile | 1 + PVE/API2/Cluster

[pve-devel] [PATCH v5 pve-manager 06/30] api: replication: send notifications via new notification module

2023-07-26 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 v5 pve-ha-manager 01/30] manager: send notifications via new notification module

2023-07-26 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 v5 pve-manager 20/30] ui: perm path: add ACL paths for notifications, usb and pci mappings

2023-07-26 Thread Lukas Wagner
Suggested-by: Dominik Csapak Signed-off-by: Lukas Wagner --- Notes: In future, we could create a new API endpoint that returns all possible ACL and then use a normal store for the perm path combobox? Changes since v3: - Removed API calls that fetch targets/filters

[pve-devel] [PATCH v5 pve-manager 19/30] ui: add notification target configuration panel

2023-07-26 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 v5 proxmox-widget-toolkit 26/30] notification: add gui for gotify notification endpoints

2023-07-26 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - Use items/advancedItems instead of columns src/Makefile | 1 + src/Schema.js| 5 src/panel/GotifyEditPanel.js | 44 3 files changed, 50 insertions

[pve-devel] [PATCH v5 pve-manager 23/30] vzdump: use as a convention for virtual endpoints/groups

2023-07-26 Thread Lukas Wagner
Virtual (or anonymous) endpoints/groups are used for sending one-off notifications to a target that does not exist in the config. VZDump uses this to send out notification mails to those addresses configured by the `mailto` parameter. Suggested-by: Wolfgang Bumiller Signed-off-by: Lukas Wagner

[pve-devel] [PATCH v5 pve-manager 10/30] api: notification: add api routes for gotify endpoints

2023-07-26 Thread Lukas Wagner
code. Signed-off-by: Lukas Wagner --- Notes: Changes since v4: - Explain the changes a bit more in the commit message - Factor out permission checks into a common helper - Minor code style improvements PVE/API2/Cluster/Notifications.pm | 262 ++ 1

[pve-devel] [PATCH v5 pve-manager 24/30] api: notification: make the 'mail-to-root' target visible to any user

2023-07-26 Thread Lukas Wagner
update API compat in the case that a notification shall be sent, but without any configured notification target (which will then default to 'mail-to-root'). Signed-off-by: Lukas Wagner --- Notes: New in v5 PVE/API2/Cluster/Notifications.pm | 31 ++- 1 fil

[pve-devel] [PATCH v5 pve-manager 03/30] vzdump: send notifications via new notification module

2023-07-26 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 v5 pve-manager 15/30] ui: backup: allow to select notification target for jobs

2023-07-26 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 v5 pve-manager 18/30] ui: allow to configure notification event -> target mapping

2023-07-26 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- Notes: Changes since v3: - Show warnings only if 'never' is selected - Also show a warning for disabled package update notifications - Some code style touch ups - Added some comments www/manager6/Makefile |

[pve-devel] [PATCH v5 pve-docs 30/30] add documentation for the new notification system

2023-07-26 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

Re: [pve-devel] [PATCH manager] vzdump: use as a convention for virtual endpoints/groups

2023-07-26 Thread Lukas Wagner
Note, this commit has now been included in v5 of the original patch series. On 7/24/23 13:26, Lukas Wagner wrote: Virtual (or anonymous) endpoints/groups are used for sending one-off notifications to a target that does not exist in the config. VZDump uses this to send out notification mails

[pve-devel] [PATCH proxmox 1/5] http-error: add new http-error crate

2023-07-26 Thread Lukas Wagner
age. Also add some smoke-tests to make sure that the `http_bail` and `http_err` macros actually produce valid code. Suggested-by: Wolfgang Bumiller Signed-off-by: Lukas Wagner --- Cargo.toml| 2 + proxmox-http-error/Cargo.toml | 16 +++ proxmox-http-error/src/l

[pve-devel] [PATCH proxmox{, -perl-rs, -backup} 0/5] move `HttpError` from `proxmox-router` into its own crate

2023-07-26 Thread Lukas Wagner
previously used it's own error type, is now also using the new crate. proxmox: Lukas Wagner (3): http-error: add new http-error crate router: rest-server: auth-api: use new http-error crate notify: use HttpError from proxmox-http-error Cargo.toml | 2 + pr

[pve-devel] [PATCH proxmox 3/5] notify: use HttpError from proxmox-http-error

2023-07-26 Thread Lukas Wagner
Also improve API documentation in terms of which HttpError is returned when. Signed-off-by: Lukas Wagner --- Notes: Assumes that the following two patches have been applied before, otherwise there will be a conflict (which is trivial to resolve, though) 1: "notify

[pve-devel] [PATCH proxmox 2/5] router: rest-server: auth-api: use new http-error crate

2023-07-26 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-auth-api/Cargo.toml | 2 ++ proxmox-auth-api/src/api/access.rs | 3 +- proxmox-rest-server/Cargo.toml | 1 + proxmox-rest-server/src/h2service.rs | 2 +- proxmox-rest-server/src/rest.rs | 2 +- proxmox-router/Cargo.toml

[pve-devel] [PATCH proxmox-perl-rs 4/5] notify: use new HttpError type

2023-07-26 Thread Lukas Wagner
Use `proxmox-http-error::HttpError` instead of `proxmox-notify::api::ApiError`. Signed-off-by: Lukas Wagner --- common/src/notify.rs | 77 +++- pve-rs/Cargo.toml| 1 + 2 files changed, 42 insertions(+), 36 deletions(-) diff --git a/common/src

[pve-devel] [PATCH proxmox-backup 5/5] use `HttpError` and macros from `proxmox-http-error` crate

2023-07-26 Thread Lukas Wagner
The `HttpError` type from `proxmox-router` has been moved into its own crate. Signed-off-by: Lukas Wagner --- Cargo.toml | 3 +++ src/api2/access/openid.rs | 5 ++--- src/api2/access/tfa.rs | 3 ++- src/api2/admin/datastore.rs

[pve-devel] [PATCH manager] ui: acl add: show warning if root@pam is selected

2023-07-26 Thread Lukas Wagner
hough, since we do not know if the token has separated privileges enable or not. Signed-off-by: Lukas Wagner --- www/manager6/dc/ACLView.js | 14 ++ 1 file changed, 14 insertions(+) diff --git a/www/manager6/dc/ACLView.js b/www/manager6/dc/ACLView.js index 79f900cd..ec81a487 100644 --

Re: [pve-devel] [pbs-devel] [PATCH proxmox 2/5] router: rest-server: auth-api: use new http-error crate

2023-07-26 Thread Lukas Wagner
On 7/26/23 15:41, Wolfgang Bumiller wrote: I'd like `proxmox-router` to keep re-exporting both the `http_bail/err` macros and the `HttpError` type. This would require much fewer changes at all the call sites, and we don't need to explicitly depend on the new crate everywhere. Its point is mostly

[pve-devel] [PATCH v2 proxmox 2/4] router: re-export `HttpError` from `proxmox-http-error`

2023-07-26 Thread Lukas Wagner
Signed-off-by: Lukas Wagner --- proxmox-router/Cargo.toml | 1 + proxmox-router/src/error.rs | 42 + proxmox-router/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 42 deletions(-) diff --git a/proxmox-router/Cargo.toml b/proxmox-router/Cargo.toml

<    2   3   4   5   6   7   8   9   10   11   >