]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
2 years agoBackupDir: add group/dir accessors
Fabian Grünbichler [Mon, 16 May 2022 11:31:49 +0000 (13:31 +0200)]
BackupDir: add group/dir accessors

for getting the respective api type references for convenient
printing/logging.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoui: verify/sync: allow to optionally override ID again
Thomas Lamprecht [Mon, 16 May 2022 16:48:44 +0000 (18:48 +0200)]
ui: verify/sync: allow to optionally override ID again

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: namespace create: lookup datastore with corret operation
Thomas Lamprecht [Mon, 16 May 2022 16:26:55 +0000 (18:26 +0200)]
api: namespace create: lookup datastore with corret operation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: add maintenance mask to DataStoreListSummary
Hannes Laimer [Fri, 6 May 2022 09:58:58 +0000 (09:58 +0000)]
ui: add maintenance mask to DataStoreListSummary

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agodocs: acl path: add a namespace related example
Thomas Lamprecht [Mon, 16 May 2022 16:10:13 +0000 (18:10 +0200)]
docs: acl path: add a namespace related example

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: add namespace section to sync documentation
Fabian Grünbichler [Mon, 16 May 2022 13:48:46 +0000 (15:48 +0200)]
docs: add namespace section to sync documentation

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoRevert "fix #4001: datastore/catalog: add number of files to directory entry"
Thomas Lamprecht [Mon, 16 May 2022 15:51:01 +0000 (17:51 +0200)]
Revert "fix #4001: datastore/catalog: add number of files to directory entry"

causes trouble with UI and is inconsistent as its still missing in
file restore (daemon)

We probably want to use a separate property to safe this to avoid
confusion with size.

This reverts commit 66ad63bac23359b8ede822496f68ebde843cf988.

2 years agoui: verify outdated: disallow blank and drop wrong empty text
Thomas Lamprecht [Mon, 16 May 2022 14:46:06 +0000 (16:46 +0200)]
ui: verify outdated: disallow blank and drop wrong empty text

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: switch summary repo status to widget toolkit one
Thomas Lamprecht [Mon, 16 May 2022 13:55:01 +0000 (15:55 +0200)]
ui: switch summary repo status to widget toolkit one

Not only can we remove a few lines of duplicated code, we also get
the "link to repo management" for free.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: use regular versioned build-dependency
Fabian Grünbichler [Mon, 16 May 2022 13:51:47 +0000 (15:51 +0200)]
d/control: use regular versioned build-dependency

although the full variant is provided by the current librust-log-dev
package, it won't be once it gets bumped to the next upstream version.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoui: fix setting protection in namespace
Fabian Ebner [Mon, 16 May 2022 13:25:02 +0000 (15:25 +0200)]
ui: fix setting protection in namespace

The ns parameter would not be included previously.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agodocs: terminology: add namespaces and slightly restructure
Thomas Lamprecht [Mon, 16 May 2022 13:28:00 +0000 (15:28 +0200)]
docs: terminology: add namespaces and slightly restructure

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuild: bump required log version
Fabian Grünbichler [Mon, 16 May 2022 13:02:07 +0000 (15:02 +0200)]
build: bump required log version

else logging using "{var}" in format strings doesn't work properly.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoclient: add completion callbacks for ns parameters
Wolfgang Bumiller [Mon, 16 May 2022 09:13:37 +0000 (11:13 +0200)]
client: add completion callbacks for ns parameters

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-client: namespace completion helper
Wolfgang Bumiller [Mon, 16 May 2022 09:13:17 +0000 (11:13 +0200)]
pbs-client: namespace completion helper

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 2.2.0-1
Thomas Lamprecht [Mon, 16 May 2022 09:06:10 +0000 (11:06 +0200)]
bump version to 2.2.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: add "Objects and Paths" section and fix perm scrot
Thomas Lamprecht [Mon, 16 May 2022 08:56:12 +0000 (10:56 +0200)]
docs: add "Objects and Paths" section and fix perm scrot

we show the add-user one twice in this chapter, one should actually
be add-permission

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi types: namespace: fix typo in error message
Thomas Lamprecht [Mon, 16 May 2022 07:50:10 +0000 (09:50 +0200)]
api types: namespace: fix typo in error message

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopull: use API BackupDir for log messages
Fabian Grünbichler [Mon, 16 May 2022 07:30:20 +0000 (09:30 +0200)]
pull: use API BackupDir for log messages

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoapi types: BackupNamespace: fix depth check on pushing subdir to ns
Thomas Lamprecht [Mon, 16 May 2022 07:16:46 +0000 (09:16 +0200)]
api types: BackupNamespace: fix depth check on pushing subdir to ns

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi types: BackupNamespace: remove unused, commented out code
Thomas Lamprecht [Mon, 16 May 2022 07:13:00 +0000 (09:13 +0200)]
api types: BackupNamespace: remove unused, commented out code

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: ns iter: clamp depth to MAX_NAMESPACE_DEPTH from datastore root
Thomas Lamprecht [Mon, 16 May 2022 07:10:01 +0000 (09:10 +0200)]
datastore: ns iter: clamp depth to MAX_NAMESPACE_DEPTH from datastore root

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: permission path selector: add some more path suggestions
Thomas Lamprecht [Mon, 16 May 2022 06:44:49 +0000 (08:44 +0200)]
ui: permission path selector: add some more path suggestions

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: rework access control, list available privileges
Thomas Lamprecht [Mon, 16 May 2022 06:00:40 +0000 (08:00 +0200)]
docs: rework access control, list available privileges

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: datastore: use safe destroy as base for dialog
Thomas Lamprecht [Sun, 15 May 2022 14:47:42 +0000 (16:47 +0200)]
ui: datastore: use safe destroy as base for dialog

only ask the name of the current NS, not the full NS path to avoid
too long input requirements on deep levels.

needs a few smaller hacks, ideally we would pull out the basic stuff
from Edit window in some EditBase window and let both, SafeDestroy
and Edit window derive from that, for better common, in sync
features.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agonamespace deletion: propagate delete-groups=false but ENOTEMPTY as error
Thomas Lamprecht [Sun, 15 May 2022 14:32:46 +0000 (16:32 +0200)]
namespace deletion: propagate delete-groups=false but ENOTEMPTY as error

after all we couldn't delete all that got requested, ideally this
should become a task where we can log what got deleted and what
not...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: datastore: allow deleting currently shown namespace
Thomas Lamprecht [Sun, 15 May 2022 14:04:49 +0000 (16:04 +0200)]
ui: datastore: allow deleting currently shown namespace

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: content: reload tree on succesful datastore add
Thomas Lamprecht [Sun, 15 May 2022 14:03:16 +0000 (16:03 +0200)]
ui: content: reload tree on succesful datastore add

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: tree NS entries: remove commented out qtip
Thomas Lamprecht [Sun, 15 May 2022 14:02:37 +0000 (16:02 +0200)]
ui: tree NS entries: remove commented out qtip

we won't use that, it's to invasive

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: cargo fmt
Thomas Lamprecht [Sun, 15 May 2022 14:01:57 +0000 (16:01 +0200)]
api: cargo fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: clippy fixes
Thomas Lamprecht [Sun, 15 May 2022 14:01:09 +0000 (16:01 +0200)]
datastore: clippy fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: move backup dir/group/namespace iter to own module
Thomas Lamprecht [Sun, 15 May 2022 13:59:40 +0000 (15:59 +0200)]
datastore: move backup dir/group/namespace iter to own module

no changes in interface for users of the crate as we re-export
anyway, so more for avoiding to crowd the datastore module to much

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: content: fix tooltip for forgetting snapshot
Thomas Lamprecht [Sun, 15 May 2022 12:08:24 +0000 (14:08 +0200)]
ui: content: fix tooltip for forgetting snapshot

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agonamespace deletion: make destroying groups separate choice
Thomas Lamprecht [Sun, 15 May 2022 11:50:58 +0000 (13:50 +0200)]
namespace deletion: make destroying groups separate choice

And make that opt-in in the API endpoint, to avoid bad surprises by
default.

If not set we'll only prune empty namespaces.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #4001: ui: add prefix to files downloaded through the pxar browser
Stefan Sterz [Thu, 5 May 2022 13:52:52 +0000 (15:52 +0200)]
fix #4001: ui: add prefix to files downloaded through the pxar browser

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #4001: datastore/catalog: add number of files to directory entry
Stefan Sterz [Thu, 5 May 2022 13:52:51 +0000 (15:52 +0200)]
fix #4001: datastore/catalog: add number of files to directory entry

When listing the content of a catalog, add the number of files
contained in the directory as its size. Also removes redundant code,
the `mtime` and the `size` of a file is already set when creating the
archive entry, but we naturally need to override the size now for
directories.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: prune all: add namespace info in title
Thomas Lamprecht [Sat, 14 May 2022 16:57:05 +0000 (18:57 +0200)]
ui: prune all: add namespace info in title

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: move prune input panel into own file
Thomas Lamprecht [Sat, 14 May 2022 16:51:54 +0000 (18:51 +0200)]
ui: move prune input panel into own file

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: prune group: add NS info to title
Thomas Lamprecht [Sat, 14 May 2022 16:47:12 +0000 (18:47 +0200)]
ui: prune group: add NS info to title

restructure it a bit for better UX

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: remote target ns selector: add clear trigger
Thomas Lamprecht [Sat, 14 May 2022 16:40:51 +0000 (18:40 +0200)]
ui: remote target ns selector: add clear trigger

like we have for the local NS selector

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: improve render_optional_namespace slighly
Thomas Lamprecht [Sat, 14 May 2022 16:39:52 +0000 (18:39 +0200)]
ui: improve render_optional_namespace slighly

it maybe should still simple get dropped and replaced with
(empty)Text 'Root' or 'Root Namespace'

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: remote target ns selector: fix clearing value on edit
Thomas Lamprecht [Sat, 14 May 2022 16:29:09 +0000 (18:29 +0200)]
ui: remote target ns selector: fix clearing value on edit

never makes sense to clear the value due to remote or remoteStore
change as we weren't enabled then in the first place.

This fixes clearing the currently set namespace on editing an
existing job, which always made it seem like the Root namespace was
selected, even if the originalValue was correct (thus the dirty-form
reset/ok behaviour still worked, making it even more confusing)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoclient: make change-owner and prune namespace aware
Thomas Lamprecht [Sat, 14 May 2022 15:16:25 +0000 (17:16 +0200)]
client: make change-owner and prune namespace aware

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agohierachy: ListAccessibleBackupGroups make store also a lifetime'd ref
Thomas Lamprecht [Sat, 14 May 2022 12:56:32 +0000 (14:56 +0200)]
hierachy: ListAccessibleBackupGroups make store also a lifetime'd ref

avoid some extra Arc::clone, even if they're not really expensive
(just some atomics)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: maintenance mode: opinionated code cleanup
Thomas Lamprecht [Sat, 14 May 2022 12:51:57 +0000 (14:51 +0200)]
ui: maintenance mode: opinionated code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: ACL edit: set default focus on a non-combobox element
Thomas Lamprecht [Sat, 14 May 2022 12:50:38 +0000 (14:50 +0200)]
ui: ACL edit: set default focus on a non-combobox element

to avoid making it "jump" in the users face by immediately opening
the picker on window open.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: namespace selector: set queryMode to local
Thomas Lamprecht [Sat, 14 May 2022 12:48:31 +0000 (14:48 +0200)]
ui: namespace selector: set queryMode to local

to avoid that the comobox triggers automatic API request with the
queryParam default `query` GET param on manual typing (e.g., for
filtering) from the user, we have all data already loaded and locally
available.

https://docs.sencha.com/extjs/7.0.0/classic/Ext.form.field.ComboBox.html#cfg-queryMode

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: trigger datastore update after maintenance mode edit
Thomas Lamprecht [Sat, 14 May 2022 12:38:58 +0000 (14:38 +0200)]
ui: trigger datastore update after maintenance mode edit

This provides immediate feedback for adding the respective icon in
the navigation tree entry most of the time, and we can then increase
the query period of the datastore list store to the original 15
again, as it was lowered to 5 seconds for just this reason in commit
fbd6f54f39b243e5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: fix storeId casing to register store correctly
Thomas Lamprecht [Sat, 14 May 2022 10:28:01 +0000 (12:28 +0200)]
ui: fix storeId casing to register store correctly

we query that store to add the datastore specific ACL paths to
improve UX there, this failed a while due the StoreManager lookup
always failing as the store wasn't registered in the StoreManager due
to using storeid vs. correct storeId

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocargo fmt
Thomas Lamprecht [Fri, 13 May 2022 14:59:32 +0000 (16:59 +0200)]
cargo fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: datastore status: make counts recurse over all accesible namespaces
Thomas Lamprecht [Fri, 13 May 2022 14:49:42 +0000 (16:49 +0200)]
api: datastore status: make counts recurse over all accesible namespaces

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agohierachy: add lifetime to ListAccessibleBackupGroups so that owner can be ref
Thomas Lamprecht [Fri, 13 May 2022 14:48:56 +0000 (16:48 +0200)]
hierachy: add lifetime to ListAccessibleBackupGroups so that owner can be ref

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: tape: add information about namespaces
Dominik Csapak [Fri, 13 May 2022 13:39:39 +0000 (15:39 +0200)]
docs: tape: add information about namespaces

which are backed up, how to use the new parameters and how to map
them during restore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodocs: tape/restore: mention single snapshot restore
Dominik Csapak [Fri, 13 May 2022 13:39:38 +0000 (15:39 +0200)]
docs: tape/restore: mention single snapshot restore

what it is, how to use it and the caveats

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodocs: tape: remove note about global content namespace
Dominik Csapak [Fri, 13 May 2022 13:39:37 +0000 (15:39 +0200)]
docs: tape: remove note about global content namespace

that is actually not true, we save the datastore in the chunk archives
as well as the snapshot archives, otherwise we could not backup
multiple datastores to a single media-set.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agocli: proxmox-tape: fix ns/depth parameter
Dominik Csapak [Fri, 13 May 2022 13:39:36 +0000 (15:39 +0200)]
cli: proxmox-tape: fix ns/depth parameter

was forgotten after recent rebase

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agobump version to 2.1.10-1
Thomas Lamprecht [Fri, 13 May 2022 12:26:37 +0000 (14:26 +0200)]
bump version to 2.1.10-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: adapt to s/backup-ns/ns/ api param change
Thomas Lamprecht [Fri, 13 May 2022 12:21:52 +0000 (14:21 +0200)]
ui: adapt to s/backup-ns/ns/ api param change

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: tape/Restore: allow simple namespace mapping
Dominik Csapak [Fri, 13 May 2022 11:44:30 +0000 (13:44 +0200)]
ui: tape/Restore: allow simple namespace mapping

add a default namespace selector (of the current default store)
and a namespace selector per target datastore (for media-sets with
multiple datastores).

to achieve that we have to change the way we handle the mapping field a bit:
* don't use it as field directly (otherwise the value gets stringified),
  but use the 'getValue' method in 'onGetValues'.
* set the defaultStore there, not only that we have one
  (with this we can now easily show it as emptytext for each store)
* add a reference to the widgets to the record so that we can access
  them in the respective change handler (also clean those references up,
  else we have a cyclic reference between record <-> widget)

in onGetValues, if we have multiple datastores, the mapping grid does
all the work for us, otherwise, we have to create the ns mapping
ourselves there.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: tape/BackupJobEdit: add onlineHelp
Dominik Csapak [Fri, 13 May 2022 07:59:57 +0000 (09:59 +0200)]
ui: tape/BackupJobEdit: add onlineHelp

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: tape/Backup: add namespace + max-depth to backup job edit window
Dominik Csapak [Fri, 13 May 2022 07:09:14 +0000 (09:09 +0200)]
ui: tape/Backup: add namespace + max-depth to backup job edit window

like we do for sync

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: tape/Backup: add namespace and recursion field for manual backup
Dominik Csapak [Fri, 13 May 2022 06:34:11 +0000 (08:34 +0200)]
ui: tape/Backup: add namespace and recursion field for manual backup

and change the layout to two columns, because the window was getting
too tall.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: tape/backup: fix namespace/max-depth parameters
Dominik Csapak [Fri, 13 May 2022 07:06:11 +0000 (09:06 +0200)]
api: tape/backup: fix namespace/max-depth parameters

by adding the 'default' serde hint and renaming 'recursion_depth' to
'max_depth' (to be in line with sync job config)

also add the logic to actually add/update the tape backup job config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: tape/BackupOverview: show namespaces as their own level above groups
Dominik Csapak [Thu, 12 May 2022 14:23:26 +0000 (16:23 +0200)]
ui: tape/BackupOverview: show namespaces as their own level above groups

since the namespaces are in the snapshot path we get here, we must parse
them out, else we confuse the first namespace with the group.

for now, show all namespaces on the same level (so not nested), and
do not allow for preselecting a namespace for restoring

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotape: media catalog: use match for magic check
Fabian Grünbichler [Wed, 11 May 2022 12:57:52 +0000 (14:57 +0200)]
tape: media catalog: use match for magic check

like in other parts of the code

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agotape: bump catalog/snapshot archive magic
Fabian Grünbichler [Wed, 11 May 2022 12:54:18 +0000 (14:54 +0200)]
tape: bump catalog/snapshot archive magic

the snapshot string format is not backwards compatible since it now has
an in-line namespace prefix. it's possible to select which magic to use
at the start of the backup, since a tape backup job knows whether it
operates on non-root namespaces up-front.

the MediaCatalog itself also has a similar incompatible change, but
there
- updating existing catalogs in-place
- not knowing what the catalog will contain in the future when initially
  creating/opening it
makes bumping the magic there harder. since the tape contents are
sufficiently guarded by the other two bumps, ignoring the
backwards-incomaptible change of the on-disk catalogs seems like an okay
tradeoff.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoapi: tape/restore: add namespace mapping
Dominik Csapak [Thu, 5 May 2022 13:59:36 +0000 (15:59 +0200)]
api: tape/restore: add namespace mapping

by adding a new parameter 'namespaces', which contains a mapping
for a namespace like this:

store=datastore,source=foo,target=bar,max-depth=2

if source or target are omitted the root namespace is used for its value

this mapping can be given several times (on the cli) or as an array (via
api) to have mappings for multiple datastores

if a specific snapshot list is given simultaneously, the given snapshots
will be restored according to this mapping, or to the source namespace
if no mapping was found.

to do this, we reutilize the restore_list_worker, but change it so that
it does not hold a lock for the duration of the restore, but fails
if the snapshot does exist at the end. also the snapshot will now
be temporarily restored into the target datastore into the
'.tmp/<media-set-uuid>' folder.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: tape/restore: check and create target namespace
Dominik Csapak [Fri, 6 May 2022 14:44:16 +0000 (16:44 +0200)]
api: tape/restore: check and create target namespace

checks the privilegs for the target namespace. If that does not exist,
try to recursively create them while checking the privileges.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi: tape/restore: add optional namespace map to DataStoreMap
Dominik Csapak [Thu, 5 May 2022 13:54:50 +0000 (15:54 +0200)]
api: tape/restore: add optional namespace map to DataStoreMap

and change the interface from 'get_datastore' to 'get_targets'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotape: add namespaces mapping type
Dominik Csapak [Thu, 5 May 2022 12:12:36 +0000 (14:12 +0200)]
tape: add namespaces mapping type

and the relevant parser for it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotape: add namespaces/recursion depth to tape backup jobs
Dominik Csapak [Tue, 3 May 2022 06:06:34 +0000 (08:06 +0200)]
tape: add namespaces/recursion depth to tape backup jobs

and manual api via TapeBackupJobSetup

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotape: fix snapshot path in catalog and snapshot_archive
Dominik Csapak [Tue, 10 May 2022 14:09:42 +0000 (16:09 +0200)]
tape: fix snapshot path in catalog and snapshot_archive

both used the 'Display' trait of pbs_datastore::BackupDir, which is not
intended to be serialized anywhere. Instead, manually format the path
using the print_ns_and_snapshot helper, and conversely, parse with
'parse_ns_and_snapshot'. to be a bit safer, change the register_snapshot
signature to take a BackupNamespace and BackupDir instead of a string.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agopbs-api-types: add parse and print ns_and_snapshot
Dominik Csapak [Tue, 10 May 2022 14:06:41 +0000 (16:06 +0200)]
pbs-api-types: add parse and print ns_and_snapshot

these are helpers for the few cases where we want to print and parse
from a format that has the namespace and snapshot combined, like for
the on-tape catalog and snapshot archive.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotape: notify when arriving at end of media
Dominik Csapak [Tue, 3 May 2022 06:07:08 +0000 (08:07 +0200)]
tape: notify when arriving at end of media

when continuing a media set, we first move to the end of the tape and
start with the next (chunk) archive. If that takes long, the task logs
last line is 'moving to end of media' even if we already startet
writing. To make this less confusing, log that we arrived at the
end of the media.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agotree-wide: rename 'backup-ns' API parameters to 'ns'
Wolfgang Bumiller [Fri, 13 May 2022 11:04:05 +0000 (13:04 +0200)]
tree-wide: rename 'backup-ns' API parameters to 'ns'

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: move max NS prefix length logic to reduced max-depth selector
Thomas Lamprecht [Fri, 13 May 2022 11:14:53 +0000 (13:14 +0200)]
ui: move max NS prefix length logic to reduced max-depth selector

for better re-usability in the future and it felt a bit odd to have
such specific logic in the sync job edit directly

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: inline some format variables
Thomas Lamprecht [Fri, 13 May 2022 10:41:45 +0000 (12:41 +0200)]
datastore: inline some format variables

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi types: set NS_MAX_DEPTH schema default to MAX_NAMESPACE_DEPTH
Thomas Lamprecht [Fri, 13 May 2022 09:41:35 +0000 (11:41 +0200)]
api types: set NS_MAX_DEPTH schema default to MAX_NAMESPACE_DEPTH

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: group filter: make also local filter NS aware
Thomas Lamprecht [Fri, 13 May 2022 08:27:48 +0000 (10:27 +0200)]
ui: group filter: make also local filter NS aware

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: sync: add reduced max-depth selector
Fabian Grünbichler [Fri, 13 May 2022 09:55:54 +0000 (11:55 +0200)]
ui: sync: add reduced max-depth selector

that allows setting the limit based on sync namespace prefix lengths.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agopull/sync: clamp (local) max-depth if unset
Fabian Grünbichler [Fri, 13 May 2022 09:33:08 +0000 (11:33 +0200)]
pull/sync: clamp (local) max-depth if unset

to handle the unlikely case of `ns` being deeper than `remote-ns`,
`max-depth` being set to `None` and a too-deep sub-ns of `ns` existing.
such a sub-ns cannot have been created by a previous run of this sync
job, so avoid unexpectedly removing it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoapi: split max-depth schema/types
Fabian Grünbichler [Fri, 13 May 2022 09:26:55 +0000 (11:26 +0200)]
api: split max-depth schema/types

into the regular one (with default == MAX) and the one used for
pull/sync, where the default is 'None' which actually means the remote
end reduces the scope of sync automatically (or, if needed,
backwards-compat mode without any remote namespaces at all).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agonamespaces: move max-depth check to api type
Fabian Grünbichler [Fri, 13 May 2022 09:25:01 +0000 (11:25 +0200)]
namespaces: move max-depth check to api type

and use it when creating a sync job, and simplify the check on updating
(only check the final, resulting config instead of each intermediate
version).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agopull/sync: correctly query with remote-ns as parent
Fabian Grünbichler [Fri, 13 May 2022 09:25:47 +0000 (11:25 +0200)]
pull/sync: correctly query with remote-ns as parent

else (grand)-parents and siblings/cousins of remote-ns are also
included, and mapping the remote-ns prefix fails.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agopull/sync: detect remote lack of namespace support
Fabian Grünbichler [Thu, 12 May 2022 14:48:42 +0000 (16:48 +0200)]
pull/sync: detect remote lack of namespace support

and fall back to only syncing the root namespace, if possible. the sync
job will still be marked as failed to prompt the admin to resolve the
situation:
- explicitly mark the job as syncing *only* the root namespace
- or upgrade remote end to support namespaces

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agopull/sync: treat unset max-depth as full recursion
Fabian Grünbichler [Thu, 12 May 2022 14:44:52 +0000 (16:44 +0200)]
pull/sync: treat unset max-depth as full recursion

to be consistent with tape backup and verification jobs.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agopull: pass params as non-ref in pull_store
Fabian Grünbichler [Thu, 12 May 2022 14:22:09 +0000 (16:22 +0200)]
pull: pass params as non-ref in pull_store

so that it's possible to modify them in-place without cloning.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agodatastore: drop bogus chunk size check, can cause trouble
Thomas Lamprecht [Thu, 12 May 2022 13:40:55 +0000 (15:40 +0200)]
datastore: drop bogus chunk size check, can cause trouble

other sizes can happen in legitimate and illegitimate ways:
 - illegitimate: encryped chunks and bad actor client
 - legitimate: same chunk but newer zstd version (or compression
   level) can compress it better (or worse) so the

Ideally we could take the actual smaller chunk so that improved zstd
tech gets leveraged, but we could only allow to do that for
un-encrypted ones.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.1.9-2
Thomas Lamprecht [Thu, 12 May 2022 12:25:57 +0000 (14:25 +0200)]
bump version to 2.1.9-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: navigation tree: fix losing datastore selection on store load
Dominik Csapak [Thu, 12 May 2022 12:23:52 +0000 (14:23 +0200)]
ui: navigation tree: fix losing datastore selection on store load

instead of using 'replaceChild', simply set the appropriate
properties. When using the 'nodeUpdate' (protected function of extjs,
intended to be overwritten) instead of the private 'updateNode', it
will be called when the properties change

This way, the treenode stays the same and it can keep the selection

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agofile-restore: add namespace support to qemu part
Wolfgang Bumiller [Thu, 12 May 2022 11:27:16 +0000 (13:27 +0200)]
file-restore: add namespace support to qemu part

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: content: fix various tree-checks from action handlers
Thomas Lamprecht [Thu, 12 May 2022 10:55:37 +0000 (12:55 +0200)]
ui: content: fix various tree-checks from action handlers

they all still used some odd side effects of the tree structure to
decided what record type they operated on, just move them over to the
new `ty` record.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest: example: fix comment width
Thomas Lamprecht [Thu, 12 May 2022 09:57:51 +0000 (11:57 +0200)]
rest: example: fix comment width

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocargo fmt
Thomas Lamprecht [Thu, 12 May 2022 09:54:21 +0000 (11:54 +0200)]
cargo fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest server: daemon: update PID file before sending MAINPID notification
Fabian Ebner [Wed, 4 May 2022 11:33:24 +0000 (13:33 +0200)]
rest server: daemon: update PID file before sending MAINPID notification

There is a race upon reload, where it can happen that:
1. systemd forks off /bin/kill -HUP $MAINPID
2. Current instance forks off new one and notifies systemd with the
   new MAINPID.
3. systemd sets new MAINPID.
4. systemd receives SIGCHLD for the kill process (which is the current
   control process for the service) and reads the PID of the old
   instance from the PID file, resetting MAINPID to the PID of the old
   instance.
5. Old instance exits.
6. systemd receives SIGCHLD for the old instance, reads the PID of the
   old instance from the PID file once more. systemd sees that the
   MAINPID matches the child PID and considers the service exited.
7. systemd receivese notification from the new PID and is confused.
   The service won't get active, because the notification wasn't
   handled.

To fix it, update the PID file before sending the MAINPID
notification, similar to what a comment in systemd's
src/core/service.c suggests:
> /* Forking services may occasionally move to a new PID.
>  * As long as they update the PID file before exiting the old
>  * PID, they're fine. */
but for our Type=notify "before sending the notification" rather than
"before exiting", because otherwise, the mix-up in 4. could still
happen (although it might not actually be problematic without the
mix-up in 6., it still seems better to avoid).

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoui: avoid ascending to upper NS on double click of current
Thomas Lamprecht [Thu, 12 May 2022 09:48:27 +0000 (11:48 +0200)]
ui: avoid ascending to upper NS on double click of current

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: add namespace: preselect current NS as parent for new one
Thomas Lamprecht [Thu, 12 May 2022 09:47:14 +0000 (11:47 +0200)]
ui: add namespace: preselect current NS as parent for new one

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoGC scheduling: avoid triggering operation tracking error for upfront checks
Thomas Lamprecht [Thu, 12 May 2022 09:34:48 +0000 (11:34 +0200)]
GC scheduling: avoid triggering operation tracking error for upfront checks

without that one gets a "failed to lookup datastore X" in the log for
every datastore that is in read-only or offline maintenance mode,
even if they aren't scheduled for GC anyway.

Avoid that by first opening the datastore through a Lookup operation,
and only re-open it as Write op once we know that GC needs to get
scheduled for it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: add new Lookup for operations tracking
Thomas Lamprecht [Thu, 12 May 2022 09:31:07 +0000 (11:31 +0200)]
datastore: add new Lookup for operations tracking

We sometimes need to do some in-memory only stuff, e.g., to check if
GC is already running for a datastore, which is a try_lock on a mutex
that is in-memory.

Actually the whole thing would be nicer if we could guarantee to hold
the correct contract statically, e.g., like
https://docs.rust-embedded.org/book/static-guarantees/design-contracts.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxy: rrd: skip update disk stats for offline datastores
Hannes Laimer [Wed, 4 May 2022 05:49:06 +0000 (05:49 +0000)]
proxy: rrd: skip update disk stats for offline datastores

RDD update did not use lookup_datastore() and therefore bypassed
the maintenance mode checks. This adds the needed check directly.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>