]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
2 years agoui: update generated OnlineHelpInfo map
Thomas Lamprecht [Mon, 25 Apr 2022 08:17:21 +0000 (10:17 +0200)]
ui: update generated OnlineHelpInfo map

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3067: ui: add a separate notes view for longer markdown notes
Stefan Sterz [Tue, 12 Apr 2022 10:34:23 +0000 (12:34 +0200)]
fix #3067: ui: add a separate notes view for longer markdown notes

since markdown notes might be rather long, this commit adds a tab
similar to pve's datacenter or node notes. requires a bump of the
widget toolkit in order to use the `pmxNotesView`.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2 years agofix #3067: docs: add markdown primer from pve to pbs
Stefan Sterz [Tue, 12 Apr 2022 10:34:19 +0000 (12:34 +0200)]
fix #3067: docs: add markdown primer from pve to pbs

this copies the markdown primer from the pve docs to allow access to
it via the help buttons in the gui

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2 years agodatastore: move blob loading into BackupDir impl and adapt call sites
Thomas Lamprecht [Sun, 24 Apr 2022 17:09:38 +0000 (19:09 +0200)]
datastore: move blob loading into BackupDir impl and adapt call sites

data blobs can only appear in a BackupDir (snapshot) in the backup
hierachy, so makes more sense that it lives in there.

As it wasn't widely used anyway it's easy to move the single
non-package call site over to the new one directly and drop the
implementation from Datastore completely.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: move destroying group or dir into respective impl
Thomas Lamprecht [Sun, 24 Apr 2022 16:49:09 +0000 (18:49 +0200)]
datastore: move destroying group or dir into respective impl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: move manifest locking into BackupDir impl
Thomas Lamprecht [Sun, 24 Apr 2022 16:37:15 +0000 (18:37 +0200)]
datastore: move manifest locking into BackupDir impl

the manifest is owned by the backup dir (snapshot) so it should also
handle locking, makes no sense to have the implementation somewhere
higher up.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: s/fail_if_not_exist/assert_exists/
Thomas Lamprecht [Sun, 24 Apr 2022 17:50:51 +0000 (19:50 +0200)]
datastore: s/fail_if_not_exist/assert_exists/

avoid putting whole sentences in parameter names

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: improve backup group/snapshot iters
Thomas Lamprecht [Sun, 24 Apr 2022 16:06:17 +0000 (18:06 +0200)]
datastore: improve backup group/snapshot iters

move the check for directory before doing the OSString -> String
conversion, which should be a bit more efficient.

Also let the match return the entry in the non-skip/return case to
reduce indentation level for the inner "yield element" part, making
it slightly easier to follow.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: replace manual path assembly by group/dir full_path
Thomas Lamprecht [Sun, 24 Apr 2022 16:03:27 +0000 (18:03 +0200)]
datastore: replace manual path assembly by group/dir full_path

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: list snapshots iter: report group dir in error
Thomas Lamprecht [Sun, 24 Apr 2022 15:58:12 +0000 (17:58 +0200)]
datastore: list snapshots iter: report group dir in error

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopbs-client: extract: add top-level dir in tar.zst
Dominik Csapak [Tue, 19 Apr 2022 10:28:28 +0000 (12:28 +0200)]
pbs-client: extract: add top-level dir in tar.zst

when download a folder, include that folder as first entry (except '/')

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agopbs-client: extract: rewrite create_zip with sequential decoder
Dominik Csapak [Tue, 19 Apr 2022 10:28:27 +0000 (12:28 +0200)]
pbs-client: extract: rewrite create_zip with sequential decoder

instead of an async recursive function. Not only is it less code,
recursive futures are not really nice and it should be faster too.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoserver pull: fix comment w.r.t. initial downloaded chunk capacity
Thomas Lamprecht [Thu, 21 Apr 2022 13:54:59 +0000 (15:54 +0200)]
server pull: fix comment w.r.t. initial downloaded chunk capacity

> The hash set will be able to hold at least capacity elements
> without reallocating. If capacity is 0, the hash set will not
> allocate.
-- rustdoc, HashSet::with_capacity

So, the number we pass is the amount of chunk "IDs" we safe, which is
then 64Ki, not 16Ki and thus the size we can reference too is also
256 GiB, not 64 GiB.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopbs-tape: sgutils2: check sense data when status is 'CHECK_CONDITION'
Dietmar Maurer [Thu, 21 Apr 2022 07:34:36 +0000 (09:34 +0200)]
pbs-tape: sgutils2: check sense data when status is 'CHECK_CONDITION'

Some raid controllers return a 'transport error' when we expected a
'sense error'. it seems the correct way to check the sense data is when
either the result category is 'SENSE' or when the status is 'CHECK_CONDITION',
so do that. (similar to how 'sg_raw' returns the errors)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoreference the datastore in BackupGroup/Dir
Wolfgang Bumiller [Wed, 20 Apr 2022 13:30:04 +0000 (15:30 +0200)]
reference the datastore in BackupGroup/Dir

And drop the base_path parameter on a first bunch of
functions (more reordering will follow).

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoapi-types: DataStoreConfig::new for testing
Wolfgang Bumiller [Wed, 20 Apr 2022 13:06:28 +0000 (15:06 +0200)]
api-types: DataStoreConfig::new for testing

so our examples can more easily access a datastore without
going over a configuration & cache

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoapi2: read_remote: also return RemoteWithoutPassword
Fabian Grünbichler [Wed, 20 Apr 2022 11:58:41 +0000 (13:58 +0200)]
api2: read_remote: also return RemoteWithoutPassword

like for the index, instead of manually stripping it.

this (and the previous change) is backwards-compatible since `Remote`
already skipped serializing empty strings, so the returned JSON is
identical.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agodatastore: cleanup and document backup group/dir openers
Wolfgang Bumiller [Wed, 20 Apr 2022 11:24:57 +0000 (13:24 +0200)]
datastore: cleanup and document backup group/dir openers

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodatastore: drop Hash from BackupGroup
Wolfgang Bumiller [Wed, 20 Apr 2022 11:08:43 +0000 (13:08 +0200)]
datastore: drop Hash from BackupGroup

same as for Eq/Ord/...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodatastore: drop PartialEq and PartialOrd from BackupGroup
Wolfgang Bumiller [Wed, 20 Apr 2022 10:23:13 +0000 (12:23 +0200)]
datastore: drop PartialEq and PartialOrd from BackupGroup

Same as previous commits: this will be linked to a
particular DataStore and Eq/Ord is now only part of the
api types, for now.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodatastore: drop Eq and PartialEq from BackupDir
Wolfgang Bumiller [Wed, 20 Apr 2022 10:21:50 +0000 (12:21 +0200)]
datastore: drop Eq and PartialEq from BackupDir

Same as previous commit: this is supposed to be connected to
a datastore and Eq/PartialEq only make sense for the
api-type part.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodatastore: drop Ord from BackupGroup
Wolfgang Bumiller [Wed, 20 Apr 2022 10:20:28 +0000 (12:20 +0200)]
datastore: drop Ord from BackupGroup

This one is supposed to be linked to a datastore instance,
so it won't be Ord for now.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomake datastore BackupGroup/Dir ctors private
Wolfgang Bumiller [Tue, 19 Apr 2022 08:38:46 +0000 (10:38 +0200)]
make datastore BackupGroup/Dir ctors private

And use the api-types for their contents.

These are supposed to be instances for a datastore, the pure
specifications are the ones in pbs_api_types which should be
preferred in crates like clients which do not need to deal
with the datastore directly.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoapi-types: use BackupType for GroupFilter::BackupType
Wolfgang Bumiller [Wed, 20 Apr 2022 09:45:53 +0000 (11:45 +0200)]
api-types: use BackupType for GroupFilter::BackupType

instead of a string

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agorename BackupDir's group_path to relative_group_path
Wolfgang Bumiller [Tue, 19 Apr 2022 07:45:22 +0000 (09:45 +0200)]
rename BackupDir's group_path to relative_group_path

datastore's group_path will be moved to BackupDir soon and
this is required to be able to properly distinguish them

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoapi-types: datastore type improvements
Wolfgang Bumiller [Tue, 19 Apr 2022 10:11:16 +0000 (12:11 +0200)]
api-types: datastore type improvements

let BackupGroup implement Hash

let BackupGroup and BackupDir be AsRef<BackupGroup>
let BackupDir be AsRef<BackupDir>

the pbs-datastore types will implement these AsRefs as well

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodatastore: remove unused list_files function
Wolfgang Bumiller [Wed, 20 Apr 2022 07:58:12 +0000 (09:58 +0200)]
datastore: remove unused list_files function

it also doesn't belong into this type

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodatastore: move last_backup from BackupInfo to BackupGroup
Wolfgang Bumiller [Wed, 20 Apr 2022 07:55:48 +0000 (09:55 +0200)]
datastore: move last_backup from BackupInfo to BackupGroup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoAuthId: derive Ord and PartialOrd
Dietmar Maurer [Wed, 20 Apr 2022 07:58:15 +0000 (09:58 +0200)]
AuthId: derive Ord and PartialOrd

So the we can sort...

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoRemoteWithoutPassword: new API type
Dietmar Maurer [Wed, 20 Apr 2022 07:40:05 +0000 (09:40 +0200)]
RemoteWithoutPassword: new API type

To make it explicit that we do not return the password.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoapi-types: introduce BackupType enum and Group/Dir api types
Wolfgang Bumiller [Thu, 14 Apr 2022 13:05:58 +0000 (15:05 +0200)]
api-types: introduce BackupType enum and Group/Dir api types

The type is a real enum.

All are API types and implement Display and FromStr. The
ordering is the same as it is in pbs-datastore.

Also, they are now flattened into a few structs instead of
being copied manually.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: add snapshot iterator and provide example
Thomas Lamprecht [Fri, 15 Apr 2022 10:24:56 +0000 (12:24 +0200)]
datastore: add snapshot iterator and provide example

will be more used in the future, when the upend-datastore master plan
comes in effect.

also a preparatory work for namespaces

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobackup: switch over to streaming Iterator improving memory usage
Thomas Lamprecht [Fri, 15 Apr 2022 10:20:51 +0000 (12:20 +0200)]
backup: switch over to streaming Iterator improving memory usage

Avoid collecting the whole group list in memory only to iterate and
filter over it again.

Note that the change could result in a indentation change, so best
viewed with `-w` flag.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: add helper to get a iterator for backup groups
Thomas Lamprecht [Fri, 15 Apr 2022 10:15:54 +0000 (12:15 +0200)]
datastore: add helper to get a iterator for backup groups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: implement Iterator for backup group listing
Thomas Lamprecht [Fri, 15 Apr 2022 09:02:36 +0000 (11:02 +0200)]
datastore: implement Iterator for backup group listing

While currently it's still only used in a collected() way, most call
sites can be switched over to use the iterator directly, as often
they already convert the not-so-cheap, in-memory vector back in
.into_iter() anyway.

somewhat also preparatory (yak shaving) work for namespaces

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi datastore: some code cleanups
Thomas Lamprecht [Fri, 15 Apr 2022 08:59:57 +0000 (10:59 +0200)]
api datastore: some code cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: backup info: drop deprecated list_backup_groups
Thomas Lamprecht [Fri, 15 Apr 2022 08:53:57 +0000 (10:53 +0200)]
datastore: backup info: drop deprecated list_backup_groups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoreplace deprecated list_backup_group from BackupInfo with Datastore one
Thomas Lamprecht [Fri, 15 Apr 2022 08:50:28 +0000 (10:50 +0200)]
replace deprecated list_backup_group from BackupInfo with Datastore one

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: move list_backup_groups into Datastore impl
Thomas Lamprecht [Fri, 15 Apr 2022 07:03:13 +0000 (09:03 +0200)]
datastore: move list_backup_groups into Datastore impl

Having that as static method in BackupInfo makes zero sense and just
complicates call sites, which need to extract the base_path from the
store manually upfront.

Mark old fn as deprecated so that we can do the move in a separate
step.

It's also planned to add an Iterator impl for this to allow more
efficient usage in the future.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoclient: rustfmt
Thomas Lamprecht [Thu, 14 Apr 2022 12:08:48 +0000 (14:08 +0200)]
client: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobackup client: rustfmt
Thomas Lamprecht [Thu, 14 Apr 2022 12:06:15 +0000 (14:06 +0200)]
backup client: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agotools: rustfmt
Thomas Lamprecht [Thu, 14 Apr 2022 12:05:17 +0000 (14:05 +0200)]
tools: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorust fmt for pbs src
Thomas Lamprecht [Thu, 14 Apr 2022 12:03:46 +0000 (14:03 +0200)]
rust fmt for pbs src

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoserver: rustfmt
Thomas Lamprecht [Thu, 14 Apr 2022 12:01:25 +0000 (14:01 +0200)]
server: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: rustfmt
Thomas Lamprecht [Thu, 14 Apr 2022 11:33:01 +0000 (13:33 +0200)]
api: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoconfig: rustfmt
Thomas Lamprecht [Thu, 14 Apr 2022 11:32:04 +0000 (13:32 +0200)]
config: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: rustfmt whole package
Thomas Lamprecht [Thu, 14 Apr 2022 11:27:53 +0000 (13:27 +0200)]
datastore: rustfmt whole package

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/changelog: fixup released
Thomas Lamprecht [Thu, 14 Apr 2022 07:48:00 +0000 (09:48 +0200)]
d/changelog: fixup released

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.1.6-1
Thomas Lamprecht [Wed, 13 Apr 2022 15:31:21 +0000 (17:31 +0200)]
bump version to 2.1.6-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocli: tape key-restore: print more info for better ux
Thomas Lamprecht [Wed, 13 Apr 2022 14:57:11 +0000 (16:57 +0200)]
cli: tape key-restore: print more info for better ux

as getting the marker error if we passed valid json (but not valid
key) is confusing

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: tape key restore: fix optional param handling and code refactoring
Thomas Lamprecht [Wed, 13 Apr 2022 14:51:14 +0000 (16:51 +0200)]
api: tape key restore: fix optional param handling and code refactoring

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-tape: api: restore_key-code moved to tape-encryption-keys
Markus Frank [Wed, 13 Apr 2022 09:30:04 +0000 (11:30 +0200)]
proxmox-tape: api: restore_key-code moved to tape-encryption-keys

The restore_key api-endpoint is tape/drive/{drive}/restore-key.
Since I cannot set the url parameter for the drivename to null or
undefined, when restoring by exported-key, I moved the
added restore_key-api-code to
"create_key aka POST api2/json/config/tape-encryption-keys" and
added an ApiHandler call in the cli's "restore_key" to call
"create_key" in the api.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
2 years agopbs-client: pxar: avoid some more clones
Wolfgang Bumiller [Wed, 13 Apr 2022 08:29:33 +0000 (10:29 +0200)]
pbs-client: pxar: avoid some more clones

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-client: pxar: avoid some vec extensions
Wolfgang Bumiller [Wed, 13 Apr 2022 08:27:59 +0000 (10:27 +0200)]
pbs-client: pxar: avoid some vec extensions

The `Components` `Iterator` has an `as_path()` method to get
the remainder as a borrowed path. This is more efficient
iterating and joining the components into a new `PathBuf`.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-client: pxar: drop link_to_pathbuf
Wolfgang Bumiller [Wed, 13 Apr 2022 08:18:30 +0000 (10:18 +0200)]
pbs-client: pxar: drop link_to_pathbuf

pxar's Hardlink and Symlink structs implement `AsRef<OsStr>`
and have an `.as_os_str()` method.

Simply use `Path::new(link)`.

Also, the function was not very well written, and we don't
always need an owned copy.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-client: pxar: fmt
Wolfgang Bumiller [Wed, 13 Apr 2022 08:17:20 +0000 (10:17 +0200)]
pbs-client: pxar: fmt

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: datastore/Content: enable tar download in ui
Dominik Csapak [Tue, 12 Apr 2022 11:04:18 +0000 (13:04 +0200)]
ui: datastore/Content: enable tar download in ui

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoapi: admin/datastore: add tar support for pxar_file_download
Dominik Csapak [Tue, 12 Apr 2022 11:04:17 +0000 (13:04 +0200)]
api: admin/datastore: add tar support for pxar_file_download

by using the newly added 'create_tar' and the 'ZstdEncoder'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-client: add 'create_tar' helper function
Dominik Csapak [Tue, 12 Apr 2022 11:04:16 +0000 (13:04 +0200)]
pbs-client: add 'create_tar' helper function

similar to create_zip, uses an accessor to write a tar into an output
that implements AsyncWrite, but we use a Decoder to iterate instead
of having a recursive function. This is done so that we get the
entries in the correct order, and it should be faster as well.

Includes files, directories, symlinks, hardlink, block/char devs, fifos
into the tar. If the hardlink points to outside the current dir to
archive, promote the first instance to a 'real' file, and use a
hardlink for the rest.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump proxmox-compression dependency to 0.1.1
Wolfgang Bumiller [Wed, 13 Apr 2022 07:37:20 +0000 (09:37 +0200)]
bump proxmox-compression dependency to 0.1.1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump d/control
Wolfgang Bumiller [Wed, 13 Apr 2022 06:21:18 +0000 (08:21 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump proxmox-schema dependency to 1.3.1 for streaming attribute
Wolfgang Bumiller [Wed, 13 Apr 2022 06:20:27 +0000 (08:20 +0200)]
bump proxmox-schema dependency to 1.3.1 for streaming attribute

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump proxmox-router dependency to 1.2
Wolfgang Bumiller [Wed, 13 Apr 2022 06:17:08 +0000 (08:17 +0200)]
bump proxmox-router dependency to 1.2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoapi: admin/datastore: enable streaming for some api calls
Dominik Csapak [Tue, 12 Apr 2022 14:15:10 +0000 (16:15 +0200)]
api: admin/datastore: enable streaming for some api calls

namely /admin/datastore/{store}/snapshots
and /nodes/{node}/tasks

since those are api calls where the result can get quite large
with this change, the serialization is now streaming instead of making
a `Value` in memory.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoadapt to the new ApiHandler variants
Dominik Csapak [Tue, 12 Apr 2022 14:15:09 +0000 (16:15 +0200)]
adapt to the new ApiHandler variants

namely 'StreamingSync' and 'StreamingAsync'
in rest-server by using the new formatter function,
and in the debug binary by using 'to_value'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoproxmox-rest-server: OutputFormatter: add new format_data_streaming method
Dominik Csapak [Tue, 12 Apr 2022 14:15:08 +0000 (16:15 +0200)]
proxmox-rest-server: OutputFormatter: add new format_data_streaming method

that takes the data in form of a `Box<dyn SerializableReturn + Send>`
instead of a Value.

Implement it in json and extjs formatter, by starting a thread and
stream the serialized data via a `BufWriter<SenderWriter>` and use
the Receiver side as a stream for the response body.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: datastore options: maintenance mode related refactorings
Thomas Lamprecht [Tue, 12 Apr 2022 14:52:14 +0000 (16:52 +0200)]
ui: datastore options: maintenance mode related refactorings

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: datastore options: fix active-ops-tracking store leak
Thomas Lamprecht [Tue, 12 Apr 2022 14:21:38 +0000 (16:21 +0200)]
ui: datastore options: fix active-ops-tracking store leak

without this the store stayed active in the background and kept
updating every 3s for every datastore the ui was opened.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: datastore options: factor out update stop/start to controller
Thomas Lamprecht [Tue, 12 Apr 2022 14:18:43 +0000 (16:18 +0200)]
ui: datastore options: factor out update stop/start to controller

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agotree-wide: replace serde_json::from_value(a_value.clone())
Wolfgang Bumiller [Tue, 12 Apr 2022 10:39:50 +0000 (12:39 +0200)]
tree-wide: replace serde_json::from_value(a_value.clone())

`&Value` itself implements `Deserializer` and can therefore
be passed directly to `T::deserialize` without requiring an
intermediate `clone()`. (This also enables optionally
borrowing strings if the result has a short enough lifetime)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: maintenance mode: also render message
Thomas Lamprecht [Tue, 12 Apr 2022 14:12:05 +0000 (16:12 +0200)]
ui: maintenance mode: also render message

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: maintenance mode: refactor renderer
Thomas Lamprecht [Tue, 12 Apr 2022 14:11:49 +0000 (16:11 +0200)]
ui: maintenance mode: refactor renderer

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: add option to change the maintenance type
Hannes Laimer [Tue, 12 Apr 2022 05:26:01 +0000 (05:26 +0000)]
ui: add option to change the maintenance type

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agoapi: add get_active_operations endpoint
Hannes Laimer [Tue, 12 Apr 2022 05:26:00 +0000 (05:26 +0000)]
api: add get_active_operations endpoint

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agoapi: make maintenance_type updatable
Hannes Laimer [Tue, 12 Apr 2022 05:25:59 +0000 (05:25 +0000)]
api: make maintenance_type updatable

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agopbs-datastore: add active operations tracking
Hannes Laimer [Tue, 12 Apr 2022 05:25:58 +0000 (05:25 +0000)]
pbs-datastore: add active operations tracking

Saves the currently active read/write operation counts in a file. The
file is updated whenever a reference returned by lookup_datastore is
dropped and whenever a reference is returned by lookup_datastore. The
files are locked before every access, there is one file per datastore.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agodatastore: add check for maintenance in lookup
Hannes Laimer [Tue, 12 Apr 2022 05:25:57 +0000 (05:25 +0000)]
datastore: add check for maintenance in lookup

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agoapi-types: add maintenance type
Hannes Laimer [Tue, 12 Apr 2022 05:25:56 +0000 (05:25 +0000)]
api-types: add maintenance type

+ bump proxmox-schema dep to 1.2.1 (for quoted property string)

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agoui: node config: avoid split listeners
Thomas Lamprecht [Mon, 11 Apr 2022 09:09:38 +0000 (11:09 +0200)]
ui: node config: avoid split listeners

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoclient: drop unnecessary clone
Wolfgang Bumiller [Tue, 12 Apr 2022 10:34:52 +0000 (12:34 +0200)]
client: drop unnecessary clone

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agotree wide: some stylistic clippy fixes
Thomas Lamprecht [Sun, 10 Apr 2022 16:33:32 +0000 (18:33 +0200)]
tree wide: some stylistic clippy fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi types: rust fmt
Thomas Lamprecht [Sun, 10 Apr 2022 15:53:42 +0000 (17:53 +0200)]
api types: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocli: backup manager: rust fmt
Thomas Lamprecht [Sun, 10 Apr 2022 15:50:35 +0000 (17:50 +0200)]
cli: backup manager: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agotests: rust fmt
Thomas Lamprecht [Sun, 10 Apr 2022 15:49:26 +0000 (17:49 +0200)]
tests: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agotape: rust fmt
Thomas Lamprecht [Sun, 10 Apr 2022 15:49:03 +0000 (17:49 +0200)]
tape: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorestore daemon: rust fmt
Thomas Lamprecht [Sun, 10 Apr 2022 15:47:20 +0000 (17:47 +0200)]
restore daemon: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoexamples: rust fmt
Thomas Lamprecht [Sun, 10 Apr 2022 15:44:34 +0000 (17:44 +0200)]
examples: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest server: log rotation: refactor and comment improvements
Thomas Lamprecht [Thu, 7 Apr 2022 12:04:18 +0000 (14:04 +0200)]
rest server: log rotation: refactor and comment improvements

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest server: log rotation: fix off-by-one for max_days
Thomas Lamprecht [Thu, 7 Apr 2022 10:57:03 +0000 (12:57 +0200)]
rest server: log rotation: fix off-by-one for max_days

The entries in a file go from oldest end-time in the first time to
newest end-time in the last line. So, just because the first line is
older than the cut-off time, the remaining one doesn't necessarily
have to be old enough too. What we can know for sure that older than
the current checked rotations of the task archive are definitively up
for deletion.

Another possibility would be to check the last line, but as scanning
backwards is more expensive/complex to do while only being an actual
improvement in a very specific edge case (it's more likely to have a
mixed time-cutoff vs. task-log-file boundary than that those are
aligned)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest-server: add option to rotate task logs by 'max_days' instead of 'max_files'
Dominik Csapak [Mon, 28 Mar 2022 07:54:19 +0000 (09:54 +0200)]
rest-server: add option to rotate task logs by 'max_days' instead of 'max_files'

and use it with the configurable: 'task_log_max_days' of the node config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoconfig/node: add 'task_log_max_days' config
Dominik Csapak [Mon, 28 Mar 2022 07:54:18 +0000 (09:54 +0200)]
config/node: add 'task_log_max_days' config

to be able to configure the maximum days to keep task logs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agorest-server: cleanup_old_tasks: improve error handling
Dominik Csapak [Mon, 28 Mar 2022 07:54:17 +0000 (09:54 +0200)]
rest-server: cleanup_old_tasks: improve error handling

by not bubbling up most errors, and continuing on. this avoids that we
stop cleaning up because e.g. one directory was missing.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agopbs tape: rust fmt
Thomas Lamprecht [Wed, 6 Apr 2022 15:00:29 +0000 (17:00 +0200)]
pbs tape: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopbs fuse loop: rust fmt
Thomas Lamprecht [Wed, 6 Apr 2022 14:59:54 +0000 (16:59 +0200)]
pbs fuse loop: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: client: file exclusion: add note about leading slash
Fabian Ebner [Mon, 28 Mar 2022 08:16:34 +0000 (10:16 +0200)]
docs: client: file exclusion: add note about leading slash

It's not documented yet and not intuitive:
https://forum.proxmox.com/threads/98810
https://forum.proxmox.com/threads/107143

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agopxar: create: add entry: fix anchored path pattern matching
Fabian Ebner [Mon, 28 Mar 2022 11:11:03 +0000 (13:11 +0200)]
pxar: create: add entry: fix anchored path pattern matching

Similar to 874bd545 ("pxar: fix anchored exclusion at archive root"),
but this time for inclusion. Because of the inconsistency, it could
happen that a file included in generate_directory_file_list() got
excluded in add_entry(), e.g. with a .pxarexclude file like
> *
> !/supposed-to-be-included

Reported-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agopxar bin: rust fmt
Thomas Lamprecht [Wed, 6 Apr 2022 14:58:04 +0000 (16:58 +0200)]
pxar bin: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopbs build config: rust fmt
Thomas Lamprecht [Wed, 6 Apr 2022 14:57:36 +0000 (16:57 +0200)]
pbs build config: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile restore: rust fmt
Thomas Lamprecht [Wed, 6 Apr 2022 14:57:07 +0000 (16:57 +0200)]
file restore: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorrd: rust fmt
Thomas Lamprecht [Wed, 6 Apr 2022 14:56:33 +0000 (16:56 +0200)]
rrd: rust fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>