]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
5 weeks agodocs: document notification-mode and merge old notification section
Lukas Wagner [Fri, 26 Apr 2024 11:23:33 +0000 (13:23 +0200)]
docs: document notification-mode and merge old notification section

This new section describes how the notification-mode parameter works.
The section also contains also parts of the old notification section
from the maintenance chapter, reusing the description of the
`notify` and `notify-user` parameters.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
5 weeks agonotifications: fix legacy sync notifications
Gabriel Goller [Wed, 15 May 2024 09:58:45 +0000 (11:58 +0200)]
notifications: fix legacy sync notifications

When using the legacy notifications the sync mode would pick up the
settings from the prune-job, which default to Error. This completely
disables notifications for successful sync-jobs when using the legacy
system.

Reported in the forum: https://forum.proxmox.com/threads/147018/

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
5 weeks agobump d/control
Wolfgang Bumiller [Wed, 22 May 2024 14:05:53 +0000 (16:05 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 weeks agobump proxmox-auth-api to 0.4
Wolfgang Bumiller [Wed, 22 May 2024 14:05:49 +0000 (16:05 +0200)]
bump proxmox-auth-api to 0.4

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 weeks agoauth: use auth-api when generating keys and generate ec keys
Stefan Sterz [Wed, 6 Mar 2024 12:36:09 +0000 (13:36 +0100)]
auth: use auth-api when generating keys and generate ec keys

this commit switches pbs over to generating ed25519 keys when
generating new auth api keys. this also removes the last direct
usages of openssl here and further unifies key handling in the auth
api.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
5 weeks agoauth: move to auth-api's private and public keys when loading keys
Stefan Sterz [Wed, 6 Mar 2024 12:36:08 +0000 (13:36 +0100)]
auth: move to auth-api's private and public keys when loading keys

this commit moves away from using openssl's `PKey` and uses the
wrappers from proxmox-auth-api. this allows us to handle keys in a
more flexible way and enables as to move to ec based crypto for the
authkey in the future.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
5 weeks agoauth: upgrade hashes on user log in
Stefan Sterz [Wed, 6 Mar 2024 12:36:07 +0000 (13:36 +0100)]
auth: upgrade hashes on user log in

if a users password is not hashed with the latest password hashing
function, re-hash the password with the newest hashing function. we
can only do this on login and after the password has been validated,
as this is the only point at which we have access to the plain text
password and also know that it matched the original password.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
5 weeks agoauth: move to hmac keys for csrf tokens
Stefan Sterz [Wed, 6 Mar 2024 12:36:06 +0000 (13:36 +0100)]
auth: move to hmac keys for csrf tokens

previously we used a self-rolled implementation for csrf tokens. while
it's unlikely to cause issues in reality, as csrf tokens are only
valid for a given tickets lifetime, there are still theoretical
attacks on our implementation. so move all of this code into the
proxmox-auth-api crate and use hmac instead.

this change should not impact existing installations for now, as this
falls back to the old implementation if a key is already present. hmac
keys will only be used for new installations and if users manually
remove the old key and

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
5 weeks agoui: garbage-collection: use different state-id for global and per-datastore view
Thomas Lamprecht [Tue, 21 May 2024 09:30:07 +0000 (11:30 +0200)]
ui: garbage-collection: use different state-id for global and per-datastore view

For one these different views have different columns shown, and more
importantly: with the state being shared one could change sorting in
the global view and then have that applied in the per-datastore view
too, even if one cannot sort that view explicitly otherwise as there's
just one row anyway. This small glitch might lead to a bit of
confusion in the worst case and looks unpolished in any way.

Note that I explicitly decided against encoding the datastore in the
state-id for the per-datastore views for now, as most users will want
to adapt layout (like column width) for all per-datastores views.

Having to re-do that for every datastore separately can be quite a
nuisance while the same user wanting different layout for each
datastore in their per-datastore view seems rather to be an edge case.
And we can always change this, so starting out with the slightly more
restricted design that has less browser local data to be saved seems
better w.r.t. maintainability.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 weeks agofix #5422: ui: garbage-collection: make columns in global view sortable
Gabriel Goller [Thu, 16 May 2024 09:18:41 +0000 (11:18 +0200)]
fix #5422: ui: garbage-collection: make columns in global view sortable

Make columns sortable in the global 'Prune & GC Jobs' view. In the
per-datastore view the columns will not be sortable as there can only be
one job.

Fixes: db3fd213 ("fix #3217: ui: global prune and gc job view")
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
5 weeks agorestore daemon: search disk also with truncated serial
Dominik Csapak [Wed, 15 May 2024 09:55:13 +0000 (11:55 +0200)]
restore daemon: search disk also with truncated serial

the disk serial given to virtio disks only can be 20 characters, so
looking for a disk with a longer serial will always fail (like
'drive-tpmstate0-backup'). If the serial is longer, also try with the
truncated one. Leave the first try in place in case the limit changes.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 weeks agorestore daemon: log some errors for dir traversal
Dominik Csapak [Wed, 15 May 2024 09:55:12 +0000 (11:55 +0200)]
restore daemon: log some errors for dir traversal

in case we cannot stat a file in the restore vm, log the path and reason
why. This should normally not happen, but when it does, the path and
error might help us find the issue.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 weeks agofix #5465: restore daemon: mount ntfs with utf8 charset
Dominik Csapak [Wed, 15 May 2024 09:55:11 +0000 (11:55 +0200)]
fix #5465: restore daemon: mount ntfs with utf8 charset

since the change in our restore image to ntfs3, non iso8859-1 filenames
were broken. Fix that by adding the 'iocharset' option to ntfs3.

Leave the ntfs option in place, so that if the image gets booted
with an older kernel for some reason, this still works.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 weeks agoui: update online help info
Thomas Lamprecht [Wed, 15 May 2024 12:14:51 +0000 (14:14 +0200)]
ui: update online help info

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 weeks agoapi: syslog: fix api macro to return array instead of object.
Dietmar Maurer [Wed, 15 May 2024 10:17:03 +0000 (12:17 +0200)]
api: syslog: fix api macro to return array instead of object.

The implementation already returns Vec, so this change is to generate
correct api documentation.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
6 weeks agotape: write informational MAM attributes on tapes
Dominik Csapak [Tue, 14 May 2024 14:12:48 +0000 (16:12 +0200)]
tape: write informational MAM attributes on tapes

namely:

Vendor: Proxmox
Name: Backup Server
Version: current running package version
User Label Text: the label text
Media Pool: the current media pool

write it on labeling and when writing a new media-set to a tape.

While we currently don't use this info for anything, this can help users
to identify tapes, even with different backup software.

If we need it in the future, we can e.g. make decisions based on these
fields (e.g. the version).

On format, delete them again.

Note that some VTLs don't correctly delete the attributes from the
virtual tapes.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 weeks agotape: correct mam format for some attributes
Dominik Csapak [Tue, 14 May 2024 14:12:47 +0000 (16:12 +0200)]
tape: correct mam format for some attributes

Some MAM attributes are of type 'TEXT' that is not only ascii, but
controlled by an addition field that specifies various 8bit text
formats.

For now, simply assume utf8 as the default is ascii, and we don't expect
any data that is not ASCII anyway.

This will be needed when we'll want to write those attributes.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 weeks agotape: include drive activity in status
Dominik Csapak [Mon, 13 May 2024 10:49:26 +0000 (12:49 +0200)]
tape: include drive activity in status

Since we don't query each drives status seperately, but rely on a single
call to the drives listing parameter for that, we now add the option
to query the activity there too. This makes that data avaiable for us
to show in a seperate (by default hidden) column.

Also we show the activity in the 'State' column when the drive is idle
from our perspective. This is useful when e.g. an LTO-9 tape is loaded
the first time and is calibrating, since that happens automatically.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 weeks agotape: drive status: make some depend on the activity
Dominik Csapak [Mon, 13 May 2024 10:49:25 +0000 (12:49 +0200)]
tape: drive status: make some depend on the activity

when the tape drive has an activity (and the tape is in motion), certain
calls block until the operation is finished. Since we cannot predict how
long it's going to be and it can be quite long in certain cases,
skip those calls when the drive is doing anything.

If we cannot determine the activity, try to do the queries.

We have to extend the check for a loaded drive in the UI, since the
position is not available during any activity.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 weeks agotape: add drive activity to drive status api
Dominik Csapak [Mon, 13 May 2024 10:49:24 +0000 (12:49 +0200)]
tape: add drive activity to drive status api

and show it in the gui for single drives. Adds the known values for the
activity to the UI.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 weeks agotape: add functions to parse drive device activity
Dominik Csapak [Mon, 13 May 2024 10:49:23 +0000 (12:49 +0200)]
tape: add functions to parse drive device activity

we use the VHF part from the DT Device Activity page for that.
This is intended to query the drive for it's current state and activity.

Currently only the activity is parsed and used.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 weeks agotape: save 'bytes used' in tape inventory
Dominik Csapak [Mon, 13 May 2024 10:46:09 +0000 (12:46 +0200)]
tape: save 'bytes used' in tape inventory

and show them on the ui. This can help uses with seeing how much a tape
is used.

The value is updated on 'commit' and when the tape is changed during a
backup.

For drives not supporting the volume statistics, this is simply skipped.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 weeks agotape: cleanup: rename bytes_written to bytes_written_after_sync
Dietmar Maurer [Wed, 8 May 2024 07:16:57 +0000 (09:16 +0200)]
tape: cleanup: rename bytes_written to bytes_written_after_sync

7 weeks agoexamples: add tape write benchmark
Dominik Csapak [Tue, 7 May 2024 13:45:53 +0000 (15:45 +0200)]
examples: add tape write benchmark

A small example that simply writes pseudo-random chunks to a drive.
This is useful to benchmark throughput on tape drives.

The output and behavior is similar to what the pool writer does, but
without writing multiple files, committing or loading data from disk.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 weeks agotape: improve throughput by not unnecessarily syncing/committing
Dominik Csapak [Tue, 7 May 2024 13:45:52 +0000 (15:45 +0200)]
tape: improve throughput by not unnecessarily syncing/committing

When writing data on tape, the idea was to sync/committing to tape and
the catalog to disk every 128GiB of data. For that the counter
'bytes_written' was introduced and checked after every chunk/snapshot
archive.

Sadly we forgot to reset the counter after doing so, which meant that
after 128GiB was written onto the tape, we synced/committed after every
archive on the tape for the remaining length of the tape.

Since syncing to tape and writing to disk takes a bit of time, the drive
had to slow down every time and reduced the available throughput. (In
our tests here from ~300MB/s to ~255MB/s).

By resetting the value to zero after syncing, we avoid that and increase
throughput performance when backups are bigger than 128GiB on tape.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 weeks agoapi: delay datastore lookup after permission check
Dietmar Maurer [Thu, 25 Apr 2024 09:31:47 +0000 (11:31 +0200)]
api: delay datastore lookup after permission check

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agoupdate proxmox-metrics dependency to 0.3.1
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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>