]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
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>
2 years agoclient: add --ns parameters to snapshot commands
Wolfgang Bumiller [Thu, 12 May 2022 08:59:54 +0000 (10:59 +0200)]
client: add --ns parameters to snapshot commands

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoclient: rename --backup-ns to --ns in backup command
Wolfgang Bumiller [Thu, 12 May 2022 08:43:56 +0000 (10:43 +0200)]
client: rename --backup-ns to --ns in backup command

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodocs: zfs: update documentation about ZED
Stoiko Ivanov [Wed, 11 May 2022 14:06:35 +0000 (14:06 +0000)]
docs: zfs: update documentation about ZED

This closely follows commit aa425868069818167ff0a3cca5c64a2acc88173e
in pve-docs.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agodocs: local-zfs: minor cleanup and adaptation
Stoiko Ivanov [Wed, 11 May 2022 14:06:34 +0000 (14:06 +0000)]
docs: local-zfs: minor cleanup and adaptation

fixes a few small glitches in the markup.

rephrases a few PVEisms (PBS will not swap when starting a backup to
an external storage)

add zstd to available compression algorithms

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agodocs: system-booting: (re)add screenshots
Stoiko Ivanov [Wed, 11 May 2022 14:06:33 +0000 (14:06 +0000)]
docs: system-booting: (re)add screenshots

add the grub+systemdboot screen from a PBS system (taken via
spice-viewer).

The alingment of left/right looked better to me than keeping both on the
right).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agodocs: add system-booting from pve-docs
Stoiko Ivanov [Wed, 11 May 2022 14:06:32 +0000 (14:06 +0000)]
docs: add system-booting from pve-docs

and transform to reST.

semantic changes to the content are:
* s/{pve}/`Proxmox Backup`_/g
* changing footnotes to parenthesized notes (did not see footnote use in
  the current docs)
* removed the comment about systems setup before the introduction of
  p-b-t (which was introduced before pbs)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agodocs: sysadmin: adapt kernel-specifics for PBS
Stoiko Ivanov [Wed, 11 May 2022 14:06:31 +0000 (14:06 +0000)]
docs: sysadmin: adapt kernel-specifics for PBS

while all statements here are technically true - adding all
virtualization improvements is not relevant for proxmox backup in most
cases.
The intel nic driver seems like a left-over from a time (pre PVE 5.1)
where the pve-kernel included the out-of-tree drivers.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agobump version to 2.1.9-1
Thomas Lamprecht [Thu, 12 May 2022 07:48:51 +0000 (09:48 +0200)]
bump version to 2.1.9-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: content: code cleanups
Thomas Lamprecht [Thu, 12 May 2022 07:19:08 +0000 (09:19 +0200)]
ui: content: code cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: content: show namespaces also inline and rework node type detection
Thomas Lamprecht [Thu, 12 May 2022 07:17:54 +0000 (09:17 +0200)]
ui: content: show namespaces also inline and rework node type detection

this not only makes the action disable/hide checks simpler, but also
prepares the view a bit for the idea of adding a new API endpoint
that returns the whole datastore content tree as structured JSON so
that it can be directly loaded into a tree store.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopull group: add error context for cleanup_unreferenced_files
Thomas Lamprecht [Wed, 11 May 2022 17:02:37 +0000 (19:02 +0200)]
pull group: add error context for cleanup_unreferenced_files

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: move update_manifest into BackupDir impl
Thomas Lamprecht [Wed, 11 May 2022 16:55:57 +0000 (18:55 +0200)]
datastore: move update_manifest into BackupDir impl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agosync: pull snapshot: use template variables for bloat reduction
Thomas Lamprecht [Wed, 11 May 2022 16:40:19 +0000 (18:40 +0200)]
sync: pull snapshot: use template variables for bloat reduction

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: move cleanup_unreferenced_files to BackupDir impl and fix NS awareness
Thomas Lamprecht [Wed, 11 May 2022 16:39:05 +0000 (18:39 +0200)]
datastore: move cleanup_unreferenced_files to BackupDir impl and fix NS awareness

sync failed on cleanup due to always trying to do so in the root NS

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: remote target selectors: code cleanups
Thomas Lamprecht [Wed, 11 May 2022 16:00:15 +0000 (18:00 +0200)]
ui: remote target selectors: code cleanups

just a small start...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: sync job: use namespace selector for localNS
Thomas Lamprecht [Wed, 11 May 2022 15:44:58 +0000 (17:44 +0200)]
ui: sync job: use namespace selector for localNS

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: move remote target datastore/ns selectors to own file
Thomas Lamprecht [Wed, 11 May 2022 15:34:34 +0000 (17:34 +0200)]
ui: move remote target datastore/ns selectors to own file

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: add namespace fields to sync
Fabian Grünbichler [Tue, 10 May 2022 13:02:23 +0000 (15:02 +0200)]
ui: add namespace fields to sync

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agosync/pull: make namespace aware
Fabian Grünbichler [Fri, 29 Apr 2022 11:46:14 +0000 (13:46 +0200)]
sync/pull: make namespace aware

Allow pulling all groups from a certain source namespace, and
possibly sub namespaces until max-depth, into a target namespace.

If any sub-namespaces get pulled, they will be mapped relatively from
the source parent namespace to the target parent namespace.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: verify job: fix add-job on datastore-agnostic level
Thomas Lamprecht [Wed, 11 May 2022 15:20:29 +0000 (17:20 +0200)]
ui: verify job: fix add-job on datastore-agnostic level

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: namespace selector: allow to set datastore dynamically
Thomas Lamprecht [Wed, 11 May 2022 15:19:26 +0000 (17:19 +0200)]
ui: namespace selector: allow to set datastore dynamically

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi-types: rework BackupNamespace::map_prefix
Wolfgang Bumiller [Wed, 11 May 2022 10:26:25 +0000 (12:26 +0200)]
api-types: rework BackupNamespace::map_prefix

to use slice::strip_prefix() from std

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: minor cleanup
Wolfgang Bumiller [Wed, 11 May 2022 10:19:49 +0000 (12:19 +0200)]
datastore: minor cleanup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: relative path fixup
Wolfgang Bumiller [Wed, 11 May 2022 10:17:45 +0000 (12:17 +0200)]
datastore: relative path fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: datastore content: make verify-all more flexible
Thomas Lamprecht [Wed, 11 May 2022 12:28:33 +0000 (14:28 +0200)]
ui: datastore content: make verify-all more flexible

allow to specify the namespace, max_depth and also the re-verify/skip
behavior.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: fix group backup comment NS awareness
Thomas Lamprecht [Wed, 11 May 2022 10:01:36 +0000 (12:01 +0200)]
ui: fix group backup comment NS awareness

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: verify job: make namespace and max-depth aware
Thomas Lamprecht [Wed, 11 May 2022 07:42:49 +0000 (09:42 +0200)]
ui: verify job: make namespace and max-depth aware

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: add verifyOutdatedAfter component
Thomas Lamprecht [Wed, 11 May 2022 12:17:26 +0000 (14:17 +0200)]
ui: add verifyOutdatedAfter component

mainly as separate component for the trigger

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoverify job: support max-depth config
Thomas Lamprecht [Wed, 11 May 2022 07:43:10 +0000 (09:43 +0200)]
verify job: support max-depth config

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: verify: support namespaces
Thomas Lamprecht [Tue, 10 May 2022 17:04:17 +0000 (19:04 +0200)]
api: verify: support namespaces

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoadd ns-recursive and acl/authid aware backup group iter
Thomas Lamprecht [Tue, 10 May 2022 17:03:01 +0000 (19:03 +0200)]
add ns-recursive and acl/authid aware backup group iter

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoremote scan/completion: add namespace support
Fabian Grünbichler [Thu, 5 May 2022 13:02:41 +0000 (15:02 +0200)]
remote scan/completion: add namespace support

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: add DatastoreWithNamespace helper struct
Fabian Grünbichler [Thu, 5 May 2022 08:58:26 +0000 (10:58 +0200)]
api: add DatastoreWithNamespace helper struct

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: fix wrong call to htmlEncode
Fabian Grünbichler [Tue, 10 May 2022 13:02:42 +0000 (15:02 +0200)]
ui: fix wrong call to htmlEncode

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: add namespace renderer
Fabian Grünbichler [Tue, 10 May 2022 13:01:48 +0000 (15:01 +0200)]
ui: add namespace renderer

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoclient: add basic namespace commands
Wolfgang Bumiller [Tue, 10 May 2022 13:55:14 +0000 (15:55 +0200)]
client: add basic namespace commands

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: ns management: fix permission checks
Thomas Lamprecht [Tue, 10 May 2022 13:21:05 +0000 (15:21 +0200)]
api: ns management: fix permission checks

we do not have normal GET variables available in the checks provided
by the rest server from the api macro, so do it manually.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: datastore: more NS awareness
Thomas Lamprecht [Tue, 10 May 2022 13:16:28 +0000 (15:16 +0200)]
ui: datastore: more NS awareness

verify is actually not yet ready in the backend

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: datastore content: show root node for better UX with NS
Thomas Lamprecht [Tue, 10 May 2022 13:15:29 +0000 (15:15 +0200)]
ui: datastore content: show root node for better UX with NS

that way it's easier to see on which NS one currently operates and
allows better distinguishing of root NS and some sub ns named "Root"

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi-types: allow empty namespace
Wolfgang Bumiller [Tue, 10 May 2022 12:40:34 +0000 (14:40 +0200)]
api-types: allow empty namespace

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoclient: don't pass empty backup-ns
Wolfgang Bumiller [Tue, 10 May 2022 12:35:06 +0000 (14:35 +0200)]
client: don't pass empty backup-ns

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: content view: improve empty text
Thomas Lamprecht [Tue, 10 May 2022 10:24:25 +0000 (12:24 +0200)]
ui: content view: improve empty text

reference NS so that users get a hint where they are currently
hierarchy-wise, and clarify that we found no *accessible* snapshots,
on this level, i.e., there can be some that we just cannot see due to
only having access on lover level NS or being different owners.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: namespace: return popped component
Fabian Grünbichler [Thu, 5 May 2022 11:47:26 +0000 (13:47 +0200)]
api: namespace: return popped component

helpful for places where namespaces need to be (re)created

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: datastore: further unify check helpers
Fabian Grünbichler [Tue, 10 May 2022 08:06:55 +0000 (10:06 +0200)]
api: datastore: further unify check helpers

this is the most common sequence of checks we have in this file, so
let's have a single place where we implement it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: datastore: load datastore & check owner helper
Fabian Grünbichler [Mon, 9 May 2022 16:03:05 +0000 (18:03 +0200)]
api: datastore: load datastore & check owner helper

these happen together very often.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: datastore: lookup after checking privs
Fabian Grünbichler [Mon, 9 May 2022 16:03:32 +0000 (18:03 +0200)]
api: datastore: lookup after checking privs

else this could leak existence of datastore.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: datastore: refactor priv checks
Fabian Grünbichler [Mon, 9 May 2022 15:41:57 +0000 (17:41 +0200)]
api: datastore: refactor priv checks

the helper now takes both high-privilege and lesser-privilege privs, so
the resulting bool can be used to quickly check whether additional
checks like group ownership are needed or not.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: datastore: unify access checks
Fabian Grünbichler [Mon, 9 May 2022 15:14:32 +0000 (17:14 +0200)]
api: datastore: unify access checks

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agosplit the namespace out of BackupGroup/Dir api types
Wolfgang Bumiller [Mon, 9 May 2022 13:39:29 +0000 (15:39 +0200)]
split the namespace out of BackupGroup/Dir api types

We decided to go this route because it'll most likely be
safer in the API as we need to explicitly add namespaces
support to the various API endpoints this way.

For example, 'pull' should have 2 namespaces: local and
remote, and the GroupFilter (which would otherwise contain
exactly *one* namespace parameter) needs to be applied for
both sides (to decide what to pull from the remote, and what
to *remove* locally as cleanup).

The *datastore* types still contain the namespace and have a
`.backup_ns()` getter.

Note that the datastore's `Display` implementations are no
longer safe to use as a deserializable string.

Additionally, some datastore based methods now have been
exposed via the BackupGroup/BackupDir types to avoid a
"round trip" in code.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: datastore prune: support passing namespace
Thomas Lamprecht [Fri, 6 May 2022 09:35:14 +0000 (11:35 +0200)]
ui: datastore prune: support passing namespace

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoprune: allow passing namespace
Thomas Lamprecht [Fri, 6 May 2022 09:27:15 +0000 (11:27 +0200)]
prune: allow passing namespace

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: datastore content: allow to create new namespace
Thomas Lamprecht [Fri, 6 May 2022 09:02:59 +0000 (11:02 +0200)]
ui: datastore content: allow to create new namespace

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: utils: also provided me.SAFE_ID_RE
Thomas Lamprecht [Fri, 6 May 2022 09:02:16 +0000 (11:02 +0200)]
ui: utils: also provided me.SAFE_ID_RE

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: datastore content: allow to select namespace to show
Thomas Lamprecht [Fri, 6 May 2022 07:27:11 +0000 (09:27 +0200)]
ui: datastore content: allow to select namespace to show

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: add namespace selector combobox
Thomas Lamprecht [Fri, 6 May 2022 07:26:47 +0000 (09:26 +0200)]
ui: add namespace selector combobox

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: backup create: enforce that namespace exists
Thomas Lamprecht [Thu, 5 May 2022 17:26:20 +0000 (19:26 +0200)]
api: backup create: enforce that namespace exists

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: backup create: make permission check namespace aware
Thomas Lamprecht [Thu, 5 May 2022 17:26:04 +0000 (19:26 +0200)]
api: backup create: make permission check namespace aware

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: datastore: make permission checks namespace aware
Thomas Lamprecht [Thu, 5 May 2022 17:07:28 +0000 (19:07 +0200)]
api: datastore: make permission checks namespace aware

We probably can combine the base permission + owner check, but for
now add explicit ones to upfront so that the change is simpler as
only one thing is done.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: namespace management endpoints
Thomas Lamprecht [Sun, 24 Apr 2022 18:24:42 +0000 (20:24 +0200)]
api: namespace management endpoints

allow to list any namespace with privileges on it and allow to create
and delete namespaces if the user has modify permissions on the parent
namespace.

Creation is only allowed if the parent NS already exists.

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