]> git.proxmox.com Git - pve-manager.git/log
pve-manager.git
7 months agoui: vm selector: gracefully handle undefined/null in setValue function
Fiona Ebner [Mon, 25 Sep 2023 11:58:41 +0000 (13:58 +0200)]
ui: vm selector: gracefully handle undefined/null in setValue function

Suggested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
7 months agoui: vm selector: don't add invalid not found items
Fiona Ebner [Mon, 25 Sep 2023 11:58:40 +0000 (13:58 +0200)]
ui: vm selector: don't add invalid not found items

Doing a simple numericity check and warn in the console so developers
can notice if there is something off.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
7 months agoui: vm selector: gracefully handle empty IDs in setValue function
Fiona Ebner [Mon, 25 Sep 2023 11:58:39 +0000 (13:58 +0200)]
ui: vm selector: gracefully handle empty IDs in setValue function

An empty string is passed by the backup job window when using
selection mode 'all', would be converted to [""] and wrongly add an
entry with VMID 0 because the item "" could not be found in the store.

Reported in the community forum:
https://forum.proxmox.com/threads/130164/

Fixes: 7a5ca76a ("fix #4239: ui: show selected but non-existing vmids in backup edit")
Suggested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
7 months agopve7to8: Fix Fedora 38 systemd unified cgroupv2 check
Christian Ebner [Mon, 28 Aug 2023 07:54:14 +0000 (09:54 +0200)]
pve7to8: Fix Fedora 38 systemd unified cgroupv2 check

For Fedora 38 the systemd shared object files used to check the systemd
version are located at /usr/lib64/systemd or /usr/lib/systemd.
Therefore, include /usr/lib64/systemd in the list of directories to
check.

Further, Fedora 38 adds a fc38 postfix to the filename, so expand the
regex to cover that as well.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
7 months agoRevert "api: query_url_metadata: optionally detect compression"
Thomas Lamprecht [Tue, 26 Sep 2023 11:00:12 +0000 (13:00 +0200)]
Revert "api: query_url_metadata: optionally detect compression"

A simple string regex match on data that the API returns anyway can be
the job of a frontend/client..

Safe to do as we never released this API change in a bumped manager
version and switched the UI to extract this info client-side.

This reverts commit d61728e289c82c7ce35a03b5b6b3da45ae177c5c.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoui: storage content: extract possible compressor extension client side
Thomas Lamprecht [Tue, 26 Sep 2023 15:58:55 +0000 (17:58 +0200)]
ui: storage content: extract possible compressor extension client side

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoui: avoid trivial decompression widget, only used once
Thomas Lamprecht [Tue, 26 Sep 2023 15:55:34 +0000 (17:55 +0200)]
ui: avoid trivial decompression widget, only used once

Currently it was only used once and it had not really any benefit, as
the one thing it did is defining a list of compressors – the
KVComboBox is made such, so that this can be done on definition
directly, no need for inheritance.

Also, if one would think about adopting this more for other similar
selectors: While we have some uses of compressors all over the place,
and most of them are not really coupled to each other, so having a
single widget for them does not make sense.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agofix #4849: ui: allow decompressing ISO files when downloading
Philipp Hufnagl [Thu, 21 Sep 2023 13:09:17 +0000 (15:09 +0200)]
fix #4849: ui: allow decompressing ISO files when downloading

The compression algorithm will be automatically detected when querying the
download URL. It can be overriden by the user using the "compression algorithm"
drop down under advanced.

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
Reworded title and message, updated d/control for libpve-storage-perl version
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
7 months agoapi: query_url_metadata: optionally detect compression
Philipp Hufnagl [Thu, 21 Sep 2023 13:09:16 +0000 (15:09 +0200)]
api: query_url_metadata: optionally detect compression

extend the query_url_metadata endpoint with the option to detect and return
used compression algorithms, if supported by PVE. this will be used to support
decompression as part of the download flow for certain file types (ISO files
for now).

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
Slightly reworded commit title/message
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agod/control: bump dependency of pve-container and guest-common
Thomas Lamprecht [Mon, 18 Sep 2023 14:55:08 +0000 (16:55 +0200)]
d/control: bump dependency of pve-container and guest-common

While not a must, it helps to ensure we got the newly documented
pbs-entries-max feature actually available and avoids all to freaky
set ups.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agofix #3069: vzdump: add property 'performance: pbs-entries-max=N'
Alexander Zeidler [Fri, 28 Jul 2023 13:28:55 +0000 (15:28 +0200)]
fix #3069: vzdump: add property 'performance: pbs-entries-max=N'

configuring pbs-entries-max can avoid failing backups due to a high
amount of files in folders where a folder exclusion is not possible

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
8 months agoui: notification: remove unneeded gettext calls
Lukas Wagner [Mon, 18 Sep 2023 08:20:26 +0000 (10:20 +0200)]
ui: notification: remove unneeded gettext calls

'mail-to-root' is the name of the default notification target and
should thus not be translated.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
8 months agoui: notifications event: fix using gettext
Thomas Lamprecht [Thu, 14 Sep 2023 06:15:02 +0000 (08:15 +0200)]
ui: notifications event: fix using gettext

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agobump version to 8.0.6
Thomas Lamprecht [Fri, 8 Sep 2023 11:41:30 +0000 (13:41 +0200)]
bump version to 8.0.6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoapi: pool update: rename 'transfer' parameter to 'allow-move'
Thomas Lamprecht [Fri, 8 Sep 2023 11:31:30 +0000 (13:31 +0200)]
api: pool update: rename 'transfer' parameter to 'allow-move'

The 'allow' wording makes it clearer that we just not block something,
but do not really do anything else. And we use the 'move' wording also
for when moving volumes between guests, which is in the same spirit as
this here (remove something from a entity and add it to another).

While this was already bumped, we did not move it outside of pvetest,
so I do not see practical concerns with API breakage.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoapi: pool update: refactor/code-clean-up guest handling
Thomas Lamprecht [Fri, 8 Sep 2023 11:30:41 +0000 (13:30 +0200)]
api: pool update: refactor/code-clean-up guest handling

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoapi: pool update: improve description and document defaults
Thomas Lamprecht [Fri, 8 Sep 2023 11:29:26 +0000 (13:29 +0200)]
api: pool update: improve description and document defaults

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoui: pool view: make window bigger and 4:3 ratio
Thomas Lamprecht [Fri, 8 Sep 2023 11:13:54 +0000 (13:13 +0200)]
ui: pool view: make window bigger and 4:3 ratio

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoui: pool view: simplify guest-status renderer
Thomas Lamprecht [Fri, 8 Sep 2023 11:11:09 +0000 (13:11 +0200)]
ui: pool view: simplify guest-status renderer

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoui: pool view: label pool-column as 'Current Pool'
Thomas Lamprecht [Fri, 8 Sep 2023 11:09:46 +0000 (13:09 +0200)]
ui: pool view: label pool-column as 'Current Pool'

to make it clearer, as having such a column could be slightly
confusing to some.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoui: pool view: replace allow-transfer checkbox with simple hint
Thomas Lamprecht [Fri, 8 Sep 2023 11:08:03 +0000 (13:08 +0200)]
ui: pool view: replace allow-transfer checkbox with simple hint

It's not really providing good UX, as user needs to extra tick this
but cannot be sure what transfer means in this case.

Just replace this with a simple, more telling hint that will inform
users about what happens.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agofix #4808: ceph: mds create: use snake_case when setting options
Maximiliano Sandoval [Tue, 5 Sep 2023 08:53:31 +0000 (10:53 +0200)]
fix #4808: ceph: mds create: use snake_case when setting options

As suggested in [1], it is recommended to use `_` in all cases when
dealing with config files. Note that this is for creation only, and we
enforce that there cannot be an existing MDS with the same ID, so we
do not have to bother how ceph would handle the case where both exist.

[1] https://docs.ceph.com/en/reef/rados/configuration/ceph-conf/#option-names

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agofix #4947 spice: correct filename extension safari
Markus Frank [Wed, 6 Sep 2023 09:37:03 +0000 (11:37 +0200)]
fix #4947 spice: correct filename extension safari

Fix file extension for SPICE config download on
AppleWebKit browsers to ensure proper application
association on MacOS.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoui: ldap: ad: replace occurences of SSL with TLS
Lukas Wagner [Thu, 27 Jul 2023 08:57:47 +0000 (10:57 +0200)]
ui: ldap: ad: replace occurences of SSL with TLS

Although 'SSL' is used colloquially, the proper term is 'TLS'.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
8 months agoui: ldap: ad: fix typo for verify certificate combobox
Lukas Wagner [Thu, 27 Jul 2023 08:57:46 +0000 (10:57 +0200)]
ui: ldap: ad: fix typo for verify certificate combobox

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
8 months agoui: ldap: ad: support 'mode' paramter, replacing 'secure'
Lukas Wagner [Thu, 27 Jul 2023 08:57:45 +0000 (10:57 +0200)]
ui: ldap: ad: support 'mode' paramter, replacing 'secure'

The backend has supported the 'mode' parameter for quite a while,
however it has not yet been exposed in the GUI, contrary to PMG
and PBS.

The benefit of 'mode' is that it supports LDAP, LDAPS and LDAP via
STARTTLS, compared to just LDAP/LDAPS for the 'secure' parameter.

The modified AuthEdit{LDAP,AD} panel will now automatically migrate
to the new paramter by hooking into onGetValues/onSetValues.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
8 months agoui: ceph: add Ceph 19 Squid to release map
Thomas Lamprecht [Mon, 4 Sep 2023 16:06:46 +0000 (18:06 +0200)]
ui: ceph: add Ceph 19 Squid to release map

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoui: ceph wizard: add Ceph 18.2 Reef to available releases
Thomas Lamprecht [Mon, 4 Sep 2023 16:05:44 +0000 (18:05 +0200)]
ui: ceph wizard: add Ceph 18.2 Reef to available releases

still default to Ceph 17.2 Quincy for now, at least if there isn't a
Ceph Reef set-up in the cluster already.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoui: ceph wizard: drop unused gettext
Thomas Lamprecht [Mon, 4 Sep 2023 16:05:28 +0000 (18:05 +0200)]
ui: ceph wizard: drop unused gettext

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agopveceph: support installing Ceph 18.2 Reef
Thomas Lamprecht [Mon, 4 Sep 2023 16:05:08 +0000 (18:05 +0200)]
pveceph: support installing Ceph 18.2 Reef

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoapi: ceph osd: factor out getting PSS stat & improve error handling
Thomas Lamprecht [Mon, 4 Sep 2023 12:24:17 +0000 (14:24 +0200)]
api: ceph osd: factor out getting PSS stat & improve error handling

Do not crowd the higher level API endpoint handler code directly with
some rather low level procfs parsing code, rather factor that out in a
helper. Make said helper private for now so that anybody wanting to
use cannot do so, and thus increase the chance that said dev will
actually think about if this makes sense as is as a general interface.

Avoid fatal die's for the odd case that the smaps_rollup file cannot
be opened, or the even less likely case where PSS stats cannot be
found in the content.

The former could happen due to the general TOCTOU race here, i.e., the
PID we get from systemctl service status parsing isn't guaranteed to
exist anymore when we read from procfs, and if, it's actually not
guaranteed to still be the OSD - but we cannot easily use pidfd's
here and OSD stops are not something that happens frequently, but in
anyway avoid that such a thing fails the whole API call only because a
single metric is affected.

In the long rung it might be better to add a "errors" array to the
response, so that the user can be informed about such an (odd) thing
happening.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoapi: ceph osd: drop unused variable and useless intermediate code
Thomas Lamprecht [Mon, 4 Sep 2023 12:22:27 +0000 (14:22 +0200)]
api: ceph osd: drop unused variable and useless intermediate code

$raw isn't used anywhere here and probably just a left over from copy
pasting, and the "int cast ternary" can be avoided by just directly
casting to int when assigning the variable in the first place.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoapi: ceph: improve reporting of ceph OSD memory usage
Stefan Hanreich [Mon, 4 Sep 2023 09:18:07 +0000 (11:18 +0200)]
api: ceph: improve reporting of ceph OSD memory usage

Currently we are using the MemoryCurrent property of the OSD service
to determine the used memory of a Ceph OSD. This includes, among other
things, the memory used by buffers [1]. Since BlueFS uses buffered
I/O, this can lead to extremely high values shown in the UI.

Instead we are now reading the PSS value from the proc filesystem,
which should more accurately reflect the amount of memory currently
used by the Ceph OSD.

Aaron and I decided on PSS over RSS, since this should give a better
idea of used memory - particularly when using a large amount of OSDs
on one host, since the OSDs share some of the pages.

[1] https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
8 months agoui: replication: backup: use renderEnabledIcon to render the enabled column
Lukas Wagner [Tue, 18 Jul 2023 09:53:05 +0000 (11:53 +0200)]
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>
8 months agovzdump: fix notifications for backing up VMs with 2+ disks to PBS
Lukas Wagner [Fri, 25 Aug 2023 09:45:12 +0000 (11:45 +0200)]
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>
8 months agowebsite: update external links to www.proxmox.com
Christian Ebner [Fri, 11 Aug 2023 10:46:54 +0000 (12:46 +0200)]
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>
9 months agofix #4663: Prevent Web UI reload on cert order for other node
Filip Schauer [Wed, 16 Aug 2023 09:54:57 +0000 (11:54 +0200)]
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>
9 months agobump version to 8.0.5
Wolfgang Bumiller [Wed, 16 Aug 2023 10:12:47 +0000 (12:12 +0200)]
bump version to 8.0.5

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agobump pve-doc-generator dependency
Wolfgang Bumiller [Wed, 16 Aug 2023 10:10:33 +0000 (12:10 +0200)]
bump pve-doc-generator dependency

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agofix mocking in notification tests
Wolfgang Bumiller [Wed, 16 Aug 2023 09:58:20 +0000 (11:58 +0200)]
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>
9 months agovzdump: use <name> as a convention for virtual endpoints/groups
Lukas Wagner [Thu, 3 Aug 2023 12:17:12 +0000 (14:17 +0200)]
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>
9 months agobump proxmox-widget-toolkit dependency to 4.0.7
Wolfgang Bumiller [Wed, 16 Aug 2023 09:11:57 +0000 (11:11 +0200)]
bump proxmox-widget-toolkit dependency to 4.0.7

for the notification ui

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agoapi: notification: make the 'mail-to-root' target visible to any user
Lukas Wagner [Thu, 3 Aug 2023 12:17:13 +0000 (14:17 +0200)]
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>
9 months agoui: dc: remove notify key from datacenter option view
Lukas Wagner [Thu, 3 Aug 2023 12:17:11 +0000 (14:17 +0200)]
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>
9 months agoui: perm path: increase width of the perm path selector combobox
Lukas Wagner [Thu, 3 Aug 2023 12:17:10 +0000 (14:17 +0200)]
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>
9 months agoui: perm path: add ACL paths for notifications, usb and pci mappings
Lukas Wagner [Thu, 3 Aug 2023 12:17:09 +0000 (14:17 +0200)]
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>
9 months agoui: add notification target configuration panel
Lukas Wagner [Thu, 3 Aug 2023 12:17:08 +0000 (14:17 +0200)]
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>
9 months agoui: allow to configure notification event -> target mapping
Lukas Wagner [Thu, 3 Aug 2023 12:17:07 +0000 (14:17 +0200)]
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>
9 months agoui: backup: allow to set notification-target for one-off backups
Lukas Wagner [Thu, 3 Aug 2023 12:17:06 +0000 (14:17 +0200)]
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>
9 months agoui: backup: adapt backup job details to new notification params
Lukas Wagner [Thu, 3 Aug 2023 12:17:05 +0000 (14:17 +0200)]
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>
9 months agoui: backup: allow to select notification target for jobs
Lukas Wagner [Thu, 3 Aug 2023 12:17:04 +0000 (14:17 +0200)]
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>
9 months agoapi: notification: disallow removing targets if they are used
Lukas Wagner [Thu, 3 Aug 2023 12:17:03 +0000 (14:17 +0200)]
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>
9 months agoapi: notification: allow to test targets
Lukas Wagner [Thu, 3 Aug 2023 12:17:02 +0000 (14:17 +0200)]
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>
9 months agoapi: notification: allow fetching notification targets
Lukas Wagner [Thu, 3 Aug 2023 12:17:01 +0000 (14:17 +0200)]
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>
9 months agoapi: notification: add api routes for filters
Lukas Wagner [Thu, 3 Aug 2023 12:17:00 +0000 (14:17 +0200)]
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>
9 months agoapi: notification: add api routes for gotify endpoints
Lukas Wagner [Thu, 3 Aug 2023 12:16:59 +0000 (14:16 +0200)]
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>
9 months agoapi: notification: add api routes for sendmail endpoints
Lukas Wagner [Thu, 3 Aug 2023 12:16:58 +0000 (14:16 +0200)]
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>
9 months agoapi: notification: add api routes for groups
Lukas Wagner [Thu, 3 Aug 2023 12:16:57 +0000 (14:16 +0200)]
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>
9 months agoapi: prepare api handler module for notification config
Lukas Wagner [Thu, 3 Aug 2023 12:16:56 +0000 (14:16 +0200)]
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>
9 months agoapi: replication: send notifications via new notification module
Lukas Wagner [Thu, 3 Aug 2023 12:16:55 +0000 (14:16 +0200)]
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>
9 months agoapi: apt: send notification via new notification module
Lukas Wagner [Thu, 3 Aug 2023 12:16:54 +0000 (14:16 +0200)]
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>
9 months agotest: rename mail_test.pl to vzdump_notification_test.pl
Lukas Wagner [Thu, 3 Aug 2023 12:16:53 +0000 (14:16 +0200)]
test: rename mail_test.pl to vzdump_notification_test.pl

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
9 months agovzdump: send notifications via new notification module
Lukas Wagner [Thu, 3 Aug 2023 12:16:52 +0000 (14:16 +0200)]
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>
9 months agod/control: add dependency to `libpve-notify-perl`
Lukas Wagner [Thu, 3 Aug 2023 12:16:51 +0000 (14:16 +0200)]
d/control: add dependency to `libpve-notify-perl`

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
9 months agofix #474: ui: allow transfer from container/vms
Philipp Hufnagl [Thu, 10 Aug 2023 10:09:02 +0000 (12:09 +0200)]
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>
9 months agofix #474: api: allow transfer from container/vms
Philipp Hufnagl [Thu, 10 Aug 2023 10:09:01 +0000 (12:09 +0200)]
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>
9 months agoui: ldap: add 'Check connection' checkbox as advanced option
Christoph Heiss [Thu, 10 Aug 2023 12:37:08 +0000 (14:37 +0200)]
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>
9 months agobump pve-access-control dep to 8.0.5
Wolfgang Bumiller [Fri, 11 Aug 2023 11:37:55 +0000 (13:37 +0200)]
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>
9 months agofix whitespaces
Philipp Hufnagl [Tue, 1 Aug 2023 14:46:04 +0000 (16:46 +0200)]
fix whitespaces

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
9 months agoapi: use standard vmid type for /cluster/resources
Wolfgang Bumiller [Wed, 2 Aug 2023 12:40:18 +0000 (14:40 +0200)]
api: use standard vmid type for /cluster/resources

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agoui: form: listfield: add 5px padding between grid and 'Add' button
Lukas Wagner [Thu, 27 Jul 2023 12:47:09 +0000 (14:47 +0200)]
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>
9 months agobump version to 8.0.4
Fabian Grünbichler [Tue, 1 Aug 2023 09:55:46 +0000 (11:55 +0200)]
bump version to 8.0.4

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
9 months agohandle pve-kernel -> proxmox-kernel rename
Fabian Grünbichler [Tue, 18 Jul 2023 08:31:34 +0000 (10:31 +0200)]
handle pve-kernel -> proxmox-kernel rename

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
9 months agoapi: backup: refactor backup permission check
Alexander Zeidler [Thu, 15 Jun 2023 14:14:42 +0000 (16:14 +0200)]
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>
9 months agoui: add some missing `htmlEncode`s
Friedrich Weber [Tue, 25 Jul 2023 11:52:46 +0000 (13:52 +0200)]
ui: add some missing `htmlEncode`s

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
9 months agoui: active directory realm: expose case-sensitive option
Thomas Lamprecht [Tue, 25 Jul 2023 08:12:00 +0000 (10:12 +0200)]
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>
9 months agotest: fix names of .PHONY targets
Lukas Wagner [Thu, 20 Jul 2023 14:32:09 +0000 (16:32 +0200)]
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>
10 months agoui: sdn: zonedit: fix display && refactor
Alexandre Derumier [Sat, 17 Jun 2023 12:43:05 +0000 (14:43 +0200)]
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>
10 months agopve7to8: fix Ceph noout check
Fiona Ebner [Mon, 17 Jul 2023 08:38:19 +0000 (10:38 +0200)]
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>
10 months agofix #4758: ui: lxc wizard: allow multiple ssh keys
Dominik Csapak [Mon, 17 Jul 2023 12:34:24 +0000 (14:34 +0200)]
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>
10 months agofix #4364: pveceph: add confirmation dialogue for ceph installation
Max Carrara [Wed, 5 Jul 2023 18:02:40 +0000 (20:02 +0200)]
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>
10 months agofix #4551: ui: use gettext on hardcoded byte units
Noel Ullreich [Mon, 3 Jul 2023 12:15:59 +0000 (14:15 +0200)]
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>
10 months agopve7to8: sync over from stable-7 branch
Thomas Lamprecht [Mon, 3 Jul 2023 11:19:13 +0000 (13:19 +0200)]
pve7to8: sync over from stable-7 branch

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: ordering/style cleanups
Thomas Lamprecht [Mon, 3 Jul 2023 11:17:18 +0000 (13:17 +0200)]
buildsys: ordering/style cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agoupdate shipped appliance info index
Thomas Lamprecht [Fri, 30 Jun 2023 15:02:34 +0000 (17:02 +0200)]
update shipped appliance info index

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agotry using 'pve-eslint' if it exists
Dominik Csapak [Fri, 23 Jun 2023 07:08:44 +0000 (09:08 +0200)]
try using 'pve-eslint' if it exists

but fallback to 'eslint' otherwise

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [T: move into www/manager Makefile directly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoui: migrate: fix disabled migrate button glitch
Dominik Csapak [Thu, 22 Jun 2023 12:15:12 +0000 (14:15 +0200)]
ui: migrate: fix disabled migrate button glitch

under certain circumstances, the migrate button stays disabled, even
when a valid target node was selected:
* the first node that gets autoselected (most likely the second)
  is not a valid migration target
* the user changes to a migration target that is a valid one

if that happens, the migration button would stay disabled.
switching once to a non valid target and would enable the button.

To fix it, we have to do two things here:

'checkQemuPreconditions' is actually an async function that awaits an
api call and uses the result to set the 'migration.allowedNodes'
property

'checkMigratePreconditions' calls 'checkQemuPreconditions' and uses the
'migration.allowedNodes' property afterwards.

but since 'checkMigratePreconditions' is not async, that happens before
the api call can return the valid data and thus leaves it empty, making
all nodes valid in the selector. (thus the initial selected node is
valid)

instead make 'checkMigratePreconditions' also async and await the result
of 'checkQemuPreconditions'

this unearthed another issue, namely we access an object that is
possibly undefined (worked out before due to race conditions) so
fallback to an empty object.

and lastly, since we want the 'disallowedNodes' set before actually
checking the qemu preconditions, we move the setting of that on
the node selector above the qemu preconditions check
(this is the only place where we set it anyway, and the source does not
change, we probably could move that out of that function altogether)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
11 months agobump version to 8.0.3
Thomas Lamprecht [Wed, 21 Jun 2023 17:55:58 +0000 (19:55 +0200)]
bump version to 8.0.3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agopve7to8: sync over from stable-7 branch
Thomas Lamprecht [Wed, 21 Jun 2023 17:52:59 +0000 (19:52 +0200)]
pve7to8: sync over from stable-7 branch

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agopve7to8: add check for systemd-boot presence where needed
Stoiko Ivanov [Wed, 21 Jun 2023 17:35:57 +0000 (19:35 +0200)]
pve7to8: add check for systemd-boot presence where needed

since the package won't get installed for systems upgraded from 7 to 8
we warn users who need systemd-boot - to be able to initialize new
ESPs - that they need to install it

The check for package installation is based on existance of the
changelog, since the package information used in pve7to8 comes from
the API-modules, which limit it to the pve-relevant packages.

tested in VMs with uefi and legacy mode, with existing
proxmox-boot-uuids both with and w/o systemd-boot being installed

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
11 months agopve7to8: avoid confusing warning about required setting 'storage' for vzdump
Fiona Ebner [Wed, 21 Jun 2023 15:02:01 +0000 (17:02 +0200)]
pve7to8: avoid confusing warning about required setting 'storage' for vzdump

It's required in the schema for notes-template and protected, but when
parsing vzdump.conf, it shouldn't matter whether the storage parameter
is set or not.

The warning is ugly and users might interpret it as something that
needs to be acted upon for the upgrade:
parse error in '/etc/vzdump.conf' - 'storage': missing property - 'notes-template' requires this property\nmissing property - 'protected' requires this property

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
(cherry picked from commit 517abd0cd28a613598e2a3a8d5d8d057578c14b6)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agopve7to8: remove outdated warning about retention
Fiona Ebner [Wed, 21 Jun 2023 15:02:00 +0000 (17:02 +0200)]
pve7to8: remove outdated warning about retention

It just talks about the default behavior since PVE 7. It's rather
confusing to mention this, because the behavior doesn't change anymore
in PVE 8.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
(cherry picked from commit b58348b1b60c6546b14323ec9303c91d5b1a29b7)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agopve7to8: content-dirs check: skip paths that cannot be resolved
Friedrich Weber [Thu, 15 Jun 2023 13:22:31 +0000 (15:22 +0200)]
pve7to8: content-dirs check: skip paths that cannot be resolved

The current inequality check for content-dirs does not correctly
handle the case in which `abs_path` returns undef. This can result in
confusing warnings:

  storage [...] uses directory  for multiple content types [...]

Fix this by skipping paths for which `abs_path` returns undef. This
matches the behavior of the actual content-dirs check in PVE 8 [0].

[0]: https://git.proxmox.com/?p=pve-storage.git;a=commit;h=09f1f847a

Fixes: ea0a4f1943ffafe94282afc800d5720db45df198
Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
(cherry picked from commit 20fb9aa3f15f9d3ef89bfc3784d72a791c55b757)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agopve7to8: add reminder comment for noout_wanted variable
Fiona Ebner [Wed, 21 Jun 2023 16:19:48 +0000 (18:19 +0200)]
pve7to8: add reminder comment for noout_wanted variable

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
11 months agoui: use common gettext for IOMMU-Group
Thomas Lamprecht [Wed, 21 Jun 2023 16:02:53 +0000 (18:02 +0200)]
ui: use common gettext for IOMMU-Group

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobump version to 8.0.2
Thomas Lamprecht [Wed, 21 Jun 2023 15:06:54 +0000 (17:06 +0200)]
bump version to 8.0.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agod/postinst: remove beta sources for real
Thomas Lamprecht [Wed, 21 Jun 2023 15:06:31 +0000 (17:06 +0200)]
d/postinst: remove beta sources for real

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobump version to 8.0.1
Thomas Lamprecht [Wed, 21 Jun 2023 14:00:11 +0000 (16:00 +0200)]
bump version to 8.0.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoapi: resource usb mapping: add missing proxyto_callback
Dominik Csapak [Wed, 21 Jun 2023 10:05:09 +0000 (12:05 +0200)]
api: resource usb mapping: add missing proxyto_callback

i have added it to the pci api call, but forgot to add it for usb
otherwise adding a mapped usb device only works on the node where the
gui is connected to

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
11 months agoui: cloudinit: align default value for package upgrades with backend again
Fiona Ebner [Wed, 21 Jun 2023 10:04:33 +0000 (12:04 +0200)]
ui: cloudinit: align default value for package upgrades with backend again

The default in Proxmox VE 7 was true and it was decided to keep that
and avoid a breaking change.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>