Commit Graph

6968 Commits

Author SHA1 Message Date
Philipp Hufnagl
d61728e289 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>
2023-09-26 09:28:09 +02:00
Thomas Lamprecht
acaa1e40d6 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>
2023-09-18 16:55:09 +02:00
Alexander Zeidler
b0c2d8980f 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>
2023-09-18 16:54:17 +02:00
Lukas Wagner
84846fdc10 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>
2023-09-18 12:06:52 +02:00
Thomas Lamprecht
3dff70eb7e ui: notifications event: fix using gettext
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-14 08:15:02 +02:00
Thomas Lamprecht
57490ff2c6 bump version to 8.0.6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-08 13:42:20 +02:00
Thomas Lamprecht
f9cfa38ee7 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>
2023-09-08 13:36:38 +02:00
Thomas Lamprecht
b7bc7ae9da api: pool update: refactor/code-clean-up guest handling
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-08 13:36:38 +02:00
Thomas Lamprecht
a06d2fac44 api: pool update: improve description and document defaults
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-08 13:36:38 +02:00
Thomas Lamprecht
67f5dbd305 ui: pool view: make window bigger and 4:3 ratio
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-08 13:36:38 +02:00
Thomas Lamprecht
c0f2b23659 ui: pool view: simplify guest-status renderer
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-08 13:36:38 +02:00
Thomas Lamprecht
207cd6e0e6 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>
2023-09-08 13:36:38 +02:00
Thomas Lamprecht
672e81df36 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>
2023-09-08 13:36:38 +02:00
Maximiliano Sandoval
ab70343982 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>
2023-09-06 16:57:10 +02:00
Markus Frank
e8ed907b7e 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>
2023-09-06 16:46:03 +02:00
Lukas Wagner
c54ff6e901 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>
2023-09-04 18:07:27 +02:00
Lukas Wagner
2b9b6bc401 ui: ldap: ad: fix typo for verify certificate combobox
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-09-04 18:07:27 +02:00
Lukas Wagner
09a2f33458 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>
2023-09-04 18:07:27 +02:00
Thomas Lamprecht
8b4f117858 ui: ceph: add Ceph 19 Squid to release map
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-04 18:06:46 +02:00
Thomas Lamprecht
41af7c5e7e 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>
2023-09-04 18:05:46 +02:00
Thomas Lamprecht
0e1178d8d2 ui: ceph wizard: drop unused gettext
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-04 18:05:28 +02:00
Thomas Lamprecht
12c8efb59e pveceph: support installing Ceph 18.2 Reef
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-04 18:05:08 +02:00
Thomas Lamprecht
b4b39b55f8 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>
2023-09-04 14:44:33 +02:00
Thomas Lamprecht
f7b7e942a7 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>
2023-09-04 14:22:31 +02:00
Stefan Hanreich
808eb12f8c 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>
2023-09-04 13:53:35 +02:00
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