Commit Graph

6943 Commits

Author SHA1 Message Date
Lukas Wagner
bacb4173fb ui: replication: backup: use renderEnabledIcon to render the enabled column
The new helper is available since proxmox-widget-toolkit version 3.6.1
which we can be sure to be available since a while in praxis, but
definitively by d/control constraints, since 51f54177 ("bump
proxmox-widget-toolkit dependency to 4.0.7")

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
 [TL: add context since when this function is available ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-01 09:44:28 +02:00
Lukas Wagner
461c5ee290 vzdump: fix notifications for backing up VMs with 2+ disks to PBS
In some situations, such as backing up VMs with 2 or more disks to
PBS, we get passed the backup archive size as a string instead of
as an integer. This led to errors rendering the notification template
down the line.

This commit explicitly casts the data from the task table to an int.
It would be a good idea to actually hunt down the places that produced
the string instead of an integer, but as a quick fix and as a
safeguard against similar lurking errors this approach is fine, IMO.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-25 15:32:01 +02:00
Christian Ebner
347f88fecd website: update external links to www.proxmox.com
During the redesign of www.proxmox.com the menu structure and therefore
some url changed. Update the external link in order to avoid an
unneccessary redirect

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2023-08-23 10:09:25 +02:00
Filip Schauer
72cfb3d4a1 fix #4663: Prevent Web UI reload on cert order for other node
While it makes sense to reload the Web UI after ordering a certificate
for the same node, it is unnecessary to reload the Web UI when ordering
a certificate for a different node.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2023-08-22 15:50:22 +02:00
Wolfgang Bumiller
a699b7d896 bump version to 8.0.5
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-08-16 12:12:47 +02:00
Wolfgang Bumiller
10821ca322 bump pve-doc-generator dependency
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-08-16 12:10:33 +02:00
Wolfgang Bumiller
3571d98b5f fix mocking in notification tests
PVE::Notify::send_notification is now private (the mocking was for the
old api)

'cfs_read_file' gets exported into PVE::Notify before it gets mocked,
so it needs to be mocked inside PVE::Notify, not PVE::Cluster.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-08-16 11:58:22 +02:00
Lukas Wagner
e5721b9062 vzdump: use <name> as a convention for virtual endpoints/groups
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 <w.bumiller@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:38:26 +02:00
Wolfgang Bumiller
51f54177e9 bump proxmox-widget-toolkit dependency to 4.0.7
for the notification ui

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-08-16 11:11:58 +02:00
Lukas Wagner
4c40d7cbed api: notification: make the 'mail-to-root' target visible to any user
Since the target does not require Mapping.Use, it should also be
visible and testable by all users.

Short explanation why the 'mail-to-root' is exempt from priv checks:

To ensure backwards compatibility, the 'mail-to-root' target does not
require the `Mapping.Use` privs. This is needed due to the fact that
this target is used as a fallback in case no other target is
configured for an event. For instance, the /node/<name>/apt/update API
call only requires Sys.Modify for the node, but it can also send a
notification. If we were to require Mapping.Use, we could break the
apt/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 <l.wagner@proxmox.com>
2023-08-16 11:11:24 +02:00
Lukas Wagner
c81bca2d28 ui: dc: remove notify key from datacenter option view
Settings for notifications have been moved to their own view.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:11:22 +02:00
Lukas Wagner
2cb9b31cb3 ui: perm path: increase width of the perm path selector combobox
ACL paths for notification targets can become quite long, e.g.:
/mappings/notifications/<target name>

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:11:21 +02:00
Lukas Wagner
56f677ebd7 ui: perm path: add ACL paths for notifications, usb and pci mappings
Suggested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:11:19 +02:00
Lukas Wagner
e4eb04d653 ui: add notification target configuration panel
Embed the new notification target configuration panel, implemented in
proxmox-widget-toolkit.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:11:18 +02:00
Lukas Wagner
80c49bb56d ui: allow to configure notification event -> target mapping
This commit adds a new view that allows configuring notification
targets for all existing notification events (replication, updates,
fencing).

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:11:16 +02:00
Lukas Wagner
d7e1976810 ui: backup: allow to set notification-target for one-off backups
In essence the same change as for backup jobs.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:11:15 +02:00
Lukas Wagner
3be4491221 ui: backup: adapt backup job details to new notification params
Adapt the backup job detail view so that it shows notification
targets.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:11:13 +02:00
Lukas Wagner
2c4780cc18 ui: backup: allow to select notification target for jobs
This commit adds a possibility to choose between different options
for notifications for backup jobs:
    - Notify via email, in the same manner as before
    - Notify via an endpoint/group

If 'notify via mail' is selected, a text field where an email address
can be entered is displayed:

    Notify:         | Always notify  v |
    Notify via:     | E-Mail         v |
    Send Mail to:   | foo@example.com  |
    Compression:    | .....          v |

If the other option is selected selected, a combo picker for selecting
a channel is displayed:

    Notify:         | Always notify  v |
    Notify via:     | Endpoint/Group v |
    Target:         | endpoint-foo   v |
    Compression:    | .....          v |

The code has also been adapted to use the newly introduced
'notification-policy' parameter, which replaces the 'mailnotification'
paramter for backup jobs. Some logic which automatically migrates from
'mailnotification' has been added.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:11:12 +02:00
Lukas Wagner
1ba1988dcf api: notification: disallow removing targets if they are used
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 <l.wagner@proxmox.com>
2023-08-16 11:11:08 +02:00
Lukas Wagner
7e6efd3905 api: notification: allow to test targets
This API call allows the user to test a notification target.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:11:06 +02:00
Lukas Wagner
e678a5dbfa api: notification: allow fetching notification targets
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 <l.wagner@proxmox.com>
2023-08-16 11:10:53 +02:00
Lukas Wagner
56977d48a9 api: notification: add api routes for filters
The Perl part of the API methods primarily defines the API schema,
checks for any needed priviledges and then calls the actual Rust
implementation exposed via perlmod. Any errors returned by the Rust
code are translated into PVE::Exception, so that the API call fails
with the correct HTTP error code.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:10:51 +02:00
Lukas Wagner
aed4eff9cf api: notification: add api routes for gotify endpoints
The Perl part of the API methods primarily defines the API schema,
checks for any needed priviledges and then calls the actual Rust
implementation exposed via perlmod. Any errors returned by the Rust
code are translated into PVE::Exception, so that the API call fails
with the correct HTTP error code.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:10:50 +02:00
Lukas Wagner
c2c3125126 api: notification: add api routes for sendmail endpoints
The Perl part of the API methods primarily defines the API schema,
checks for any needed priviledges and then calls the actual Rust
implementation exposed via perlmod. Any errors returned by the Rust
code are translated into PVE::Exception, so that the API call fails
with the correct HTTP error code.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:10:49 +02:00
Lukas Wagner
95c2dc1bc9 api: notification: add api routes for groups
The Perl part of the API methods primarily defines the API schema,
checks for any needed priviledges and then calls the actual Rust
implementation exposed via perlmod. Any errors returned by the Rust
code are translated into PVE::Exception, so that the API call fails
with the correct HTTP error code.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:10:47 +02:00
Lukas Wagner
b6fa29f3f5 api: prepare api handler module for notification config
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 <l.wagner@proxmox.com>
2023-08-16 11:10:15 +02:00
Lukas Wagner
2ab19e8351 api: replication: send notifications via new notification module
If the new 'target-replication' option in datacenter.cfg is set to a
notification target, we send notifications that way. If it is not set,
we continue send a notification to the default target (mail to
root@pam).

There is also a new 'replication' option. It controls whether to send
a notification at all.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:10:14 +02:00
Lukas Wagner
05855908c4 api: apt: send notification via new notification module
... 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 <l.wagner@proxmox.com>
2023-08-16 11:10:12 +02:00
Lukas Wagner
d8e4ddb4ff test: rename mail_test.pl to vzdump_notification_test.pl
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:10:11 +02:00
Lukas Wagner
c4afde55f2 vzdump: send notifications via new notification module
... instead of using sendmail directly.

If the new 'notification-target' parameter is set,
we send the notification to this endpoint or group.
If 'mailto' is set, we add a temporary endpoint and a
temporary group containg both targets.

This commit also refactors the old 'sendmail' sub heavily:
  - Use template-based notification text instead of endless
    string concatenations
  - Removing the old plaintext/HTML table rendering in favor of
    the new template/property-based approach offered by the
    `proxmox-notify` crate.
  - Rename `sendmail` sub to `send_notification`
  - Breaking out some of the code into helper subs, hopefully
    reducing the spaghetti factor a bit

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:10:10 +02:00
Lukas Wagner
7c236b5c11 d/control: add dependency to libpve-notify-perl
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-16 11:10:08 +02:00
Philipp Hufnagl
9d757d7185 fix #474: ui: allow transfer from container/vms
A user can no see all vms/containers, even the ones that are already a
member of a pool. They can be transfered now after checking the newly
introduced "allow transfer" checkbox.

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
2023-08-14 12:26:30 +02:00
Philipp Hufnagl
3a9764ad80 fix #474: api: allow transfer from container/vms
When the newly introduced optional parameter "transfer" is set, the user
add a vm/container to a pool even if it is already in one. If so it will
be removed from the old pool

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
2023-08-14 12:26:28 +02:00
Christoph Heiss
b9d23c8787 ui: ldap: add 'Check connection' checkbox as advanced option
The checkbox is enabled by default, setting the new `check-connection`
parameter. See also [0] for the rationale.

[0] https://lists.proxmox.com/pipermail/pve-devel/2023-July/058559.html

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-08-11 13:38:19 +02:00
Wolfgang Bumiller
e1d996dc55 bump pve-access-control dep to 8.0.5
This is required for the new check-connection parameter for ldap
realms added in the next commit.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-08-11 13:38:11 +02:00
Philipp Hufnagl
58ab77d189 fix whitespaces
Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
2023-08-04 13:54:34 +02:00
Wolfgang Bumiller
d4b490009c api: use standard vmid type for /cluster/resources
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-08-02 14:40:18 +02:00
Lukas Wagner
f7794ede56 ui: form: listfield: add 5px padding between grid and 'Add' button
Before, there was zero space between the the grid border line and the
button, making it look a bit odd.

The ListField form component is currently used in the
'User Tag Access' and 'Registered Tags' dialog windows in datacenter
option view.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-02 09:57:10 +02:00
Fabian Grünbichler
d258a813cf bump version to 8.0.4
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-08-01 11:55:46 +02:00
Fabian Grünbichler
3fc687f57b handle pve-kernel -> proxmox-kernel rename
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-08-01 10:33:12 +02:00
Alexander Zeidler
c62f096e2b api: backup: refactor backup permission check
Alter style to make the parameter check more concise

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
2023-07-27 10:40:17 +02:00
Friedrich Weber
98cbec545f ui: add some missing htmlEncodes
Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
2023-07-25 16:59:09 +02:00
Thomas Lamprecht
c34c541820 ui: active directory realm: expose case-sensitive option
The case-sensitive option is not really something that should be CLI
only and is quite common for Microsoft AD setups, so add it to the UI
too as requested in the Forum [0], improving discoverability.

[0]: https://forum.proxmox.com/threads/74547/#post-575854

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-25 10:12:04 +02:00
Lukas Wagner
41275bae64 test: fix names of .PHONY targets
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 <l.wagner@proxmox.com>
2023-07-24 15:58:11 +02:00
Alexandre Derumier
a8e18f8560 ui: sdn: zonedit: fix display && refactor
move ipam selector to main items as it's non optional, and it's breaking
display if present in advanced.

move common id,mtu,nodes fields from modules to base

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2023-07-19 11:09:09 +02:00
Fiona Ebner
a083d41041 pve7to8: fix Ceph noout check
Commit 114e5f2c ("pve7to8: sync over from stable-7 branch")
accidentally got rid of the correct value 0 here and also the new TODO
message to improve the situation. But the TODO is actually easy,
because there already is the $upgraded variable. Just rely on that
instead of hard-coding and forgetting about it again.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-07-15 23:28:46 +02:00
Dominik Csapak
ba7002f5e6 fix #4758: ui: lxc wizard: allow multiple ssh keys
by converting the textfield into a textarea and validate the value
line wise (if there is more than one line)

also create a 'MultiFileButton' (mostly copied from extjs) that allows
to select multiple files at once

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-07-15 23:26:34 +02:00
Max Carrara
d1c49f5b64 fix #4364: pveceph: add confirmation dialogue for ceph installation
Displays a confirmation dialogue if the user didn't explicitly
provide a valid ceph version via the `--version` flag and if
stdout is connected to a tty.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
2023-07-06 16:10:25 +02:00
Noel Ullreich
f9b888b055 fix #4551: ui: use gettext on hardcoded byte units
Since some languages translate byte units like 'GiB' or write them in their
own script, this patch wraps units in the `gettext` function.

While most occurrences of byte strings can be translated within the
`format_size` function in `proxmox-widget-toolkit/src/Utils.js`, this patch
catches those instances that are not translated.

Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com>
2023-07-05 09:12:57 +02:00
Thomas Lamprecht
114e5f2c4a pve7to8: sync over from stable-7 branch
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-03 13:19:13 +02:00