]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
2 years agotape: changer: handle missing dvcid information
Dominik Csapak [Thu, 22 Jul 2021 09:57:02 +0000 (11:57 +0200)]
tape: changer: handle missing dvcid information

the dvcid information is not always available, so skip it if is missing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotape: changer: improve error message on wrong counts
Dominik Csapak [Thu, 22 Jul 2021 09:26:30 +0000 (11:26 +0200)]
tape: changer: improve error message on wrong counts

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotape: changer: correctly consume data in decode_element_status_page
Dominik Csapak [Thu, 22 Jul 2021 09:26:29 +0000 (11:26 +0200)]
tape: changer: correctly consume data in decode_element_status_page

instead of 'blindly' trusting the changer to deliver the fields written
in the specification, trust the length data it returns in the header.

we slice the descriptor data into equal sized chunks of the correct
size, then we do not have care bout the len and empty checks anymore

this also makes the code to read the rest of the page obsolete,
since the next descriptor is on the correct offset anyway

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotools: xattr: don't test things beyond our control
Wolfgang Bumiller [Thu, 22 Jul 2021 09:34:40 +0000 (11:34 +0200)]
tools: xattr: don't test things beyond our control

whether the kernel allows super-long names or weird
namespace prefixes is not our concern...

also the latter fails under fakeroot

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 2.0.6-1
Thomas Lamprecht [Thu, 22 Jul 2021 08:22:33 +0000 (10:22 +0200)]
bump version to 2.0.6-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: simplify list of ENV var alternative
Thomas Lamprecht [Thu, 22 Jul 2021 08:21:40 +0000 (10:21 +0200)]
docs: simplify list of ENV var alternative

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodoc: Document new environment variabless to specify secret values
Dietmar Maurer [Wed, 21 Jul 2021 09:59:55 +0000 (11:59 +0200)]
doc: Document new environment variabless to specify secret values

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agosupport new ENV vars to get secret values through a file or a command
Dietmar Maurer [Wed, 21 Jul 2021 09:59:54 +0000 (11:59 +0200)]
support new ENV vars to get secret values through a file or a command

We want to allow passing a secret not only directly through the
environment value, but also indirectly through a file path, an open
file descriptor or a command that can write it to standard out.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: server administration: repos: add online help
Fabian Ebner [Wed, 14 Jul 2021 12:57:16 +0000 (14:57 +0200)]
ui: server administration: repos: add online help

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocargo: update proxmox to 0.12.1
Thomas Lamprecht [Thu, 22 Jul 2021 07:58:31 +0000 (09:58 +0200)]
cargo: update proxmox to 0.12.1

For the FS compat improvement in the atomic create file helper

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuild: unbreak 'nocheck'
Fabian Grünbichler [Wed, 21 Jul 2021 14:58:25 +0000 (16:58 +0200)]
build: unbreak 'nocheck'

to skip test cases for faster builds or in case your local system does
not support running (all) tests..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agotape: changer: sg_pt: fix typo
Dominik Csapak [Wed, 21 Jul 2021 14:04:50 +0000 (16:04 +0200)]
tape: changer: sg_pt: fix typo

ok, since its a private struct

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotape: changer: sg_pt: add SCSI_VOLUME_TAG_LEN const
Dominik Csapak [Wed, 21 Jul 2021 14:04:49 +0000 (16:04 +0200)]
tape: changer: sg_pt: add SCSI_VOLUME_TAG_LEN const

so that we do have less 'magic' constants without description

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: types: CHANGER_DRIVENUM_SCHEMA: increase maximum drives per changer
Dominik Csapak [Wed, 21 Jul 2021 14:04:48 +0000 (16:04 +0200)]
api: types: CHANGER_DRIVENUM_SCHEMA: increase maximum drives per changer

to 255. 8 drives per changer was a rather arbitrary limitation and could
well be reached in practice with big libraries.

Altough 255 is still a arbirtrary limitation, this is much less likely
to be reached in practice.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agomove CachedChunkReader to pbs-datastore
Wolfgang Bumiller [Wed, 21 Jul 2021 12:20:00 +0000 (14:20 +0200)]
move CachedChunkReader to pbs-datastore

this was actually still missing from the previous commit

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove remaining client tools to pbs-tools/datastore
Wolfgang Bumiller [Wed, 21 Jul 2021 12:12:22 +0000 (14:12 +0200)]
move remaining client tools to pbs-tools/datastore

pbs-datastore now ended up depending on tokio after all, but
that's fine for now

for the fuse code I added pbs-fuse-loop (has the old
fuse_loop and its 'loopdev' module)
ultimately only binaries should depend on this to avoid the
library link

the only thins remaining to move out the client binary are
the api method return types, those will need to be moved to
pbs-api-types...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoclient: fix panic message
Wolfgang Bumiller [Wed, 21 Jul 2021 11:28:55 +0000 (13:28 +0200)]
client: fix panic message

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agofix regression test file permission problems
Dietmar Maurer [Wed, 21 Jul 2021 06:12:51 +0000 (08:12 +0200)]
fix regression test file permission problems

By simply using the current user/group instead of backup:backup

2 years agobump version to 2.0.5-2
Thomas Lamprecht [Wed, 21 Jul 2021 07:12:46 +0000 (09:12 +0200)]
bump version to 2.0.5-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuildcfg: fix version
Thomas Lamprecht [Wed, 21 Jul 2021 07:11:54 +0000 (09:11 +0200)]
buildcfg: fix version

now set here, but we really need to automate this soon, just to easy
to forget.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuildsys: run test before compile to avoid clobbering the openid build binaries
Thomas Lamprecht [Tue, 20 Jul 2021 17:58:03 +0000 (19:58 +0200)]
buildsys: run test before compile to avoid clobbering the openid build binaries

dh_auto_test also checks for the build flags used, including any
`--cfg`, so it rebuilds and overwrites our carefully assembled daemon
binaries with openid support as it is run after build and before
install.
So manually ensure the order of first test then build (argh, hackes
of hackes >.<)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuildsys: cargo build target: one binary per line
Thomas Lamprecht [Tue, 20 Jul 2021 18:27:35 +0000 (20:27 +0200)]
buildsys: cargo build target: one binary per line

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.0.5-1
Thomas Lamprecht [Tue, 20 Jul 2021 17:06:23 +0000 (19:06 +0200)]
bump version to 2.0.5-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: record fonts-font-awesome dependency for docs
Thomas Lamprecht [Tue, 20 Jul 2021 17:34:42 +0000 (19:34 +0200)]
d/control: record fonts-font-awesome dependency for docs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: add missing font-awesome link for lto-barcode generator
Dominik Csapak [Tue, 20 Jul 2021 14:01:38 +0000 (16:01 +0200)]
docs: add missing font-awesome link for lto-barcode generator

else it cannot load the icons and does not show them in the action column

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agopbs-tools: fix doctest reference to moved cache modules
Thomas Lamprecht [Tue, 20 Jul 2021 16:53:52 +0000 (18:53 +0200)]
pbs-tools: fix doctest reference to moved cache modules

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agotests: move pxar test to its crate
Thomas Lamprecht [Tue, 20 Jul 2021 16:52:14 +0000 (18:52 +0200)]
tests: move pxar test to its crate

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: update build dependencies
Thomas Lamprecht [Tue, 20 Jul 2021 16:20:50 +0000 (18:20 +0200)]
d/control: update build dependencies

needs to be done manually for now..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocargo: bump proxmox-http to 0.3.0
Thomas Lamprecht [Tue, 20 Jul 2021 16:13:56 +0000 (18:13 +0200)]
cargo: bump proxmox-http to 0.3.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoadd helpers to write configuration files
Dietmar Maurer [Tue, 20 Jul 2021 11:51:55 +0000 (13:51 +0200)]
add helpers to write configuration files

2 years agouse new atomic_open_or_create_file
Dietmar Maurer [Tue, 20 Jul 2021 11:51:54 +0000 (13:51 +0200)]
use new atomic_open_or_create_file

Factor out open_backup_lockfile() method to acquire locks owned by
user backup with permission 0660.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofixup examples
Wolfgang Bumiller [Tue, 20 Jul 2021 13:26:25 +0000 (15:26 +0200)]
fixup examples

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove channel/stream helpers to pbs-tools
Wolfgang Bumiller [Tue, 20 Jul 2021 09:26:29 +0000 (11:26 +0200)]
move channel/stream helpers to pbs-tools

pbs_tools
  ::blocking: std/async wrapping with block_in_place
  ::stream: stream <-> AsyncRead/AsyncWrite wrapping

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove required_X_param to pbs_tools::json
Wolfgang Bumiller [Tue, 20 Jul 2021 09:06:53 +0000 (11:06 +0200)]
move required_X_param to pbs_tools::json

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove lru cachers to pbs-tools
Wolfgang Bumiller [Tue, 20 Jul 2021 08:57:22 +0000 (10:57 +0200)]
move lru cachers to pbs-tools

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove ChunkStream to pbs-client
Wolfgang Bumiller [Tue, 20 Jul 2021 08:51:19 +0000 (10:51 +0200)]
move ChunkStream to pbs-client

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoissue banner: avoid depending on proxmox crate for hostname
Thomas Lamprecht [Mon, 19 Jul 2021 14:32:48 +0000 (16:32 +0200)]
issue banner: avoid depending on proxmox crate for hostname

While this slightly duplicates code we just do not profit from the
central, lazy static variant here, as that is only really useful in
daemons to avoid doing frequent syscalls there.

proxmox just pull in far to much (e.g., tokio) and duplicating that
one line of simple code has no real maintenance cost, so just go for
that and use the nix crate directly.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocleanup unused imports
Wolfgang Bumiller [Mon, 19 Jul 2021 13:55:19 +0000 (15:55 +0200)]
cleanup unused imports

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoMakefile: fix build.rs reference
Wolfgang Bumiller [Mon, 19 Jul 2021 13:54:53 +0000 (15:54 +0200)]
Makefile: fix build.rs reference

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove pxar binary to separate crate
Wolfgang Bumiller [Mon, 19 Jul 2021 13:53:43 +0000 (15:53 +0200)]
move pxar binary to separate crate

and move its few remaining proxmox_backup deps out to
pbs-tools

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoresolve some more client imports
Wolfgang Bumiller [Mon, 19 Jul 2021 13:03:24 +0000 (15:03 +0200)]
resolve some more client imports

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove some api types to pbs-api-types
Wolfgang Bumiller [Mon, 19 Jul 2021 12:59:51 +0000 (14:59 +0200)]
move some api types to pbs-api-types

and resolve some imports in the client binary

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove build.rs and friends to pbs-buildcfg
Wolfgang Bumiller [Mon, 19 Jul 2021 12:59:17 +0000 (14:59 +0200)]
move build.rs and friends to pbs-buildcfg

with this the main crate won't be re-compiled every time a
*binary* is modified

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agocomment on test output paths
Wolfgang Bumiller [Mon, 19 Jul 2021 12:24:13 +0000 (14:24 +0200)]
comment on test output paths

cargo should be getting a new env var for this soon

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodoc and tests fixup
Wolfgang Bumiller [Mon, 19 Jul 2021 11:00:16 +0000 (13:00 +0200)]
doc and tests fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove client to pbs-client subcrate
Wolfgang Bumiller [Mon, 19 Jul 2021 08:50:18 +0000 (10:50 +0200)]
move client to pbs-client subcrate

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove 'wait_for_local_worker' from client to server
Wolfgang Bumiller [Mon, 19 Jul 2021 08:44:40 +0000 (10:44 +0200)]
move 'wait_for_local_worker' from client to server

this just made no sense in the client

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agod/control: fixup proxmox feature flags
Wolfgang Bumiller [Mon, 19 Jul 2021 08:09:43 +0000 (10:09 +0200)]
d/control: fixup proxmox feature flags

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove more tools for the client into subcrates
Wolfgang Bumiller [Thu, 15 Jul 2021 10:15:50 +0000 (12:15 +0200)]
move more tools for the client into subcrates

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove more helpers to pbs-tools
Wolfgang Bumiller [Mon, 12 Jul 2021 09:07:52 +0000 (11:07 +0200)]
move more helpers to pbs-tools

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoadd proxmox-backup-banner binary crate
Wolfgang Bumiller [Mon, 12 Jul 2021 08:45:09 +0000 (10:45 +0200)]
add proxmox-backup-banner binary crate

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump proxmox-apt dependency
Wolfgang Bumiller [Mon, 19 Jul 2021 08:06:53 +0000 (10:06 +0200)]
bump proxmox-apt dependency

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: datastore/Prune: improve title of group prune window
Dominik Csapak [Fri, 16 Jul 2021 08:53:28 +0000 (10:53 +0200)]
ui: datastore/Prune: improve title of group prune window

we are not actually pruning the whole datastore, but only the single
group, so set that as a title

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: datastore/Content: add 'Prune All' button
Dominik Csapak [Fri, 16 Jul 2021 08:53:27 +0000 (10:53 +0200)]
ui: datastore/Content: add 'Prune All' button

since the api call always starts a real worker, we cannot have a
preview. It would also be very hard to show that for all groups in a
non-confusing way. We reuse the pbsPruneInputPanel and add the dry-run
field there conditionally.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: admin/datastore: add new 'prune-datastore' api call
Dominik Csapak [Fri, 16 Jul 2021 08:53:26 +0000 (10:53 +0200)]
api: admin/datastore: add new 'prune-datastore' api call

to prune the whole datastore at once, with the given parameters.
We need a new api call since this can take a while and we need to start
a worker for this. The exisiting api call returns a list of removed/kept
snapshots and is synchronous.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoserver/prune_job: add proper permission checks to 'prune_datastore'
Dominik Csapak [Fri, 16 Jul 2021 08:53:25 +0000 (10:53 +0200)]
server/prune_job: add proper permission checks to 'prune_datastore'

checks for PRIV_DATASTORE_MODIFY, or else if the auth_id is the backup
owner, and skips the group if not.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoserver/prune_job: add 'keep_all' logic to 'prune_datastore'
Dominik Csapak [Fri, 16 Jul 2021 08:53:24 +0000 (10:53 +0200)]
server/prune_job: add 'keep_all' logic to 'prune_datastore'

it is the same as when pruning single groups.
for prune_jobs, we never start the worker if there is no prune option set.
but if we want to call 'prune_datastore' from somewhere else, we
have to check it here again

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoserver/prune_job: factor out 'prune_datastore'
Dominik Csapak [Fri, 16 Jul 2021 08:53:23 +0000 (10:53 +0200)]
server/prune_job: factor out 'prune_datastore'

we want to use that outside of a prune job

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agobackup/datastore: refactor check_backup_owner there
Dominik Csapak [Fri, 16 Jul 2021 08:53:22 +0000 (10:53 +0200)]
backup/datastore: refactor check_backup_owner there

and add a 'owns_backup' convenience function

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: admin/datastore: simplify prune api call
Dominik Csapak [Fri, 16 Jul 2021 08:53:21 +0000 (10:53 +0200)]
api: admin/datastore: simplify prune api call

by using the api macro and reusing the PruneOptions from pbs-datastore

this means we can now drop the 'add_common_prune_prameters' macro

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoclient: simplify prune api method
Dominik Csapak [Fri, 16 Jul 2021 08:53:20 +0000 (10:53 +0200)]
client: simplify prune api method

by using the api macro on the async method and reusing the PruneOptions
from pbs-datastore with 'flatten: true'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agopbs-datastore/prune: make PruneOptions an api type
Dominik Csapak [Fri, 16 Jul 2021 08:53:19 +0000 (10:53 +0200)]
pbs-datastore/prune: make PruneOptions an api type

so that we can reuse it from here

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi-types: move PRUNE_SCHEMA_KEEP_* to pbs-api-types
Dominik Csapak [Fri, 16 Jul 2021 08:53:18 +0000 (10:53 +0200)]
api-types: move PRUNE_SCHEMA_KEEP_* to pbs-api-types

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotape: changer: sg_pt: make extra scsi request for dvcid
Dominik Csapak [Thu, 15 Jul 2021 11:07:20 +0000 (13:07 +0200)]
tape: changer: sg_pt: make extra scsi request for dvcid

some libraries cannot handle a request with volume tags and DVCID set at
the same time.

So we make 2 separate requests and merge them, since we want to keep
the vendor/model/serial data.

to not overcomplicate the code, add another special type to ElementType

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agobuildsys: Prepare new way for path dependencies
Wolfgang Bumiller [Thu, 15 Jul 2021 07:54:47 +0000 (09:54 +0200)]
buildsys: Prepare new way for path dependencies

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agofeatures update
Wolfgang Bumiller [Wed, 14 Jul 2021 13:36:47 +0000 (15:36 +0200)]
features update

so we can drop default-features in proxmox for build-deps to
be more lean

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agod/control: update proxmox b-d
Fabian Grünbichler [Wed, 14 Jul 2021 11:51:38 +0000 (13:51 +0200)]
d/control: update proxmox b-d

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agodepend on proxmox 0.11.6 (changed make_tmp_file() return type)
Dietmar Maurer [Wed, 14 Jul 2021 11:37:26 +0000 (13:37 +0200)]
depend on proxmox 0.11.6 (changed make_tmp_file() return type)

2 years agofix #3526: correctly filter tasks with 'since' and 'until'
Dominik Csapak [Wed, 14 Jul 2021 07:30:26 +0000 (09:30 +0200)]
fix #3526: correctly filter tasks with 'since' and 'until'

The previous assumption was that the Tasks returned by the Iterator are
sorted by the starttime, but that is not actually the case, and
could never have been, since we append the tasks into the log when
they are finished (not started) and running tasks are always iterated
first.

To correctly filter (and simplify the the api call) we forgo the
combinators, and use a for loop instead. This way we only have to do
the since/until checks only once per Task, but have to do the
start/limit counting ourselves.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodocs: tape: drop technology preview admonitions
Thomas Lamprecht [Tue, 13 Jul 2021 14:47:19 +0000 (16:47 +0200)]
docs: tape: drop technology preview admonitions

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3515: file-restore-daemon: allow LVs/PVs with dash in name
Stefan Reiter [Tue, 13 Jul 2021 09:23:21 +0000 (11:23 +0200)]
fix #3515: file-restore-daemon: allow LVs/PVs with dash in name

LVM replaces any dashes '-' in an LV or PV name with two '--' for the
created device node in /dev/mapper/ to distinguish the seperating
character between the PV and LV name.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agofile-restore: increase lock timeout on QEMU map
Stefan Reiter [Tue, 13 Jul 2021 09:23:20 +0000 (11:23 +0200)]
file-restore: increase lock timeout on QEMU map

This lock is held during VM startup, so that multiple calls will not
start VMs twice. But this means that the timeout needs to incorporate
the time it might take a VM to boot, so increase it quite a bit.

This could previously lead to "interrupted system call" errors when
accessing backups with many disks.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agoapi2: tape: restore: add warning for list restore
Dominik Csapak [Tue, 13 Jul 2021 09:11:25 +0000 (11:11 +0200)]
api2: tape: restore: add warning for list restore

if an error occurs, the snapshot dirs will already be created, and we
do not clean them up (some might already be finished).

Warn the user that they are not cleaned up.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agochunk_store/insert_chunk: add more information to file errors
Dominik Csapak [Tue, 13 Jul 2021 09:11:24 +0000 (11:11 +0200)]
chunk_store/insert_chunk: add more information to file errors

otherwise this context is missing in some tasks (e.g. tape restore)
and it is unclear where it came from

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotape: changer: sg_pt: always retry until timeout
Dietmar Maurer [Tue, 13 Jul 2021 08:39:28 +0000 (10:39 +0200)]
tape: changer: sg_pt: always retry until timeout

2 years agoui: tape/BackupOverview: increase timeout for media-set content
Dominik Csapak [Tue, 13 Jul 2021 07:09:14 +0000 (09:09 +0200)]
ui: tape/BackupOverview: increase timeout for media-set content

a single catalog can be over 100MiB, and a media-set can have multiple
catalogs to read (no technical upper limit). On slow disks, this can
take much longer than 30 seconds (the default timeout).

The real solution would be to have some kind of index only for the gui
relevant part, e.g. a table in the beginning of the catalog, or
alternatively a seperate file with that info. Until we have such a
solution increase the timeout as a stopgap.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agobump version to 2.0.4-1
Thomas Lamprecht [Mon, 12 Jul 2021 16:51:41 +0000 (18:51 +0200)]
bump version to 2.0.4-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoauth: 'crypt' is not thread safe
Stefan Reiter [Mon, 12 Jul 2021 16:30:47 +0000 (18:30 +0200)]
auth: 'crypt' is not thread safe

According to crypt(3):
"crypt places its result in a static storage area, which will be
overwritten by subsequent calls to crypt. It is not safe to call crypt
from multiple threads simultaneously."

This means that multiple login calls as a PBS-realm user can collide and
produce intermittent authentication failures. A visible case is for
file-restore, where VMs with many disks lead to just as many auth-calls
at the same time, as the GUI tries to expand each tree element on load.

Instead, use the thread-safe variant 'crypt_r', which places the result
into a pre-allocated buffer of type 'crypt_data'. The C struct is laid
out according to 'lib/crypt.h.in' and the man page mentioned above.

Use the opportunity and make both arguments to the rust 'crypt' function
take a &[u8].

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agotape: changer: sg_pt: query element types separately
Dominik Csapak [Mon, 12 Jul 2021 15:48:53 +0000 (17:48 +0200)]
tape: changer: sg_pt: query element types separately

Some changers do not like the DVCID bit when querying non-drives,
this includes when querying 'all' elements.

To circumvent this, we query each type by itself (like mtx does it),
and only add the DVCID bit for drives (Data Transfer Elements).

Reported by a user in the forum:
https://forum.proxmox.com/threads/ibm-3584-ts3500-support.92291/

and limit to 1000 elements per request.
(Because some changers limit that request with the options we set)

instead of checking if the data len was equal to the allocation_len
for getting more data, we count the returned elements and compare
that with the number we requested

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agochange tape drive lock path
Dietmar Maurer [Mon, 12 Jul 2021 15:23:38 +0000 (17:23 +0200)]
change tape drive lock path

New kernel has stricter checks on tmpfs with stick-bit on directories, so some
commands (i.e. proxmox-tape changer status) fails when executed as root, because
permission checks fails when locking the drive.

This patch move the drive locks to /run/proxmox-backup/drive-lock.

Note: This is incompatible to old locking mechmanism, so users may not
run tape backups during update (or running backup can fail).

2 years agod/postinst: drop some legacy update handling
Thomas Lamprecht [Mon, 12 Jul 2021 14:14:28 +0000 (16:14 +0200)]
d/postinst: drop some legacy update handling

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuildsys: try to avoid duplicate build due to "phony" docs dependency
Thomas Lamprecht [Mon, 12 Jul 2021 11:15:17 +0000 (13:15 +0200)]
buildsys: try to avoid duplicate build due to "phony" docs dependency

Make docs target depend directly on the some docs-only required
binaries and add a new intermediate ".do-cargo-build" target that is
explicitly not a PHONY target.

That avoids one extra set of full builds.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.0.3-1
Thomas Lamprecht [Mon, 12 Jul 2021 06:07:55 +0000 (08:07 +0200)]
bump version to 2.0.3-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoRevert "api: access: domains: add ExtraRealmInfo and RealmInfo structs"
Dominik Csapak [Mon, 12 Jul 2021 07:48:08 +0000 (09:48 +0200)]
Revert "api: access: domains: add ExtraRealmInfo and RealmInfo structs"

This reverts commit da7ec1d2af1c28503052e1cd5954dfada81058cd.

not necessary, since we have the api in config/access/openid

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoRevert "api: access: domains: add get/create/update/delete domain call"
Dominik Csapak [Mon, 12 Jul 2021 07:48:07 +0000 (09:48 +0200)]
Revert "api: access: domains: add get/create/update/delete domain call"

This reverts commit 5117cf4f1786e0b37d486413d658d78a4bcfdf53.

we already have that in api2/config/access

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: config: access: openid: use better Privilige Realm.Allocate
Dominik Csapak [Mon, 12 Jul 2021 07:48:06 +0000 (09:48 +0200)]
api: config: access: openid: use better Privilige Realm.Allocate

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: config: access: openid: use correct parameter for matching
Dominik Csapak [Mon, 12 Jul 2021 07:48:05 +0000 (09:48 +0200)]
api: config: access: openid: use correct parameter for matching

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: panel/AccessControl: define baseUrland useTypeInUrl for AuthView
Dominik Csapak [Mon, 12 Jul 2021 07:48:04 +0000 (09:48 +0200)]
ui: panel/AccessControl: define baseUrland useTypeInUrl for AuthView

both are not the default

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agobuildsys: fixup clean target
Thomas Lamprecht [Mon, 12 Jul 2021 06:08:25 +0000 (08:08 +0200)]
buildsys: fixup clean target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: tfa: module path cleanup
Wolfgang Bumiller [Mon, 12 Jul 2021 06:43:14 +0000 (08:43 +0200)]
api: tfa: module path cleanup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: datastore content: style edit notes pencil like action-col icon
Thomas Lamprecht [Mon, 12 Jul 2021 05:57:37 +0000 (07:57 +0200)]
ui: datastore content: style edit notes pencil like action-col icon

as those have a hover effect and use dark-grey vs. the quite "harsh"
looking plain black. We need to override the margin though, as else
the floated layout adds another line.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: update group notes: fix obj access and rewrite to async
Thomas Lamprecht [Mon, 12 Jul 2021 05:54:41 +0000 (07:54 +0200)]
ui: update group notes: fix obj access and rewrite to async

eslint is configured to not allow using quoted object keys if they
could be just passed in dot notation, e.g.,
wrong: `group["comment"]`
good:  `group.comment`

It's not a big problem but eslint fails the build with the wrong one,
so this needs to be fixed anyway..

Also, rewrite to async, shorter and less indentation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: bump versioned dependency to widget-toolkit
Thomas Lamprecht [Mon, 12 Jul 2021 05:20:45 +0000 (07:20 +0200)]
d/control: bump versioned dependency to widget-toolkit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: add support for notes on backup groups
Stefan Reiter [Thu, 8 Jul 2021 14:45:28 +0000 (16:45 +0200)]
ui: add support for notes on backup groups

Currently done a little bit hacky in a seperate API call following the
initial list_snapshots, as we previously didn't call list_groups at all
and instead calculated the groups from the snapshots.

This calls it async and updates the view with group comments when data
arrives. The editor is simply reused with the 'group-notes' API call,
since the semantics are the same.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agoapi: add support for notes on backup groups
Stefan Reiter [Thu, 8 Jul 2021 14:45:27 +0000 (16:45 +0200)]
api: add support for notes on backup groups

Stored in atomically-updated 'notes' file in backup group directory.
Available via dedicated GET/PUT API calls, as well as the first line
being included in list_groups (similar to list_snapshots).

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: node status: fix font-awesome icon size
Thomas Lamprecht [Mon, 12 Jul 2021 04:56:09 +0000 (06:56 +0200)]
ui: node status: fix font-awesome icon size

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: node status: reduce padding like in PVE
Thomas Lamprecht [Mon, 12 Jul 2021 04:55:30 +0000 (06:55 +0200)]
ui: node status: reduce padding like in PVE

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: dashboard: show node's repository/subscription status
Fabian Ebner [Fri, 9 Jul 2021 12:44:16 +0000 (14:44 +0200)]
ui: dashboard: show node's repository/subscription status

Mostly copied from PVE, slightly adapted to be consistent with other
things in the dashboard, e.g. use a store for the repository info.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui: window/Settings: add summarycolumns settings
Dominik Csapak [Mon, 19 Apr 2021 11:02:06 +0000 (13:02 +0200)]
ui: window/Settings: add summarycolumns settings

like in pve

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: panel/NodeInfo: make it like in pve
Dominik Csapak [Mon, 19 Apr 2021 11:02:05 +0000 (13:02 +0200)]
ui: panel/NodeInfo: make it like in pve

this changes the node info panel to a similar layout as in pve,
with the ksm sharing and version field removed

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