]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
20 months agoui: dark mode: add dark mode colors to the datastore usage charts
Dominik Csapak [Tue, 28 Mar 2023 13:11:48 +0000 (15:11 +0200)]
ui: dark mode: add dark mode colors to the datastore usage charts

For the `Datastore -> Summary` overview for all configured datastores.

Fix is adapted from the PVE's ceph's status details or performance
runningCharts, which are both similar (but not really the same)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ T: expand commit message to note that this is adapted from PVE ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agodocs: exand PBS to Proxmox Backup (Server)
Fabian Grünbichler [Tue, 28 Mar 2023 12:12:25 +0000 (14:12 +0200)]
docs: exand PBS to Proxmox Backup (Server)

where applicable.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 months agod/rules: version check: exit early and fine-tune error message
Thomas Lamprecht [Tue, 28 Mar 2023 11:54:44 +0000 (13:54 +0200)]
d/rules: version check: exit early and fine-tune error message

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agofix #4521: api/tasks: replace upid as filename for task log downloads
Stefan Sterz [Thu, 9 Feb 2023 11:41:39 +0000 (12:41 +0100)]
fix #4521: api/tasks: replace upid as filename for task log downloads

previously the upid would just be used without a file extension when
downloading a task log. this lead to rather strange filenames that
appeared unfamiliar to users as the upid is not very prevalent in the
gui. set a proper file name based on the node name, worker type and a
time stamp instead. also add the ".log" file extension to indicate
that these files contain logs.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
20 months agod/rules: verify version between Cargo.toml and debian/changelog
Wolfgang Bumiller [Tue, 28 Mar 2023 07:41:35 +0000 (09:41 +0200)]
d/rules: verify version between Cargo.toml and debian/changelog

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agod/copyright: update years
Thomas Lamprecht [Mon, 27 Mar 2023 18:09:22 +0000 (20:09 +0200)]
d/copyright: update years

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agobump version to 2.4.0-2
Thomas Lamprecht [Mon, 27 Mar 2023 17:34:53 +0000 (19:34 +0200)]
bump version to 2.4.0-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agodocs: implement auto dark mode
Dominik Csapak [Fri, 24 Mar 2023 15:53:21 +0000 (16:53 +0100)]
docs: implement auto dark mode

the colors are inspired/copied from the pmg/pve docs dark mode, but
i tried to apply them such that theme is faithful to the original
docs style regarding contrast etc.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
20 months agodrop exclusive lock for verify-after-complete
Fabian Grünbichler [Mon, 27 Feb 2023 09:50:12 +0000 (10:50 +0100)]
drop exclusive lock for verify-after-complete

the backup is finished at that point, the only lock clash that is possible when
dropping the exclusive and attempting to obtain a shared lock would be

- the snapshot is pruned/removed
- the backup is in a pre-upgrade process, and the post-upgrade process opens a reader

the first case is OK, if the other invocation wins the race and removes the
snapshot verification is pointless anyway.

the second case means the snapshot is not verified directly after completion
(this fact would be logged in the backup task log), but usable immediately for
pulling/restoring/..

this should decrease the chances of triggering the issues described in #4523

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 months agocargo fmt
Wolfgang Bumiller [Mon, 27 Mar 2023 13:03:02 +0000 (15:03 +0200)]
cargo fmt

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agoreport: add `date -R` to general system info section
Lukas Wagner [Thu, 23 Feb 2023 15:51:11 +0000 (16:51 +0100)]
report: add `date -R` to general system info section

Sometimes it can be quite useful to know when exactly a system report
was generated. Adds the following output:

 # date -R
 Thu, 23 Feb 2023 16:21:12 +0100

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
20 months agomanager: use view_task_result function for realm sync
Lukas Wagner [Mon, 13 Feb 2023 14:29:31 +0000 (15:29 +0100)]
manager: use view_task_result function for realm sync

Previously, the same approach as in `proxmox-backup-debug` was used.
With the changes from this commit, realm syncing uses the same method for
waiting for task output as other parts of `proxmox-backup-manager`.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
20 months agodocs: ldap: break long lines/remove trailing whitespace
Lukas Wagner [Mon, 13 Feb 2023 14:24:21 +0000 (15:24 +0100)]
docs: ldap: break long lines/remove trailing whitespace

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
20 months agodocs: reword WORM tape documentation
Aaron Lauterer [Thu, 2 Mar 2023 11:18:03 +0000 (12:18 +0100)]
docs: reword WORM tape documentation

Mainly splitting long sentences into smaller ones. Some rewording
happened in the process.

The changes should still transport the same information.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
20 months agorealm sync: replace formatted .context() calls
Wolfgang Bumiller [Mon, 27 Mar 2023 09:51:17 +0000 (11:51 +0200)]
realm sync: replace formatted .context() calls

with .map_err/.ok_or_else - since the formatting should not
happen in the non-error case

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agorealm sync: replace and_then chain with '?' in lookup closure
Wolfgang Bumiller [Mon, 27 Mar 2023 09:46:02 +0000 (11:46 +0200)]
realm sync: replace and_then chain with '?' in lookup closure

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agorealm sync: take schema per reference
Wolfgang Bumiller [Mon, 27 Mar 2023 09:43:50 +0000 (11:43 +0200)]
realm sync: take schema per reference

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agorealm sync: show warnings if attributes do not meet their constraints
Lukas Wagner [Mon, 13 Feb 2023 14:31:04 +0000 (15:31 +0100)]
realm sync: show warnings if attributes do not meet their constraints

Previously, if the value of a synced property did not validate properly
(e.g only 1 character in length instead of the required 2), the whole
sync job failed without any useful error message.

In this commit, the values are validated manually by their
respective StringSchema. If the validation fails, the value is
ignored and a warning is displayed in the task log.

In addition to that, some error messages have been improved.
Also, user sync is now more fault-tolerant in general, showing
warnings if something goes wrong while creating/updating a
single user, instead of aborting the whole sync job.

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
20 months agopxar creation: use log crate for error reporting
Fabian Grünbichler [Wed, 8 Mar 2023 10:57:48 +0000 (11:57 +0100)]
pxar creation: use log crate for error reporting

gives a higher (runtime) control via PBS_LOG, so that users can decide
themselves which messages, sources and levels are interesting for a particular
use case.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 months agofix #4578: use log crate for pxar create logging
Fabian Grünbichler [Wed, 8 Mar 2023 10:57:47 +0000 (11:57 +0100)]
fix #4578: use log crate for pxar create logging

since proxmox-backup-client is used in cron jobs and similar automated
fashions, PBS_LOG= should control the output..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 months agoproxy: limit theme value in length and disallow '/'
Thomas Lamprecht [Tue, 14 Mar 2023 16:54:14 +0000 (17:54 +0100)]
proxy: limit theme value in length and disallow '/'

while with rust strings we cannot inject \0, it feels a bit safer to
enforce some basic restrictions, with length and not containing any
slash seems sensible enough.

Admins should not put sensible data as theme-XYZ.css files in
/usr/share (which is normally readable by all system users anyway)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agoproxy: switch to "auto" as the default theme
Stefan Sterz [Tue, 14 Mar 2023 14:02:00 +0000 (15:02 +0100)]
proxy: switch to "auto" as the default theme

use the "auto" theme per default. it uses a media query to detect the
users preferred theme.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
20 months agodocs: add dark mode support to the api viewer
Stefan Sterz [Wed, 8 Mar 2023 16:45:55 +0000 (17:45 +0100)]
docs: add dark mode support to the api viewer

adds dark mode support to the api viewer that is activated depending
on the users theme preference. similar to the main gui's "auto"
theme.

this requires a bump of the widget toolkit so the dark theme css file
is present

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
 [ T: fixup commit subject, got garbled on send ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agoui: remove white backgrounds from package versions and system report
Stefan Sterz [Wed, 8 Mar 2023 16:41:40 +0000 (17:41 +0100)]
ui: remove white backgrounds from package versions and system report

removes the style that gets added directly to the element of the
package versions and system report views. this makes them harder to
style through css as normal selectors cannot override the element's
style. since they behave properly without these styles anyway, remove
them.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
20 months agoproxy/ui: implement theme switcher
Stefan Sterz [Wed, 8 Mar 2023 16:41:39 +0000 (17:41 +0100)]
proxy/ui: implement theme switcher

adds a theme switcher to the ui and handles the necessary cookies in
the backend.

this requires a bump of the widget toolkit so the necessary widgets
are present.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
20 months agoserver: switch to inline template variables & small cleanups
Thomas Lamprecht [Thu, 9 Mar 2023 07:03:43 +0000 (08:03 +0100)]
server: switch to inline template variables & small cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agotypo fix
Wolfgang Bumiller [Tue, 7 Mar 2023 14:50:19 +0000 (15:50 +0100)]
typo fix

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agojobstate: fix wrong error message
Dominik Csapak [Tue, 7 Mar 2023 14:10:57 +0000 (15:10 +0100)]
jobstate: fix wrong error message

we try to create the job stat dir, not the rrdb one

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
20 months agouse new auth api crate
Wolfgang Bumiller [Wed, 1 Feb 2023 15:01:12 +0000 (16:01 +0100)]
use new auth api crate

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agobump d/control
Wolfgang Bumiller [Thu, 2 Mar 2023 15:47:25 +0000 (16:47 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agoadapt to rest-server 0.3 and http 0.8 changes
Wolfgang Bumiller [Wed, 25 Jan 2023 11:06:49 +0000 (12:06 +0100)]
adapt to rest-server 0.3 and http 0.8 changes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agouse proxmox-sortable-macro directly
Wolfgang Bumiller [Wed, 1 Mar 2023 12:44:44 +0000 (13:44 +0100)]
use proxmox-sortable-macro directly

instead of via proxmox-sys

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agoui: subscription: use downloadAsFile helper from widget-toolkit
Thomas Lamprecht [Thu, 2 Mar 2023 14:12:30 +0000 (15:12 +0100)]
ui: subscription: use downloadAsFile helper from widget-toolkit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agoui: subscription: code cleanups
Thomas Lamprecht [Thu, 2 Mar 2023 14:11:57 +0000 (15:11 +0100)]
ui: subscription: code cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agodocs: add WORM tape documentation
Dominik Csapak [Tue, 28 Feb 2023 13:17:22 +0000 (14:17 +0100)]
docs: add WORM tape documentation

a short section about how to use WORM tapes (since we currently don't
handle them differently than normal tapes)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
20 months agofix #4412: tape: initial WORM support
Dominik Csapak [Tue, 28 Feb 2023 13:17:21 +0000 (14:17 +0100)]
fix #4412: tape: initial WORM support

the only thing preventing us from using WORM tapes was that we relied
on being able to rewrite the media set label when first using a tape
that was pre-allocated in a media-pool.

so instead of needing to write a meida set label with a special uuid,
just save the pool in the media label itself. This has currently no
downsides, as we're not able to move tapes from one pool to another
anyway.

this makes some checks a bit trickier, as we now have to get the pool
out of the media set label and as a fallback look into the media label.

such new tapes can still be read and restored by older proxmox-bacukp-server
versions. The only thing missing is when a tape labeled with the new
format that has an assigned pool, that pool won't show up when the tape
is inventoried in an old version (but can still be used otherwise).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
20 months agotape: inventory: don't skip unassigned tapes completely
Dominik Csapak [Tue, 28 Feb 2023 13:17:20 +0000 (14:17 +0100)]
tape: inventory: don't skip unassigned tapes completely

since commit 139acf37 ("tape: inventory: skip unassigned tapes")
we skip unassigned tapes (special all-zero media-set uuid) when we look
for a catalog. We accidentally skipped storing it in the inventory
completely, which means we never inventoried completely empty tapes.

to fix that, simply move the check below the inserting in the inventory

Fixes: 139acf37 ("tape: inventory: skip unassigned tapes")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
21 months agobackup: fix indentation
Fabian Grünbichler [Fri, 24 Feb 2023 09:14:16 +0000 (10:14 +0100)]
backup: fix indentation

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
21 months agodocs: maintenance: fix-up some overlooked wording/formatting
Thomas Lamprecht [Fri, 17 Feb 2023 17:38:27 +0000 (18:38 +0100)]
docs: maintenance: fix-up some overlooked wording/formatting

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agodocs: maintenance: expand garbage collection section
Thomas Lamprecht [Fri, 17 Feb 2023 17:27:07 +0000 (18:27 +0100)]
docs: maintenance: expand garbage collection section

Add some more background info and also some about the inner workings.

Split manual vs. scheduled backups, as both can be set via CLI or
GUI.

Then add a hint about disabling GC by clearing the schedule,
partially related to bug #4534

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agofix #4534: add clear trigger for simpler clearing schedule
Thomas Lamprecht [Fri, 17 Feb 2023 11:27:04 +0000 (12:27 +0100)]
fix #4534: add clear trigger for simpler clearing schedule

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agobump d/control
Wolfgang Bumiller [Fri, 10 Feb 2023 13:20:55 +0000 (14:20 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
21 months agobuildsys: add domains.cfg.5 to install list
Wolfgang Bumiller [Fri, 10 Feb 2023 12:35:25 +0000 (13:35 +0100)]
buildsys: add domains.cfg.5 to install list

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
21 months agoauth: unify naming for all authenticator implementations
Lukas Wagner [Thu, 9 Feb 2023 13:31:24 +0000 (14:31 +0100)]
auth: unify naming for all authenticator implementations

This also removes the need for two clippy-allow directives.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
21 months agoauth: add dummy OpenIdAuthenticator struct
Lukas Wagner [Thu, 9 Feb 2023 13:31:23 +0000 (14:31 +0100)]
auth: add dummy OpenIdAuthenticator struct

When manually adding a user, `lookup_authenticator` is called
to verify whether a realm actually exists. Thus is is necessary
to have dummy implementation for the `ProxmoxAuthenticator` trait
for OpenID realms.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
21 months agodocs: add documentation for LDAP realms
Lukas Wagner [Thu, 9 Feb 2023 13:31:22 +0000 (14:31 +0100)]
docs: add documentation for LDAP realms

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
21 months agodocs: add configuration file reference for domains.cfg
Lukas Wagner [Thu, 9 Feb 2023 13:31:21 +0000 (14:31 +0100)]
docs: add configuration file reference for domains.cfg

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
21 months agomanager: add commands for managing LDAP realms
Lukas Wagner [Thu, 9 Feb 2023 13:31:20 +0000 (14:31 +0100)]
manager: add commands for managing LDAP realms

Adds commands for managing LDAP realms, including user sync, to
`proxmox-backup-manager`.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
21 months agoserver: add LDAP realm sync job
Lukas Wagner [Thu, 9 Feb 2023 13:31:19 +0000 (14:31 +0100)]
server: add LDAP realm sync job

This commit adds sync jobs for LDAP user sync. As of now, they
can only be started manually.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
21 months agoapi-types: add config options for LDAP user sync
Lukas Wagner [Thu, 9 Feb 2023 13:31:18 +0000 (14:31 +0100)]
api-types: add config options for LDAP user sync

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
21 months agoauth: add LDAP realm authenticator
Lukas Wagner [Thu, 9 Feb 2023 13:31:17 +0000 (14:31 +0100)]
auth: add LDAP realm authenticator

This commits also makes user authentication async, so that e.g. a not
responding LDAP server cannot block other logins.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
21 months agoapi: add routes for managing LDAP realms
Lukas Wagner [Thu, 9 Feb 2023 13:31:16 +0000 (14:31 +0100)]
api: add routes for managing LDAP realms

Note: bind-passwords set via the API  are not stored in `domains.cfg`,
but in a separate `ldap_passwords.json` file located in
`/etc/proxmox-backup/`.
Similar to the already existing `shadow.json`, the file is
stored with 0600 permissions and is owned by root.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
21 months agoapi-types: add LDAP configuration type
Lukas Wagner [Thu, 9 Feb 2023 13:31:15 +0000 (14:31 +0100)]
api-types: add LDAP configuration type

The properties are mainly based on the ones from PVE, except:
  * consistent use of kebab-cases
  * `mode` replaces deprecated `secure`

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
21 months agoui: add 'realm' field in user edit
Lukas Wagner [Thu, 9 Feb 2023 13:31:14 +0000 (14:31 +0100)]
ui: add 'realm' field in user edit

This allows specifying a user's realm when adding a new user.
For now, adding users to the PAM realm is explicitely disabled

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
21 months agopbs-config: add delete_authid to ACL-tree
Hannes Laimer [Thu, 9 Feb 2023 13:31:13 +0000 (14:31 +0100)]
pbs-config: add delete_authid to ACL-tree

... allows the deletion of an authid from the whole tree. Needed
for removing deleted users/tokens.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
21 months agodebug cli: use handle_worker in proxmox-rest-server
Lukas Wagner [Thu, 9 Feb 2023 13:31:12 +0000 (14:31 +0100)]
debug cli: use handle_worker in proxmox-rest-server

The function was moved to proxmox-rest-server to make it
usable in the proxmox-backup-manager cli binary.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
21 months agobump rest-server dependency to 0.2.2
Wolfgang Bumiller [Fri, 10 Feb 2023 09:46:44 +0000 (10:46 +0100)]
bump rest-server dependency to 0.2.2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
21 months agofix #4341: manager cli: add commands to run prune/sync/verify jobs
Friedrich Weber [Thu, 2 Feb 2023 16:00:14 +0000 (17:00 +0100)]
fix #4341: manager cli: add commands to run prune/sync/verify jobs

Running configured jobs was already possible using the Web UI, but not
using the CLI. To fix that, this commit adds the following commands to
`proxmox-backup-manager`:

* prune-job run <id>
* sync-job run <id>
* verify-job run <id>

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
21 months agoverify/protect: improve error on disappearing snapshots
Fabian Grünbichler [Thu, 2 Feb 2023 13:04:24 +0000 (14:04 +0100)]
verify/protect: improve error on disappearing snapshots

or clients passing in a non-existent snapshot.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
21 months agobackup/snapshot reader: improve error message for ENOENT
Fabian Grünbichler [Thu, 2 Feb 2023 13:04:23 +0000 (14:04 +0100)]
backup/snapshot reader: improve error message for ENOENT

instead of

 Error: unable to open snapshot directory "/full/path/to/snapshot" for locking - ENOENT: No such file or directory

this will now print

 Error: Snapshot vm/800/2023-01-16T12:28:11Z does not exist.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
21 months agobump version to 2.3.3-1
Thomas Lamprecht [Wed, 8 Feb 2023 13:36:40 +0000 (14:36 +0100)]
bump version to 2.3.3-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agomove metrics connection from pbs-config to proxy
Wolfgang Bumiller [Fri, 20 Jan 2023 09:59:55 +0000 (10:59 +0100)]
move metrics connection from pbs-config to proxy

it's the only user and pbs-config shouldn't depend on the metric client

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
22 months agoapi: serde-rename deleteable properties to kebab-case
Lukas Wagner [Thu, 19 Jan 2023 15:52:32 +0000 (16:52 +0100)]
api: serde-rename deleteable properties to kebab-case

In former commit, the enum members were renamed to be CamelCase, in
accordance with the usual Rust style guide. However, this broke the
GUI in some places due to failing JSON property deserialization.
To fix this, some serde(rename = "kebab-case") directives were added.

Some properties were also serde-renamed to snake_case, otherwise
it would have been necessary to also modify proxmox-widget-toolkit
as well as PVE source code. This can follow in a later commit if so
desired.

Fixes: a2055c38 fix non-camel-case enums
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
22 months agoapi: node tasks: small cleanups
Thomas Lamprecht [Thu, 19 Jan 2023 10:26:46 +0000 (11:26 +0100)]
api: node tasks: small cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agodatastore: rustfmt
Thomas Lamprecht [Thu, 19 Jan 2023 10:25:48 +0000 (11:25 +0100)]
datastore: rustfmt

Fixes: d2aff935 ("update to nix 0.26")
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agoclient: task log: use fstrings for shorter code
Thomas Lamprecht [Thu, 19 Jan 2023 10:37:07 +0000 (11:37 +0100)]
client: task log: use fstrings for shorter code

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agoclient: task log: only encode upid once
Thomas Lamprecht [Thu, 19 Jan 2023 09:38:15 +0000 (10:38 +0100)]
client: task log: only encode upid once

Instead of percent-encoding the UPID on every loop iteration plus on
abort, just encode it once before entering the loop.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agofix #4483: fix `task log` command interrupt handling
Fabian Grünbichler [Wed, 18 Jan 2023 13:53:42 +0000 (14:53 +0100)]
fix #4483: fix `task log` command interrupt handling

`proxmox-backup-client task log ..` and `proxmox-backup-manager task log ..`
are used to view the logs of tasks that have been started by another client, so
interrupting the task progress view should not forward the interrupt to the
running task. other call sites of the same helper(s) that spawn a task and then
print its progress should keep the old behaviour of interrupting the spawned
task on C^c.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
22 months agoapi: apt: versions: add proxmox-mail-forward to package list
Fiona Ebner [Fri, 2 Dec 2022 14:26:25 +0000 (15:26 +0100)]
api: apt: versions: add proxmox-mail-forward to package list

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
22 months agodocs: fix typo in garbage collection section
Stefan Hanreich [Tue, 17 Jan 2023 13:06:53 +0000 (14:06 +0100)]
docs: fix typo in garbage collection section

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
22 months agotape inventory: code cleanup listing media assigned to a pool
Thomas Lamprecht [Mon, 16 Jan 2023 10:05:25 +0000 (11:05 +0100)]
tape inventory: code cleanup listing media assigned to a pool

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agotape inventory: code cleanup media pool look-up
Thomas Lamprecht [Mon, 16 Jan 2023 10:04:07 +0000 (11:04 +0100)]
tape inventory: code cleanup media pool look-up

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agotape inventory: make both media list methods use same appraoch
Thomas Lamprecht [Mon, 16 Jan 2023 10:00:57 +0000 (11:00 +0100)]
tape inventory: make both media list methods use same appraoch

Was a bit odd that the very similar (same return type) methods used
a for+if/else+push and a iter+filter+collect approach.

Switch both to the latter and use a match instead of if/else for
shorter code

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agofix #4466: show snapshots in media content again
Dominik Csapak [Mon, 16 Jan 2023 08:21:44 +0000 (09:21 +0100)]
fix #4466: show snapshots in media content again

while refactoring the the empty media set checks, we accidentally
reversed one check from !is_empty to unassigned, which now never
included the right media sets.

reversing the condition fixes that.

fixes
52517f7b: ("tape: hide internal use of all zero uuid for unassigned tapes")

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
22 months agocargo: update proxmox-openid to 0.9.9
Thomas Lamprecht [Wed, 11 Jan 2023 17:45:25 +0000 (18:45 +0100)]
cargo: update proxmox-openid to 0.9.9

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agoupdate to nix 0.26
Fabian Grünbichler [Wed, 4 Jan 2023 13:54:50 +0000 (14:54 +0100)]
update to nix 0.26

and corresponding proxmox-* dependencies to their versions depending on nix
0.26.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
22 months agohttp client: suppress "storing login ticket"-error when not using a TTY
Fiona Ebner [Thu, 5 Jan 2023 10:19:32 +0000 (11:19 +0100)]
http client: suppress "storing login ticket"-error when not using a TTY

as a stop-gap measure. Otherwise, task logs for PVE backups started
via non-CLI will have the message
> storing login ticket failed: $XDG_RUNTIME_DIR must be set
show up when running a proxmox-backup-client command (e.g. setting
notes and when uploading the log). This is confusing to users[0].

[0]: https://forum.proxmox.com/threads/120492/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
22 months agofix non-camel-case enums
Wolfgang Bumiller [Thu, 5 Jan 2023 09:57:11 +0000 (10:57 +0100)]
fix non-camel-case enums

This should have never been started to begin with...

22 months agodisk: zfs: improve error logging for zfs commands
Dominik Csapak [Tue, 29 Nov 2022 08:16:11 +0000 (09:16 +0100)]
disk: zfs: improve error logging for zfs commands

zfs errors might include a newline in the output (e.g. when trying to
create a mirror on two differently sized disks), which trips up our
task log status parser since that expectes a 'TASK {status}' on the
beginning of the first line.

print the error from zfs into the log and bail out with a short notice
to check the task log

this fixes the 'unknown error' issue in the ui when an error happnes
during the zfs commands

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
22 months agoapi2/node/services: Handle optional services and expose unit-state
Christoph Heiss [Thu, 22 Dec 2022 12:05:49 +0000 (13:05 +0100)]
api2/node/services: Handle optional services and expose unit-state

.. in the same way the PVE api does, esp. regarding the logic to handle
oneshot and missing services.

This then allows re-using the GUI parts from there as well, so that the
services page in PVE and PBS looks the same.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
22 months agofix typo
Fabian Grünbichler [Wed, 4 Jan 2023 11:05:58 +0000 (12:05 +0100)]
fix typo

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
22 months agoui: verify jobs: set/improve min-width for datastore and namespace columns
Thomas Lamprecht [Wed, 4 Jan 2023 10:19:29 +0000 (11:19 +0100)]
ui: verify jobs: set/improve min-width for datastore and namespace columns

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agofix #4448: ui: verify jobs: add namespace and max-depth columns
Thomas Lamprecht [Wed, 4 Jan 2023 10:14:06 +0000 (11:14 +0100)]
fix #4448: ui: verify jobs: add namespace and max-depth columns

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agofix #4448: ui: prune jobs: rename Store to Datastore for consitency
Thomas Lamprecht [Wed, 4 Jan 2023 10:03:40 +0000 (11:03 +0100)]
fix #4448: ui: prune jobs: rename Store to Datastore for consitency

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agobump version to 2.3.2-1
Fabian Grünbichler [Thu, 22 Dec 2022 10:35:51 +0000 (11:35 +0100)]
bump version to 2.3.2-1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
23 months agofixup doc string formatting and line-wrap comments
Wolfgang Bumiller [Tue, 20 Dec 2022 09:33:50 +0000 (10:33 +0100)]
fixup doc string formatting and line-wrap comments

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agofix #4256: api2: remove datastore ACL-node on removal of datastore
Hannes Laimer [Mon, 19 Dec 2022 14:13:25 +0000 (15:13 +0100)]
fix #4256: api2: remove datastore ACL-node on removal of datastore

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
23 months agopbs-config: add delete_node for ACL-tree
Hannes Laimer [Mon, 19 Dec 2022 14:13:24 +0000 (15:13 +0100)]
pbs-config: add delete_node for ACL-tree

... needed for the deletion of datastore ACL-nodes when the datastore
is removed.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
23 months agofix #4256: api2: remove prune jobs on datastore delete
Hannes Laimer [Mon, 19 Dec 2022 14:13:23 +0000 (15:13 +0100)]
fix #4256: api2: remove prune jobs on datastore delete

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
23 months agofix #4387: pbs-client: print task-logs to stdout
Hannes Laimer [Mon, 19 Dec 2022 11:20:24 +0000 (12:20 +0100)]
fix #4387: pbs-client: print task-logs to stdout

... since those logs are the result of the command.

23 months agoderive Clone and PartialEq for some API types
Dietmar Maurer [Thu, 15 Dec 2022 16:34:13 +0000 (17:34 +0100)]
derive Clone and PartialEq for some API types

This is useful for react-lik GUI toolkits which need to do VDOM diffs.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
23 months agod/postinst: check if datastore lockfile actually exists
Fiona Ebner [Thu, 15 Dec 2022 08:13:25 +0000 (09:13 +0100)]
d/postinst: check if datastore lockfile actually exists

On an installation that never had any datastores, dkpg would fail to
configure the package.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
23 months agod/control: add jq as a build dependency
Fiona Ebner [Thu, 15 Dec 2022 08:13:24 +0000 (09:13 +0100)]
d/control: add jq as a build dependency

It's used in the Makefile and building will fail without it.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
23 months agofix #4346: pbs-client: don't fail silently when storing ticket
Christoph Heiss [Mon, 12 Dec 2022 14:10:56 +0000 (15:10 +0100)]
fix #4346: pbs-client: don't fail silently when storing ticket

Instead, report an error if storing the ticket info failed, so that the
user is informed that something went wrong and follow-up commands might
require authentication again.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
23 months agomove pbs_tools::ticket to pbs_ticket
Wolfgang Bumiller [Tue, 13 Dec 2022 12:55:16 +0000 (13:55 +0100)]
move pbs_tools::ticket to pbs_ticket

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agobuild: drop pbs-buildcfg version hack
Fabian Grünbichler [Tue, 13 Dec 2022 08:44:44 +0000 (09:44 +0100)]
build: drop pbs-buildcfg version hack

no longer needed, it inherits the workspace/proxmox-backup version now, there
is no risk of forgetting to update its version anymore.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
23 months agobuild: use workspace member list for SUBCRATES
Fabian Grünbichler [Tue, 13 Dec 2022 08:44:11 +0000 (09:44 +0100)]
build: use workspace member list for SUBCRATES

similar to what's done in the proxmox repo/workspace, to avoid them getting out
of sync. before this change, the recently introduced pbs-key-config was
missing.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
23 months agomove pbs_config::tape_encryption_keys to pbs crate lib
Wolfgang Bumiller [Mon, 12 Dec 2022 13:26:02 +0000 (14:26 +0100)]
move pbs_config::tape_encryption_keys to pbs crate lib

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agomove pbs_config::key_config to pbs-key-config
Wolfgang Bumiller [Mon, 12 Dec 2022 13:19:52 +0000 (14:19 +0100)]
move pbs_config::key_config to pbs-key-config

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agoupdate for new proxmox-api-macro
Wolfgang Bumiller [Mon, 12 Dec 2022 10:40:12 +0000 (11:40 +0100)]
update for new proxmox-api-macro

A #[default] attribute now conflicts with an explicitly
defined #[api(default: ...)] value for obvious reasons.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>