]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
7 days agoupdate proxmox-metrics dependency to 0.3.1 master
Thomas Lamprecht [Fri, 26 Apr 2024 15:55:28 +0000 (17:55 +0200)]
update proxmox-metrics dependency to 0.3.1

to ensure that it can handle the recently lifted restrictions on the
organization and bucket parameters correctly by URL encoding them.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 days agoapi-types: remove influxdb bucket name restrictions
Gabriel Goller [Fri, 26 Apr 2024 14:02:43 +0000 (16:02 +0200)]
api-types: remove influxdb bucket name restrictions

Remove the regex for influxdb organizations and buckets. Influxdb does
not place any constraints on these names and allows all characters. This
allows influxdb organization names with slashes.

Also remove a duplicate comment and add some missing ones.

This also aligns the behavior to PVE as there are no restrictions there
either.

The motivation for this patch is this forum post:
https://forum.proxmox.com/threads/influx-db-organization-doesnt-allow-slash.145402/

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
7 days agoupdate proxmox-sys dependency to 0.5.4
Thomas Lamprecht [Fri, 26 Apr 2024 15:54:06 +0000 (17:54 +0200)]
update proxmox-sys dependency to 0.5.4

to ensure the next build contains the 78bf05a4 ("fix: use fragmented
block size for space calculation") improvement.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 days agobump version to 3.2.2-1 v3.2.2
Thomas Lamprecht [Thu, 25 Apr 2024 10:06:15 +0000 (12:06 +0200)]
bump version to 3.2.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 days agoui: sync job: fix error if local namespace is selected first
Lukas Wagner [Thu, 25 Apr 2024 08:59:36 +0000 (10:59 +0200)]
ui: sync job: fix error if local namespace is selected first

When creating a new sync job and a local namespace is configured
without setting a remote first, the createMaxPrefixLength
was passed an array instead of a string/undefined/null, which
triggered a 'ns2.match is not a funtion exception', making the UI
glitchy afterwards.

Fixed by explicitly checking for a string. Verified that the other
user of NamespaceMaxDepthReduced, the prune job edit window, does not
break after the change.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
8 days agofix: tape ui: unset `deleteEmpty` in `TapeBackupWindow`
Stefan Sterz [Fri, 5 Apr 2024 14:12:57 +0000 (16:12 +0200)]
fix: tape ui: unset `deleteEmpty` in `TapeBackupWindow`

since the api rejects unknown parameters, deleteEmpty needs to be
unset here, because the endpoint for creating backups does not support
deleting parameters. otherwise a user will get a fairly cryptic error
message in the gui.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
8 days agoui: utils: fix defaultMailAuthor
Lukas Wagner [Thu, 25 Apr 2024 07:37:07 +0000 (09:37 +0200)]
ui: utils: fix defaultMailAuthor

The default mail author for SMTP and Sendmail target is
"Proxmox Backup Server - <hostname>" and not
"Proxmox Backup Server (<hostname>)".

This is just a cosmetical change which affects the empty text for the
'Author' field in the sendmail/smtp edit window.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
9 days agobump version to 3.2.1-1
Thomas Lamprecht [Wed, 24 Apr 2024 20:07:05 +0000 (22:07 +0200)]
bump version to 3.2.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 days agoui: enable vlan widget
Stefan Lendl [Thu, 4 Apr 2024 10:00:36 +0000 (12:00 +0200)]
ui: enable vlan widget

* Enabled the "Linux VLAN" option when creating a new interface.
* This requires the updated widget-toolkit to contain vlan field widget.

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Folke Gleumes <f.gleumes@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 days agoapi: create and update vlan interfaces
Stefan Lendl [Thu, 4 Apr 2024 10:00:35 +0000 (12:00 +0200)]
api: create and update vlan interfaces

* Implement setting vlan-id and vlan-raw-device in the create and update api.
* Checking if the provided vlan-raw-device exists
* Moved VLAN_INTERFACE_REGEX to top level network module to use it in
  the checking functions there. Changed to match with named capture groups.
* Unit tests to verify parsing vlan_id and vlan_raw_device from name.

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Folke Gleumes <f.gleumes@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 days agofmt: fix intendation in api macro
Stefan Lendl [Thu, 4 Apr 2024 10:00:34 +0000 (12:00 +0200)]
fmt: fix intendation in api macro

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Folke Gleumes <f.gleumes@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 days agoconfig: remove unnecessary pub in various methods in NetworkConfig
Stefan Lendl [Thu, 4 Apr 2024 10:00:33 +0000 (12:00 +0200)]
config: remove unnecessary pub in various methods in NetworkConfig

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Folke Gleumes <f.gleumes@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 days agoconfig: parse vlan interface from config
Stefan Lendl [Thu, 4 Apr 2024 10:00:32 +0000 (12:00 +0200)]
config: parse vlan interface from config

Support three types of vlan configurations defined in interfaces,
conforming to the PVE configurations:

iface nic.<vlan-id> inet

iface vlan<vlan-id> inet
vlan-raw-device <nic>

iface <arbitraty-name> inet
vlan-id <vlan-id>
vlan-raw-device <nic>

* Add lexer Token enum variants for vlan-id and vlan-raw-device and parse
  them in parse_iface_attributes.
* Add tests to verify this works in the above scenarios

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Folke Gleumes <f.gleumes@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 days agoconfig: write vlan network interface
Stefan Lendl [Thu, 4 Apr 2024 10:00:31 +0000 (12:00 +0200)]
config: write vlan network interface

* Add vlan_id and vlan_raw_device fields to the Interface api type
* Write to the network config the vlan specific properties for vlan
  interface type
* Add several tests to verify the functionally

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Folke Gleumes <f.gleumes@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 days agotests: simple tests for writing the network config
Stefan Lendl [Thu, 4 Apr 2024 10:00:30 +0000 (12:00 +0200)]
tests: simple tests for writing the network config

Simple tests for manual and static configurations.

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Folke Gleumes <f.gleumes@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 days agotests: move network tests to parser.rs
Stefan Lendl [Thu, 4 Apr 2024 10:00:29 +0000 (12:00 +0200)]
tests: move network tests to parser.rs

All current tests in network/mod.rs only test parser functionality and
  should therefore live in the parser module.

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Folke Gleumes <f.gleumes@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 days agoapi: tape: don't allow overwriting of ids in changer/drive config
Dominik Csapak [Wed, 6 Mar 2024 09:39:45 +0000 (10:39 +0100)]
api: tape: don't allow overwriting of ids in changer/drive config

by checking the whole section config for an existing id, not only the
ones of the given type.

This prevents creation of a drive config with the same name as an
existing changer and vice versa, as it is confusing that existing things
get deleted, and we can get in the situation that we reference a changer
that does not exist anymore, i.e. consider this:

* create a changer with name `foo`
* create a drive with name `foo` and select changer `foo` for it

this would delete the changer config, but still reference it, leading
to errors when trying to use it.

We could implement support for separate id namespaces in section configs
for different types, but this is much more easier to do and be enough
for now.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
9 days agoinstallation: add section about unattended/automatic installation
Aaron Lauterer [Thu, 18 Apr 2024 16:12:26 +0000 (18:12 +0200)]
installation: add section about unattended/automatic installation

Mention and briefly explain it. The main part of the documentation will
live in the Wiki for now as it applies to not just Proxmox Mail Gateway.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
  [ TL: adapt to changes made in the wiki article ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 days agoauth: request a write lock when exposing the `LockedTfaConfig`
Stefan Sterz [Fri, 12 Apr 2024 12:31:56 +0000 (14:31 +0200)]
auth: request a write lock when exposing the `LockedTfaConfig`

this function is called every time a user tries to log in to check
whether a tfa challenge is required. since the tfa config may need to
be written by the auth api (e.g. when a recovery key is used) this
needs to use a write lock instead of a read lock in order to avoid
potential races.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
9 days agodocs: user-management: add section about AD realm support
Christoph Heiss [Fri, 12 Jan 2024 16:16:06 +0000 (17:16 +0100)]
docs: user-management: add section about AD realm support

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
9 days agomanager: add subcommand for managing AD realms
Christoph Heiss [Fri, 12 Jan 2024 16:16:05 +0000 (17:16 +0100)]
manager: add subcommand for managing AD realms

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
9 days agorealm sync: add sync job for AD realms
Christoph Heiss [Fri, 12 Jan 2024 16:16:04 +0000 (17:16 +0100)]
realm sync: add sync job for AD realms

Basically just a thin wrapper over the existing LDAP-based realm sync
job, which retrieves the appropriate config and sets the correct user
attributes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
9 days agoconfig: domains: add new "ad" section type for AD realms
Christoph Heiss [Fri, 12 Jan 2024 16:16:03 +0000 (17:16 +0100)]
config: domains: add new "ad" section type for AD realms

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
9 days agoapi: access: add routes for managing AD realms
Christoph Heiss [Fri, 12 Jan 2024 16:16:02 +0000 (17:16 +0100)]
api: access: add routes for managing AD realms

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
9 days agod/control: record proxmox-notify build dependency
Thomas Lamprecht [Wed, 24 Apr 2024 08:46:52 +0000 (10:46 +0200)]
d/control: record proxmox-notify build dependency

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 days agod/copyright: update years
Thomas Lamprecht [Tue, 23 Apr 2024 22:34:19 +0000 (00:34 +0200)]
d/copyright: update years

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agobump version to 3.2.0-1
Thomas Lamprecht [Tue, 23 Apr 2024 21:47:23 +0000 (23:47 +0200)]
bump version to 3.2.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoapi: notification: also list datastores if user has only Backup privs
Lukas Wagner [Tue, 23 Apr 2024 11:52:30 +0000 (13:52 +0200)]
api: notification: also list datastores if user has only Backup privs

Use the /admin/datatore API instead of /config/datastore to get a list
of all available datastores - this ensures that users can see
datastores even if they only have Datastore.Backup privs.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoui: notifications: pull in UX improvements for match rules creation
Lukas Wagner [Tue, 23 Apr 2024 11:52:29 +0000 (13:52 +0200)]
ui: notifications: pull in UX improvements for match rules creation

These changes have not been applied yet in widget toolkit, but
are very valuable for the initial integration in PBS.
We override modified components and replace them with the patched
variants.
The changes change the edit window such that known field names and
values are suggested in a combobox. Also, the 'exact' match mode
can now match multiple values.

This can and *should* be removed once the changes from [1] are
merged into the widget toolkit.

[1] https://lists.proxmox.com/pipermail/pve-devel/2024-April/063539.html

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoui: util: override default mail author for sendmail/smtp targets
Lukas Wagner [Tue, 23 Apr 2024 11:52:28 +0000 (13:52 +0200)]
ui: util: override default mail author for sendmail/smtp targets

Otherwise, 'Proxmox VE' is shown as the default author in the UI.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agodocs: add documentation for notification system
Lukas Wagner [Tue, 23 Apr 2024 11:52:27 +0000 (13:52 +0200)]
docs: add documentation for notification system

Mostly copied from PVE and adapted where it makes sense.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agodocgen: generate synopsis for notifications{-priv, }.cfg
Lukas Wagner [Tue, 23 Apr 2024 11:52:26 +0000 (13:52 +0200)]
docgen: generate synopsis for notifications{-priv, }.cfg

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoproxmox-backup-manager: add CLI for SMTP endpoints
Lukas Wagner [Tue, 23 Apr 2024 11:52:25 +0000 (13:52 +0200)]
proxmox-backup-manager: add CLI for SMTP endpoints

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoproxmox-backup-manager: add CLI for sendmail endpoints
Lukas Wagner [Tue, 23 Apr 2024 11:52:24 +0000 (13:52 +0200)]
proxmox-backup-manager: add CLI for sendmail endpoints

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoproxmox-backup-manager: add CLI for gotify endpoints
Lukas Wagner [Tue, 23 Apr 2024 11:52:23 +0000 (13:52 +0200)]
proxmox-backup-manager: add CLI for gotify endpoints

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoproxmox-backup-manager: add CLI for notification matchers
Lukas Wagner [Tue, 23 Apr 2024 11:52:22 +0000 (13:52 +0200)]
proxmox-backup-manager: add CLI for notification matchers

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoproxmox-backup-manager: add CLI for notification targets
Lukas Wagner [Tue, 23 Apr 2024 11:52:21 +0000 (13:52 +0200)]
proxmox-backup-manager: add CLI for notification targets

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoui: permissions paths: add /system/notifications to combobox
Lukas Wagner [Tue, 23 Apr 2024 11:52:20 +0000 (13:52 +0200)]
ui: permissions paths: add /system/notifications to combobox

The /system/notifications ACL path is used for configuring the
notification system.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoui: datastore edit: make new stores use notification system by default
Lukas Wagner [Tue, 23 Apr 2024 11:52:19 +0000 (13:52 +0200)]
ui: datastore edit: make new stores use notification system by default

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoui: utils: add overrides for known notification metadata fields/values
Lukas Wagner [Tue, 23 Apr 2024 11:52:18 +0000 (13:52 +0200)]
ui: utils: add overrides for known notification metadata fields/values

This mechanism allows having nice, translatable notification event
types and fields.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoui: datastore options: add 'notification-mode' parameter
Lukas Wagner [Tue, 23 Apr 2024 11:52:17 +0000 (13:52 +0200)]
ui: datastore options: add 'notification-mode' parameter

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoui: tape restore: add 'notification-mode' parameter
Lukas Wagner [Tue, 23 Apr 2024 11:52:16 +0000 (13:52 +0200)]
ui: tape restore: add 'notification-mode' parameter

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoui: tape backup: add selector for 'notification-mode'
Lukas Wagner [Tue, 23 Apr 2024 11:52:15 +0000 (13:52 +0200)]
ui: tape backup: add selector for 'notification-mode'

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoui: tape backup job: add selector for notification-mode
Lukas Wagner [Tue, 23 Apr 2024 11:52:14 +0000 (13:52 +0200)]
ui: tape backup job: add selector for notification-mode

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoui: add notification config panel
Lukas Wagner [Tue, 23 Apr 2024 11:52:13 +0000 (13:52 +0200)]
ui: add notification config panel

This commit adds the same notification configuration panel that we
already use in Proxmox VE.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoserver: notifications: send tape notifications via notification system
Lukas Wagner [Tue, 23 Apr 2024 11:52:12 +0000 (13:52 +0200)]
server: notifications: send tape notifications via notification system

If the `notification-mode` parameter is set to `legacy-sendmail`, then
we still use the new infrastructure, but don't consider the
notification config and use a hard-coded sendmail endpoint directly.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoserver: notifications: send acme notifications via notification system
Lukas Wagner [Tue, 23 Apr 2024 11:52:11 +0000 (13:52 +0200)]
server: notifications: send acme notifications via notification system

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoserver: notifications: send update notifications via notification system
Lukas Wagner [Tue, 23 Apr 2024 11:52:10 +0000 (13:52 +0200)]
server: notifications: send update notifications via notification system

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoserver: notifications: send sync notifications via notification system
Lukas Wagner [Tue, 23 Apr 2024 11:52:09 +0000 (13:52 +0200)]
server: notifications: send sync notifications via notification system

If the `notification-mode` parameter is set to `legacy-sendmail`, then
we still use the new infrastructure, but don't consider the
notification config and use a hard-coded sendmail endpoint directly.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoserver: notifications: send verify notifications via notification system
Lukas Wagner [Tue, 23 Apr 2024 11:52:08 +0000 (13:52 +0200)]
server: notifications: send verify notifications via notification system

If the `notification-mode` parameter is set to `legacy-sendmail`, then
we still use the new infrastructure, but don't consider the
notification config and use a hard-coded sendmail endpoint directly.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoserver: notifications: send prune notifications via notification system
Lukas Wagner [Tue, 23 Apr 2024 11:52:07 +0000 (13:52 +0200)]
server: notifications: send prune notifications via notification system

If the `notification-mode` parameter is set to `legacy-sendmail`, then
we still use the new infrastructure, but don't consider the
notification config and use a hard-coded sendmail endpoint directly.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoserver: notifications: send GC notifications via notification system
Lukas Wagner [Tue, 23 Apr 2024 11:52:06 +0000 (13:52 +0200)]
server: notifications: send GC notifications via notification system

If the `notification-mode` parameter is set to `legacy-sendmail`, then
we still use the new infrastructure, but don't consider the
notification config and use a hard-coded sendmail endpoint directly.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoapi-types: api: tape: add notification-mode parameter
Lukas Wagner [Tue, 23 Apr 2024 11:52:05 +0000 (13:52 +0200)]
api-types: api: tape: add notification-mode parameter

Same as with datastores, this option determines whether we send
notifications the old way (send email via sendmail to a user's email
address) or the new way (emit matchable notification events to the
notification stack).

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoapi-types: api: datatore: add notification-mode parameter
Lukas Wagner [Tue, 23 Apr 2024 11:52:04 +0000 (13:52 +0200)]
api-types: api: datatore: add notification-mode parameter

This one lets the user choose between the old notification behavior
(selecting an email address/user and always/error/never behavior per
datastore) and the new one (emit notification events to the
notification system)

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoapi: add endpoints for querying known notification values/fields
Lukas Wagner [Tue, 23 Apr 2024 11:52:03 +0000 (13:52 +0200)]
api: add endpoints for querying known notification values/fields

These endpoints require Sys.Audit/Sys.Modify permissions on
/system/notifications.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoapi: add endpoints for gotify targets
Lukas Wagner [Tue, 23 Apr 2024 11:52:02 +0000 (13:52 +0200)]
api: add endpoints for gotify targets

These endpoints require Sys.Audit/Sys.Modify permissions on
/system/notifications.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoapi: add endpoints for smtp targets
Lukas Wagner [Tue, 23 Apr 2024 11:52:01 +0000 (13:52 +0200)]
api: add endpoints for smtp targets

These endpoints require Sys.Audit/Sys.Modify permissions on
/system/notifications.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoapi: add endpoints for sendmail targets
Lukas Wagner [Tue, 23 Apr 2024 11:52:00 +0000 (13:52 +0200)]
api: add endpoints for sendmail targets

These endpoints require Sys.Audit/Sys.Modify permissions on
/system/notifications.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoapi: add endpoints for notification matchers
Lukas Wagner [Tue, 23 Apr 2024 11:51:59 +0000 (13:51 +0200)]
api: add endpoints for notification matchers

These endpoints require Sys.Audit/Sys.Modify permissions on
/system/notifications.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoapi: add endpoints for querying/testing notification targets
Lukas Wagner [Tue, 23 Apr 2024 11:51:58 +0000 (13:51 +0200)]
api: add endpoints for querying/testing notification targets

These endpoints require Sys.Audit permissions on
/system/notifications.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agopbs-config: acl: add /system/notifications as known ACL path
Lukas Wagner [Tue, 23 Apr 2024 11:51:57 +0000 (13:51 +0200)]
pbs-config: acl: add /system/notifications as known ACL path

This one will be used for configuring the new notification stack.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agobuildsys: install templates for test notifications
Lukas Wagner [Tue, 23 Apr 2024 11:51:56 +0000 (13:51 +0200)]
buildsys: install templates for test notifications

The notification stack loads handlebar templates for notifications
from /usr/share/proxmox-backup-server/templates/default/. This commit
modifies the build system to install template files from the
'templates' directory at that location. First, we only have templates
for test notifications.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agonotifications: allow sending notifications via proxmox_notify
Lukas Wagner [Tue, 23 Apr 2024 11:51:55 +0000 (13:51 +0200)]
notifications: allow sending notifications via proxmox_notify

  - Set the context in proxmox_notify
  - Add helper function which queues notifications to a spool
    directory
  - Set up a worker task, running in the privileged process, which
    periodically checks the spool directory for queued notifications

The queuing is needed because on PBS we send most if not all
notifications from the proxy-process running as the `backup` user.
However, to have access to the protected passwords/tokens for various
notification endpoints, we need to read the notification config as
root.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agoserver: rename email_notifications module to notifications
Lukas Wagner [Tue, 23 Apr 2024 11:51:54 +0000 (13:51 +0200)]
server: rename email_notifications module to notifications

The module will be extended to interact with the proxmox_notify crate,
hence the name change seems to be in order.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agopbs-config: add module for loading notification config
Lukas Wagner [Tue, 23 Apr 2024 11:51:53 +0000 (13:51 +0200)]
pbs-config: add module for loading notification config

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 days agofix #5251: login: set autocomplete on password and user
Maximiliano Sandoval [Mon, 19 Feb 2024 10:37:05 +0000 (11:37 +0100)]
fix #5251: login: set autocomplete on password and user

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
11 days agoGC status: reduce code duplication
Fabian Grünbichler [Mon, 22 Apr 2024 11:21:42 +0000 (13:21 +0200)]
GC status: reduce code duplication

the schedule handling is the same whether there was a last run or not, so let's
do it once and not twice. the duration can be stored right away, instead of
using an intermediate variable.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
11 days agoui: don't re-calculate GC duration
Fabian Grünbichler [Mon, 22 Apr 2024 09:44:49 +0000 (11:44 +0200)]
ui: don't re-calculate GC duration

it is returned by the API anyway

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
11 days agoapi: merge garbage-collection-status and -job-status
Fabian Grünbichler [Mon, 22 Apr 2024 09:43:51 +0000 (11:43 +0200)]
api: merge garbage-collection-status and -job-status

the latter was newly introduced, and they both return basically the same
information now. the new extended (job) status struct is a strict superset of
the old status struct, so this is not a breaking change API wise.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
11 days agoGC: flatten existing status into job status
Fabian Grünbichler [Mon, 22 Apr 2024 09:02:57 +0000 (11:02 +0200)]
GC: flatten existing status into job status

to avoid drifting definitions and reduce duplication. with the next major
release, the 'upid' field could then be renamed and aliased to be in line with
the other jobs, which all use 'last-run-upid'. doing it now would break
existing callers of the GC status endpoint (or consumers of the on-disk status
file).

the main difference is that the GC status fields are now not optional (except
for the UPID) in the job status, since flattening an optional value is not
possible. this only affects datastores that were never GCed at all, and only
direct API consumers, since the UI handles those fields correctly.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
11 days agoui: gc view: remove unnecessary widths in columns
Dominik Csapak [Mon, 22 Apr 2024 11:05:05 +0000 (13:05 +0200)]
ui: gc view: remove unnecessary widths in columns

setting `width` and `flex` in a column simultaneously won't work, and
the `flex` value takes priority. So remove the unused `width`
properties.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
11 days agoui: prune/gc view: improve sizing & scrolling behaviour
Dominik Csapak [Mon, 22 Apr 2024 11:05:04 +0000 (13:05 +0200)]
ui: prune/gc view: improve sizing & scrolling behaviour

before, this was only used where the top list was a fixed size and only
for one datastore (which limits the number of prune jobs a bit)

since now we show gc jobs for all datastores here too and all their
prune jobs, this panel can get much bigger.

To improve it's scrolling sizing behavior, make the prune jobs panel
`flex: 1`, so it fills out the rest of the view, and add a splitter
between them so one can resize them on the fly. To prevent making one of
the panels too small, set an appropriate minHeight for both and make the
surrounding panel scrollable.

To not save the height into it's state, we have to filter that out for
the GCView.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
11 days agoui: gc view: use beforedestroy for stopping the store
Dominik Csapak [Mon, 22 Apr 2024 11:05:03 +0000 (13:05 +0200)]
ui: gc view: use beforedestroy for stopping the store

because during destroy, the controller (and the relevant function) might
not be there anymore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
11 days agoproxmox-backup-mgr: gc jobs: pretty-print bytes/duration/timestamps
Lukas Wagner [Thu, 18 Apr 2024 10:17:06 +0000 (12:17 +0200)]
proxmox-backup-mgr: gc jobs: pretty-print bytes/duration/timestamps

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
11 days agoui: gcview: fix eslint warnings
Lukas Wagner [Thu, 18 Apr 2024 10:17:05 +0000 (12:17 +0200)]
ui: gcview: fix eslint warnings

The ternary ? operator should be at the start of the line if the
the expression is split into multiple lines.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
11 days agoui: configure width and flex on GC Jobs columns
Stefan Lendl [Thu, 18 Apr 2024 10:17:04 +0000 (12:17 +0200)]
ui: configure width and flex on GC Jobs columns

table expands to the full width and relevant data is still visible on a
narrow screen.

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewd-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
11 days agoui: show removed and pending data of last run in bytes
Stefan Lendl [Thu, 18 Apr 2024 10:17:03 +0000 (12:17 +0200)]
ui: show removed and pending data of last run in bytes

Show the removed and pending data of the last run formatted with
Proxmox.Utils.format_size for better readability identically to data
display in the overview tab.

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewd-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Suggested-by: Lukas Wagner <l.wagner@proxmox.com>
11 days agofix #4723: cli: list gc jobs with proxmox-backup-manager
Stefan Lendl [Thu, 18 Apr 2024 10:17:02 +0000 (12:17 +0200)]
fix #4723: cli: list gc jobs with proxmox-backup-manager

proxmox-backup-manager garbage-collection list
  to list the garbage collection job status for all datastores,
  including datastores without gc jobs.

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
  [LW: add ref to bugzilla issue to commit message]
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewd-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
11 days agoui: order Prune & GC before Sync Jobs
Stefan Lendl [Thu, 18 Apr 2024 10:17:01 +0000 (12:17 +0200)]
ui: order Prune & GC before Sync Jobs

Make the order identical to local datastore view.

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewd-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
11 days agoui: hide datastore column in local gc view
Stefan Lendl [Thu, 18 Apr 2024 10:17:00 +0000 (12:17 +0200)]
ui: hide datastore column in local gc view

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewd-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
11 days agoui: move prune and gc widget to config
Stefan Lendl [Thu, 18 Apr 2024 10:16:59 +0000 (12:16 +0200)]
ui: move prune and gc widget to config

* move datastore/PruneAndGC to config/PruneAndGC
* renaming the widgets to PBS.config.PruneAndGC

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewd-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
11 days agofix #3217: ui: global prune and gc job view
Stefan Lendl [Thu, 18 Apr 2024 10:16:58 +0000 (12:16 +0200)]
fix #3217: ui: global prune and gc job view

In the global datastore view, extend the prune view to display gc job
status as a table.  Use the same widget in the local view and dispaly gc
job status as a single row.

The local PruneAndGC view is parameterized (cbind) with the datastore.
At initialization the only row is selected.  This allows the rest of the
grid to act on selected rows and it requires far less special casing if
the datastore is set on the view or not.

Having a single row always selected and therefore highlighted, is
visually not appealing.  Therefore, highlighting of selected rows is
disabled in the local view.

Moved GCView to different file and enhanced it with last, next run,
status and duration. Added button to show task log.

Changed `render_task_status()` to also take in account upids stored in
other 'columns'.

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
  [LW: include ref to bugzilla in commit message]
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Originally-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewd-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
11 days agoapi: garbage collect job status
Stefan Lendl [Thu, 18 Apr 2024 10:16:57 +0000 (12:16 +0200)]
api: garbage collect job status

Adds an api endpoint on the datastore that reports the gc job status
such as:
 - Schedule
 - State (of last run)
 - Duration (of last run)
 - Last Run
 - Next Run (if scheduled)
 - Pending Chunks (of last run)
 - Pending Bytes (of last run)
 - Removed Chunks (of last run)
 - Removed Bytes (of last run)

Adds a dedicated endpoint admin/gc that reports gc job status for all
datastores including the onces without a gc-schedule.

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Originally-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewd-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
11 days agoui: fix layout reset
Dominik Csapak [Mon, 22 Apr 2024 11:06:16 +0000 (13:06 +0200)]
ui: fix layout reset

we have to iterate over the keys of the state object here, not over the
values. This meant one could not reset the layout from the settings
window.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
11 days agoapi: assert that maintenance mode transitions are valid
Dietmar Maurer [Mon, 22 Apr 2024 08:31:30 +0000 (10:31 +0200)]
api: assert that maintenance mode transitions are valid

Maintenance mode Delete locks the datastore. It must not be possible to go
back to normal modes, because the datastore may be in undefined state.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
11 days agomaintenance: derive Copy for maintenance type and make maintenance mode fields public
Dietmar Maurer [Mon, 22 Apr 2024 08:31:29 +0000 (10:31 +0200)]
maintenance: derive Copy for maintenance type and make maintenance mode fields public

Because it is a public api type.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
11 days agopbs-api-types: use SchemaDeserializer for maintenance mode
Dietmar Maurer [Mon, 22 Apr 2024 08:31:28 +0000 (10:31 +0200)]
pbs-api-types: use SchemaDeserializer for maintenance mode

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
12 days agoclient: backup writer: fix minor formatting issue
Christian Ebner [Fri, 19 Apr 2024 09:37:33 +0000 (11:37 +0200)]
client: backup writer: fix minor formatting issue

no functional changes

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
12 days agoclient: fix whitespace issue
Christian Ebner [Fri, 19 Apr 2024 09:37:32 +0000 (11:37 +0200)]
client: fix whitespace issue

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2 weeks agoui: sync view: increase default width of 'Max. Depth' column
Lukas Wagner [Thu, 18 Apr 2024 12:01:18 +0000 (14:01 +0200)]
ui: sync view: increase default width of 'Max. Depth' column

Before, the column was so small that it was practically invisible.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2 weeks agoui: sync view: add 'max-depth' to model
Lukas Wagner [Thu, 18 Apr 2024 12:01:17 +0000 (14:01 +0200)]
ui: sync view: add 'max-depth' to model

Otherwise, the sync job overview does no refresh if 'max-depth' is
changed in the edit window.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2 weeks agoui: sync view: rename column 'Max. Recursion' -> 'Max. Depth'
Lukas Wagner [Thu, 18 Apr 2024 12:01:16 +0000 (14:01 +0200)]
ui: sync view: rename column 'Max. Recursion' -> 'Max. Depth'

In the edit dialog we already use 'Max. Depth', so it makes sense
to use the same term in the overview.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2 weeks agodocs: add missing html_css_files entry
Hannes Duerr [Fri, 29 Mar 2024 15:07:37 +0000 (16:07 +0100)]
docs: add missing html_css_files entry

Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
2 weeks agodocs: move custom.js and custom.css into _static folder
Hannes Duerr [Fri, 29 Mar 2024 15:07:36 +0000 (16:07 +0100)]
docs: move custom.js and custom.css into _static folder

The sphinx documentation [0] describes the _static folder as the
location for the custom.js and custom.css so we move the files there, as
we do not need those files outside the directory.
This also removes the error message when building:
WARNING: html_static_path entry '_static' does not exist

[0] https://www.sphinx-doc.org/en/master/development/theming.html#add-your-own-static-files-to-the-build-assets

Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
3 weeks agopbs-client: fixed typo in error message
Gabriel Goller [Wed, 10 Apr 2024 12:54:56 +0000 (14:54 +0200)]
pbs-client: fixed typo in error message

Fixed error message on the client: 'dynmamic' -> 'dynamic'.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
3 weeks agoapi: make prune-group a real workertask
Gabriel Goller [Fri, 8 Mar 2024 13:36:22 +0000 (14:36 +0100)]
api: make prune-group a real workertask

`prune-group` is currently not a real workertask, ie it behaves like one
but doesn't start a thread nor a task to do its work.

Changed it to start a tokio-task, so that we can delete snapshots
asynchronously. The `dry-run` feature still behaves in the same way and
returns early.

This paves the way for the new logging infra (which uses `task_local` to
define a logger) and improves performance of bigger backup-groups.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
3 weeks agoapi: datastore create: allow re-using existing dirs if empty & not a mountpoint
Markus Frank [Thu, 30 Nov 2023 10:37:24 +0000 (11:37 +0100)]
api: datastore create: allow re-using existing dirs if empty & not a mountpoint

When formatting and creating a filesystem on a disk it's important
that the target directory in `/mnt/datastore/<name>` either doesn't
exist yet, or is empty and not a mountpoint of an existing FS. As that
way we ensure that no data is lost, or gets hidden, on creating a new
datastore. Our current check was a bit stricter than required, it
always bailed if the target directory existed, even if it was a plain
& empty directory on the root file-system.

So adapt the check and also check whether an existing target directory
is empty and not already mounted, as then it can be used just fine.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Tested-by: Christian Ebner <c.ebner@proxmox.com>
 [ TL: reword subject and commit message to include more details ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agoclient: backup: early check for fixed index type
Christian Ebner [Thu, 28 Mar 2024 12:36:27 +0000 (13:36 +0100)]
client: backup: early check for fixed index type

Early return when the check fails, avoiding constuction of unused
object instances.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 weeks agoclient: backup writer: only borrow http client
Christian Ebner [Thu, 28 Mar 2024 12:36:25 +0000 (13:36 +0100)]
client: backup writer: only borrow http client

Instead of taking ownership of the http client when starting a new
BackupWriter instance, only borrow the client.

This allows to reuse the http client to later reuse it to start also a
BackupReader instance as required for backup runs with metadata based
file change detection mode, where both must use the same http client.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
5 weeks agofix #5248: client: allow self-signed/untrusted certificate chains
Fabian Grünbichler [Tue, 26 Mar 2024 08:15:03 +0000 (09:15 +0100)]
fix #5248: client: allow self-signed/untrusted certificate chains

instead of rejecting any non-leaf certificate not pre-validated by OpenSSL,
treat them as valid but keep track of the fact that the pre-validation result
is no logner trustable.

certificate chains completely trusted by openssl are still accepted like
before, and leaf certificates without a chain are also handled the same (since
the verify callback is only ever called with depth == 0 in that case).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>