]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
2 years agomove run_command to pbs-tools
Wolfgang Bumiller [Wed, 7 Jul 2021 08:03:16 +0000 (10:03 +0200)]
move run_command to pbs-tools

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove userid types to pbs-api-types
Wolfgang Bumiller [Wed, 7 Jul 2021 07:53:48 +0000 (09:53 +0200)]
move userid types to pbs-api-types

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove id and single line comment format to pbs-api-types
Wolfgang Bumiller [Wed, 7 Jul 2021 07:49:35 +0000 (09:49 +0200)]
move id and single line comment format to pbs-api-types

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove TaskState trait to pbs-datastore
Wolfgang Bumiller [Wed, 7 Jul 2021 07:24:39 +0000 (09:24 +0200)]
move TaskState trait to pbs-datastore

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoadd pbs-api-types subcrate, move key_derivation
Wolfgang Bumiller [Wed, 7 Jul 2021 07:04:09 +0000 (09:04 +0200)]
add pbs-api-types subcrate, move key_derivation

move key_derivation to pbs-datastore

pbs-api-types should only contain "basic" types which
* are usually required by clients
* don't depend on pbs-related code directly

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoadd pbs-datastore module
Wolfgang Bumiller [Tue, 6 Jul 2021 10:49:10 +0000 (12:49 +0200)]
add pbs-datastore module

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoadd pbs-tools subcrate
Wolfgang Bumiller [Tue, 6 Jul 2021 11:26:35 +0000 (13:26 +0200)]
add pbs-tools subcrate

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agosplit out pbs-runtime module
Wolfgang Bumiller [Tue, 6 Jul 2021 10:08:44 +0000 (12:08 +0200)]
split out pbs-runtime module

These are mostly tokio specific "hacks" or "workarounds" we
only really need/want in our binaries without pulling it in
via our library crates.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobuildsys: don't use debcargo
Wolfgang Bumiller [Tue, 6 Jul 2021 12:45:55 +0000 (14:45 +0200)]
buildsys: don't use debcargo

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agotree-wide: switch to using mod.rs
Wolfgang Bumiller [Tue, 6 Jul 2021 10:02:38 +0000 (12:02 +0200)]
tree-wide: switch to using mod.rs

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agosplit out pbs-buildcfg module
Wolfgang Bumiller [Tue, 6 Jul 2021 09:56:35 +0000 (11:56 +0200)]
split out pbs-buildcfg module

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoCargo.toml: regroup imports
Wolfgang Bumiller [Tue, 6 Jul 2021 09:48:28 +0000 (11:48 +0200)]
Cargo.toml: regroup imports

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 2.0.1-2
Thomas Lamprecht [Sat, 3 Jul 2021 21:14:54 +0000 (23:14 +0200)]
bump version to 2.0.1-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: minimally increase font-size of product title and version
Thomas Lamprecht [Sat, 3 Jul 2021 21:13:29 +0000 (23:13 +0200)]
ui: minimally increase font-size of product title and version

Similar like we did for Proxmox VE's manager. The main title and
version should stand a bit more out compared to simple nav/button
texts.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: app: fix openID helper usage and rework style
Thomas Lamprecht [Sat, 3 Jul 2021 21:12:03 +0000 (23:12 +0200)]
ui: app: fix openID helper usage and rework style

one really does not need a if and an extra intermediate variable for
assigning a simple bool...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.0.1-1
Thomas Lamprecht [Sat, 3 Jul 2021 19:39:25 +0000 (21:39 +0200)]
bump version to 2.0.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuildsys: docs: clean: also clean generated JS files
Thomas Lamprecht [Sat, 3 Jul 2021 19:41:09 +0000 (21:41 +0200)]
buildsys: docs: clean: also clean generated JS files

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoacme: nit code cleanup
Thomas Lamprecht [Sat, 3 Jul 2021 19:17:08 +0000 (21:17 +0200)]
acme: nit code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3496: acme: plugin: add sleep for dns propagation
Stoiko Ivanov [Mon, 28 Jun 2021 18:41:09 +0000 (18:41 +0000)]
fix #3496: acme: plugin: add sleep for dns propagation

the dns plugin config allow for a specified amount of time to wait for
the TXT record to be set and propagated through DNS.

This patch adds a sleep for this amount of time.
The log message was taken from the perl implementation in proxmox-acme
for consistency.

Tested with the powerdns plugin in my test setup.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agoconfig: acme: make validation_delay crate public
Stoiko Ivanov [Mon, 28 Jun 2021 18:41:08 +0000 (18:41 +0000)]
config: acme: make validation_delay crate public

we need the setting in acme::plugin.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agoacme: plugin: fix error message
Stoiko Ivanov [Mon, 28 Jun 2021 18:41:07 +0000 (18:41 +0000)]
acme: plugin: fix error message

extract_challenge is used by both dns-01 and http-01 challenges.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agorestore daemon: use millisecond log resolution
Thomas Lamprecht [Sat, 3 Jul 2021 19:28:17 +0000 (21:28 +0200)]
restore daemon: use millisecond log resolution

During startup most of the stuff is happening in milliseconds (or
less), so the timestamp granularity of seconds made it hard to tell
if the previous command required 990ms or 1ms, which is quite the
difference in the restore daemon context.

Using micros seems not to bring too much additional information, a
millisecond is already an ok lower time resolution for logging, so
switch only to millis for now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorestore daemon: create /run/proxmox-backup on startup
Thomas Lamprecht [Sat, 3 Jul 2021 19:03:13 +0000 (21:03 +0200)]
restore daemon: create /run/proxmox-backup on startup

fixes file restore again.

The new Memcom tracking file lives in `/run/proxmox-backup` and is
always created on REST interaction, as CachedUserInfo uses it to
efficiently track config changes, and such a cache is used in each
REST handle_request.

Further, the Memcom infra expects the base run PBS dir to exists
already, which is an OK assumption to have, but in the file-restore
daemon we have a significantly more minimal environment, and the run
dir was simply not required there, even /run isn't a tmpfs yet.

Fixes fda19dcc6f4 ("fix CachedUserInfo by using a shared memory version counter")
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoREST: set error message extenesion for bad-request response log
Thomas Lamprecht [Sat, 3 Jul 2021 18:49:16 +0000 (20:49 +0200)]
REST: set error message extenesion for bad-request response log

We send it already to the user via the response body, but the
log_response does not has, nor wants to have FWIW, access to the
async body stream, so pass it through the ErrorMessageExtension
mechanism like we do else where.

Note that this is not only useful for PBS API proxy/daemon but also
the REST server of the file-restore daemon running inside the restore
VM, and it really is *very* helpful to debug things there..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomemcom: rustfmt + (trailing) whitespace cleanups
Thomas Lamprecht [Sat, 3 Jul 2021 18:42:55 +0000 (20:42 +0200)]
memcom: rustfmt + (trailing) whitespace cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile restore daemon: log about basic steps
Thomas Lamprecht [Sat, 3 Jul 2021 17:51:32 +0000 (19:51 +0200)]
file restore daemon: log about basic steps

to make the log more useful..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile restore daemon: reword warning about manual execution
Thomas Lamprecht [Sat, 3 Jul 2021 17:51:14 +0000 (19:51 +0200)]
file restore daemon: reword warning about manual execution

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoREST: rust fmt
Thomas Lamprecht [Sat, 3 Jul 2021 19:05:25 +0000 (21:05 +0200)]
REST: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.0.0-2
Thomas Lamprecht [Sat, 3 Jul 2021 00:15:20 +0000 (02:15 +0200)]
bump version to 2.0.0-2

only for the file-restore daemon, other packages where not uploaded!

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: record breaks for older proxmox-backup-restore-image
Thomas Lamprecht [Sat, 3 Jul 2021 00:13:54 +0000 (02:13 +0200)]
d/control: record breaks for older proxmox-backup-restore-image

> requires a Breaks on the old restore image (else the restore daemon
> crashes because of missing lock/LVM support).
- F.G., mailing list

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile-restore-daemon/disk: add LVM (thin) support
Stefan Reiter [Wed, 30 Jun 2021 15:57:59 +0000 (17:57 +0200)]
file-restore-daemon/disk: add LVM (thin) support

Parses JSON output from 'pvs' and 'lvs' LVM utils and does two passes:
one to scan for thinpools and create a device node for their
metadata_lv, and a second to load all LVs, thin-provisioned or not.

Should support every LV-type that LVM supports, as we only parse LVM
tools and use 'vgscan --mknodes' to create device nodes for us.

Produces a two-layer BucketComponent hierarchy with VGs followed by LVs,
PVs are mapped to their respective disk node.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Reviewed-By: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agofile-restore-daemon/disk: ignore already-mounted error and prefix zpool
Stefan Reiter [Wed, 30 Jun 2021 15:57:58 +0000 (17:57 +0200)]
file-restore-daemon/disk: ignore already-mounted error and prefix zpool

Prefix zpool mount paths to avoid clashing with other mount namespaces
(like LVM).

Also ignore "already-mounted" error and return it as success instead -
as we always assume that a mount path is unique, this is a safe
assumption, as nothing else could have been mounted here.

This fixes an issue where a mountpoint=legacy subvol might be available
on different disks, and thus have different Bucket instances that don't
share the mountpoint cache, which could lead to an error if the user
tried opening it multiple times on different disks.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Reviewed-By: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agofile-restore-daemon/disk: fix component path errors
Stefan Reiter [Wed, 30 Jun 2021 15:57:57 +0000 (17:57 +0200)]
file-restore-daemon/disk: fix component path errors

otherwise the path ends in an array ["foo", "bar"] instead of "foo/bar"

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Reviewed-By: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agofile-restore-daemon/disk: dedup BucketComponents and make size optional
Stefan Reiter [Wed, 30 Jun 2021 15:57:56 +0000 (17:57 +0200)]
file-restore-daemon/disk: dedup BucketComponents and make size optional

To support nested BucketComponents, it is necessary to dedup them, as
otherwise two components like:
  /foo/bar
  /foo/baz
will result in /foo being shown twice at the first hierarchy.

Also make the size property based on index and optional, as for example
/foo in the example above might not have a size, and bar/baz might have
differing sizes.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Reviewed-By: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoopenid: conditionally disable api endpoint
Fabian Grünbichler [Thu, 1 Jul 2021 12:58:33 +0000 (14:58 +0200)]
openid: conditionally disable api endpoint

since it pulls in lots of additional linked libraries for all binaries
compiled as part of proxmox-backup. it can easily be re-enabled with
`--cfg openid` added to the RUSTFLAGS env variable.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoopenid: move helper from config to api2
Fabian Grünbichler [Thu, 1 Jul 2021 12:58:32 +0000 (14:58 +0200)]
openid: move helper from config to api2

it's not really needed in the config module, and this makes it easier to
disable the proxmox-openid dependency linkage as a stop-gap measure.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agod/control: bump versioned dependency for proxmox-widget-toolkit to 3.2-1
Thomas Lamprecht [Fri, 2 Jul 2021 23:50:12 +0000 (01:50 +0200)]
d/control: bump versioned dependency for proxmox-widget-toolkit to 3.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: commit update
Thomas Lamprecht [Fri, 2 Jul 2021 23:49:50 +0000 (01:49 +0200)]
d/control: commit update

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: login: cleanups, mostly openID related
Thomas Lamprecht [Fri, 2 Jul 2021 23:46:20 +0000 (01:46 +0200)]
ui: login: cleanups, mostly openID related

similar to what was done in PVE.

 - factor out openid_login_param to widget-toolkit as
   getOpenIDRedirectionAuthorization and use it
 - use camel case to match our JS style guide and our framework (and
   basically the rest of the JS world)
 - minor cleanups like moving variable definition into the single if
   branch their used

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: installation: drop debian-release specific note
Thomas Lamprecht [Fri, 2 Jul 2021 23:44:53 +0000 (01:44 +0200)]
docs: installation: drop debian-release specific note

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: faq: update support table
Thomas Lamprecht [Fri, 2 Jul 2021 23:44:09 +0000 (01:44 +0200)]
docs: faq: update support table

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: initial update to repositories for bullseye
Thomas Lamprecht [Fri, 2 Jul 2021 17:02:13 +0000 (19:02 +0200)]
docs: initial update to repositories for bullseye

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: login: fix another bogus gettext usage
Thomas Lamprecht [Fri, 2 Jul 2021 07:31:50 +0000 (09:31 +0200)]
ui: login: fix another bogus gettext usage

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: login: fix bogus gettext usage
Thomas Lamprecht [Fri, 2 Jul 2021 06:39:43 +0000 (08:39 +0200)]
ui: login: fix bogus gettext usage

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: dashboard/DataStoreStatistics: fix closing <i> tag
Dominik Csapak [Wed, 30 Jun 2021 15:15:59 +0000 (17:15 +0200)]
ui: dashboard/DataStoreStatistics: fix closing <i> tag

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotape/drive: fix logging when requesting media
Dominik Csapak [Tue, 29 Jun 2021 09:58:14 +0000 (11:58 +0200)]
tape/drive: fix logging when requesting media

we try to load the correct media in a loop until we find the correct tape.
when encountering an error or wrong tape, we want to log that (and send
an email if one is set) that requests the correct tape.

while trying to avoid printing the same errors more than once in a row,
we had at least one case (starting with an empty tape in the drive)
which would not print/send any tape request.

reworking that code to use a custom 'TapeRequest' enum, which contains
the state + error message, and a helper that prints and sends an email
when the state changes

this reduces the change check/log to a single variable, instead of 4
(tried, last_media_uuid, last_error, failure_reason)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agotape: fix LTO locate_file for HP drives
Dietmar Maurer [Mon, 28 Jun 2021 11:36:26 +0000 (13:36 +0200)]
tape: fix LTO locate_file for HP drives

Add test code to the first locate_file command, compute locate_offset.
Subsequent locate_file commands use that offset.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agofix CachedUserInfo by using a shared memory version counter
Dietmar Maurer [Fri, 25 Jun 2021 08:52:38 +0000 (10:52 +0200)]
fix CachedUserInfo by using a shared memory version counter

2 years agoui: implement OpenId login
Dietmar Maurer [Mon, 14 Jun 2021 09:58:52 +0000 (11:58 +0200)]
ui: implement OpenId login

2 years agoapi: add openid redirect/login API
Dietmar Maurer [Mon, 14 Jun 2021 09:58:28 +0000 (11:58 +0200)]
api: add openid redirect/login API

2 years agocleanup user/token is_active() check
Dietmar Maurer [Wed, 16 Jun 2021 11:42:20 +0000 (13:42 +0200)]
cleanup user/token is_active() check

2 years agoimplement new helper is_active_user_id()
Dietmar Maurer [Wed, 16 Jun 2021 07:03:34 +0000 (09:03 +0200)]
implement new helper is_active_user_id()

2 years agocli: add CLI to manage openid realms.
Dietmar Maurer [Fri, 11 Jun 2021 08:52:41 +0000 (10:52 +0200)]
cli: add CLI to manage openid realms.

2 years agoadd API to manage openid realms
Dietmar Maurer [Fri, 11 Jun 2021 06:15:47 +0000 (08:15 +0200)]
add API to manage openid realms

2 years agocheck_acl_path: add /access/domains and /access/openid
Dietmar Maurer [Mon, 21 Jun 2021 08:59:43 +0000 (10:59 +0200)]
check_acl_path: add /access/domains and /access/openid

2 years agoconfig: new domains.cfg to configure openid realm
Dietmar Maurer [Fri, 11 Jun 2021 04:34:37 +0000 (06:34 +0200)]
config: new domains.cfg to configure openid realm

Or other realmy types...

2 years agodepend on proxmox-openid-rs
Dietmar Maurer [Tue, 15 Jun 2021 05:11:49 +0000 (07:11 +0200)]
depend on proxmox-openid-rs

2 years agoupdate enterprise repository to bullseye
Thomas Lamprecht [Mon, 28 Jun 2021 17:57:50 +0000 (19:57 +0200)]
update enterprise repository to bullseye

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/changelog: add actual changelog for initial 2.0 build
Thomas Lamprecht [Mon, 28 Jun 2021 17:40:44 +0000 (19:40 +0200)]
d/changelog: add actual changelog for initial 2.0 build

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuildsys: switch to bullseye as upload dist target
Thomas Lamprecht [Mon, 28 Jun 2021 17:10:26 +0000 (19:10 +0200)]
buildsys: switch to bullseye as upload dist target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.0.0-1
Thomas Lamprecht [Mon, 28 Jun 2021 17:07:46 +0000 (19:07 +0200)]
bump version to 2.0.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuildsys: call dpkg-buildpackage directly in deb-all
Thomas Lamprecht [Mon, 28 Jun 2021 17:07:10 +0000 (19:07 +0200)]
buildsys: call dpkg-buildpackage directly in deb-all

else we may double-build

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: bump versioned dependency for ExtJS 7.0
Thomas Lamprecht [Mon, 28 Jun 2021 17:05:58 +0000 (19:05 +0200)]
d/control: bump versioned dependency for ExtJS 7.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: build api-viewer from widget-toolkit-dev
Dominik Csapak [Fri, 4 Jun 2021 12:35:30 +0000 (14:35 +0200)]
docs: build api-viewer from widget-toolkit-dev

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodocs: add Toolkit.js to lto-barcode
Dominik Csapak [Fri, 4 Jun 2021 12:35:29 +0000 (14:35 +0200)]
docs: add Toolkit.js to lto-barcode

and generate a single js file for it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodocs: add Toolkit.js to prune simulator
Dominik Csapak [Fri, 4 Jun 2021 12:35:28 +0000 (14:35 +0200)]
docs: add Toolkit.js to prune simulator

from proxmox-widget-toolkit-dev and not as normal dependency,
else we would have to ship widget-toolkit on the wiki

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodocs/prune-simulator: remove displayField for Calendar Field
Dominik Csapak [Fri, 4 Jun 2021 12:35:27 +0000 (14:35 +0200)]
docs/prune-simulator: remove displayField for Calendar Field

in extjs 7.0, specifying displayField overwrites the displayTpl,
which we want to use here, so remove it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agofix #3393 (again): pxar/create: try to read xattrs/fcaps/acls by default
Dominik Csapak [Tue, 8 Jun 2021 13:49:43 +0000 (15:49 +0200)]
fix #3393 (again): pxar/create: try to read xattrs/fcaps/acls by default

we have a static list of filesystems and their capabilities regarding
file attributes and fs features (e.g. sockets/fifos/etc) which also
includes xattrs,acls and fcaps

if we did not know a filesystem by its magic number (for example cephfs),
we did not even attempt to read xattrs, etc.

this patch adds those flags by default to unknown filesystems, and
removes them when we encounter EOPNOTSUPP (to remove the number
of syscalls)

with this, we should be able to catch xattrs/acls/fcaps on all
(unknown) fs types that support them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agofile-restore/disk: support ZFS subvols with mountpoint=legacy
Stefan Reiter [Wed, 16 Jun 2021 10:55:52 +0000 (12:55 +0200)]
file-restore/disk: support ZFS subvols with mountpoint=legacy

These require mounting using the regular 'mount' syscall.
Auto-generates an appropriate mount path.

Note that subvols with mountpoint=none cannot be mounted this way, and
would require setting the mountpoint property, which is not possible as
the zpools have to be imported with readonly=on.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agofile-restore/disk: support ZFS pools
Stefan Reiter [Wed, 16 Jun 2021 10:55:51 +0000 (12:55 +0200)]
file-restore/disk: support ZFS pools

Uses the ZFS utils to detect, import and mount zpools. These are
available as a new Bucket type 'zpool'.

Requires some minor changes to the existing disk and partiton detection
code, so the ZFS-specific part can use the information gathered in the
previous pass to associate drive names with their 'drive-xxxN.img.fidx'
node.

For detecting size, the zpool has to be imported. This is only done with
pools containing 5 or less disks, as anything else might take too long
(and should be seldomly found within VMs).

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agofile-restore: increase RAM for ZFS and disable ARC
Stefan Reiter [Wed, 16 Jun 2021 10:55:50 +0000 (12:55 +0200)]
file-restore: increase RAM for ZFS and disable ARC

Even through best efforts at keeping it small, including the ZFS tools
in the initramfs seems to have exhausted the small overhead we had left
- give it a bit more RAM to compensate.

Also disable the ZFS ARC, as it's no use in such a memory constrained
environment, and we cache on the QEMU/rust layer anyway.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agoasync_lru_cache: fix handling of errors in fetch
Stefan Reiter [Thu, 17 Jun 2021 09:02:32 +0000 (11:02 +0200)]
async_lru_cache: fix handling of errors in fetch

The future needs to be removed from the pending map in any case, even if
it returned an error, else all upcoming calls to access this key will
always return the same error.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agotape/helpers/snapshot_reader: sort chunks by inode (per index)
Dominik Csapak [Fri, 18 Jun 2021 09:29:10 +0000 (11:29 +0200)]
tape/helpers/snapshot_reader: sort chunks by inode (per index)

sort the chunks we want to backup to tape by inode, to gain some
speed on spinning disks. this is done per index, not globally.

costs a bit memory, but not too much, about 16 bytes per chunk which
would mean ~4MiB for a 1TiB index with 4MiB chunks.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agobackup/datastore: refactor chunk inode sorting to the datastore
Dominik Csapak [Fri, 18 Jun 2021 09:29:09 +0000 (11:29 +0200)]
backup/datastore: refactor chunk inode sorting to the datastore

so that we can reuse that information

the removal of the adding to the corrupted list is ok, since
'get_chunks_in_order' returns them at the end of the list
and we do the same if the loading fails later in 'verify_index_chunks'
so we still mark them corrupt
(assuming that the load will fail if the stat does)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoproxmox-backup-manager: show task log on datastore create
Dominik Csapak [Tue, 8 Jun 2021 14:08:27 +0000 (16:08 +0200)]
proxmox-backup-manager: show task log on datastore create

since the output:
Result: "<UPID>"
is not really interesting, show instead the task log while
the datastore is creating, since it is now run in a worker

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoclose #3459: manager: add --ignore-verified and --outdated-after parameters
Hannes Laimer [Tue, 22 Jun 2021 07:56:20 +0000 (09:56 +0200)]
close #3459: manager: add --ignore-verified and --outdated-after parameters

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: add ignore-verified and outdated-after to datastore verify endpoint
Hannes Laimer [Tue, 22 Jun 2021 07:56:19 +0000 (09:56 +0200)]
api: add ignore-verified and outdated-after to datastore verify endpoint

preparatory change for fixing #3459

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Dominik Csapak <d.csapak@proxmox.com>
2 years agoverify-job: move snapshot filter into function
Hannes Laimer [Tue, 22 Jun 2021 07:56:18 +0000 (09:56 +0200)]
verify-job: move snapshot filter into function

preparatory steps for fixing #3459

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Dominik Csapak <d.csapak@proxmox.com>
2 years agod/control: set R-R-R to run binary d/rules targets as root
Fabian Grünbichler [Wed, 2 Jun 2021 10:14:38 +0000 (12:14 +0200)]
d/control: set R-R-R to run binary d/rules targets as root

the build still requires root to make helper binaries setuid

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoupdate to zstd 0.6
Fabian Grünbichler [Wed, 2 Jun 2021 10:14:37 +0000 (12:14 +0200)]
update to zstd 0.6

compatible with libzstd from bullseye.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoapi: define and use REALM_ID_SCHEMA
Dietmar Maurer [Thu, 10 Jun 2021 09:09:08 +0000 (11:09 +0200)]
api: define and use REALM_ID_SCHEMA

2 years agofixup minimum lru capacity
Wolfgang Bumiller [Tue, 8 Jun 2021 08:13:46 +0000 (10:13 +0200)]
fixup minimum lru capacity

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agotools/lru_cache: make minimum capacity 1
Stefan Reiter [Mon, 7 Jun 2021 15:35:30 +0000 (17:35 +0200)]
tools/lru_cache: make minimum capacity 1

Setting this to 0 is not just useless, but breaks the logic horribly
enough to cause random segfaults - better forbid this, to avoid someone
else having to debug it again ;)

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agobackup: remove AsyncIndexReader
Stefan Reiter [Mon, 7 Jun 2021 15:35:29 +0000 (17:35 +0200)]
backup: remove AsyncIndexReader

superseded by CachedChunkReader, with less code and more speed

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agoreplace AsyncIndexReader with SeekableCachedChunkReader
Stefan Reiter [Mon, 7 Jun 2021 15:35:28 +0000 (17:35 +0200)]
replace AsyncIndexReader with SeekableCachedChunkReader

admin/datastore reads linearly only, so no need for cache (capacity of 1
basically means no cache except for the currently active chunk).
mount can do random access too, so cache last 8 chunks for possibly a
mild performance improvement.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agobackup: add AsyncRead/Seek to CachedChunkReader
Stefan Reiter [Mon, 7 Jun 2021 15:35:27 +0000 (17:35 +0200)]
backup: add AsyncRead/Seek to CachedChunkReader

Implemented as a seperate struct SeekableCachedChunkReader that contains
the original as an Arc, since the read_at future captures the
CachedChunkReader, which would otherwise not work with the lifetimes
required by AsyncRead. This is also the reason we cannot use a shared
read buffer and have to allocate a new one for every read. It also means
that the struct items required for AsyncRead/Seek do not need to be
included in a regular CachedChunkReader.

This is intended as a replacement for AsyncIndexReader, so we have less
code duplication and can utilize the LRU cache there too (even though
actual request concurrency is not supported in these traits).

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agobackup: add CachedChunkReader utilizing AsyncLruCache
Stefan Reiter [Mon, 7 Jun 2021 15:35:26 +0000 (17:35 +0200)]
backup: add CachedChunkReader utilizing AsyncLruCache

Provides a fast arbitrary read implementation with full async and
concurrency support.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agotools: add AsyncLruCache as a wrapper around sync LruCache
Stefan Reiter [Mon, 7 Jun 2021 15:35:25 +0000 (17:35 +0200)]
tools: add AsyncLruCache as a wrapper around sync LruCache

Supports concurrent 'access' calls to the same key via a
BroadcastFuture. These are stored in a seperate HashMap, the LruCache
underneath is only modified once a valid value has been retrieved.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agotools/BroadcastFuture: add testcase for better understanding
Stefan Reiter [Mon, 7 Jun 2021 15:35:24 +0000 (17:35 +0200)]
tools/BroadcastFuture: add testcase for better understanding

Explicitly test that data will stay available and can be retrieved
immediately via listen(), even if the future producing the data and
notifying the consumers was already run in the past.

Wasn't broken or anything, but helps with understanding IMO.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agofix #3433: use PVE's wearout logic in PBS
Dominik Csapak [Fri, 4 Jun 2021 13:59:46 +0000 (15:59 +0200)]
fix #3433: use PVE's wearout logic in PBS

in PVE, the logic how wearout gets read from the smartctl output was
changed from a vendor -> id map to a sorted list of specific
attribute field names.

copy that list to pbs (in the same order), and use that to get the
wearout

in the future we might want to split the disk logic into its own crate
and reuse it in pve

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: tape: DriveSelector: make wider and fine-tune column flex
Thomas Lamprecht [Mon, 7 Jun 2021 14:57:45 +0000 (16:57 +0200)]
ui: tape: DriveSelector: make wider and fine-tune column flex

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: tape: DriveSelector: code cleanup, group config together
Thomas Lamprecht [Mon, 7 Jun 2021 14:30:57 +0000 (16:30 +0200)]
ui: tape: DriveSelector: code cleanup, group config together

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: tape: TapeBackupJob: use correct default value for pbsUserSelector
Dominik Csapak [Mon, 7 Jun 2021 13:06:45 +0000 (15:06 +0200)]
ui: tape: TapeBackupJob: use correct default value for pbsUserSelector

if we want the empty value as a valid default value in a combogrid,
we have to explicitely select 'null' else the field will be marked as
dirty

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: tape: DriveSelector: do not autoselect the drive
Dominik Csapak [Mon, 7 Jun 2021 13:06:44 +0000 (15:06 +0200)]
ui: tape: DriveSelector: do not autoselect the drive

in case an invalid drive was configured, now it marks the field
invalid instead of autoselecting the first valid one

this could have lead to users configuring the wrong drive in a
tape-backup-job when they edited one

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoclient/pull: log snapshots that are skipped because of time
Dominik Csapak [Mon, 7 Jun 2021 08:30:17 +0000 (10:30 +0200)]
client/pull: log snapshots that are skipped because of time

we skip snapshots that are older than the newest snapshot of the group in
the target datastore, log it so the user can know why it is not synced

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: DataStoreList: add remove button
Dominik Csapak [Wed, 2 Jun 2021 11:27:04 +0000 (13:27 +0200)]
ui: DataStoreList: add remove button

so that a user can remove a datastore from the gui,
though no data is deleted, this has to be done elsewhere (for now)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agobackup/chunk_store: optionally log progress on creation
Dominik Csapak [Wed, 2 Jun 2021 11:27:03 +0000 (13:27 +0200)]
backup/chunk_store: optionally log progress on creation

and enable it for the worker variants

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agocleanup: factor out config::datastore::lock_config()
Dietmar Maurer [Fri, 4 Jun 2021 06:59:52 +0000 (08:59 +0200)]
cleanup: factor out config::datastore::lock_config()

2 years agoapi2/config/datastore: change create datastore api call to a worker
Dominik Csapak [Wed, 2 Jun 2021 11:27:02 +0000 (13:27 +0200)]
api2/config/datastore: change create datastore api call to a worker

so that longer running creates (e.g. a slow storage), does not
run in a timeout and we can follow its creation

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoproxmox-backup-proxy: fix leftover references on datastore removal
Dominik Csapak [Wed, 2 Jun 2021 11:27:01 +0000 (13:27 +0200)]
proxmox-backup-proxy: fix leftover references on datastore removal

when we remove a datastore via api/cli, the proxy
has sometimes leftover references to that datastore in its
DATASTORE_MAP which includes an open filehandle on the
'.lock' file

this prevents unmounting/exporting the datastore even after removal,
only a reload/restart of the proxy did help

add a command to our command socket, which removes all non
configured datastores from the map, dropping the open filehandle

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>