Commit Graph

6516 Commits

Author SHA1 Message Date
Fabian Grünbichler ebfcf75e14 acl: fix handling of sub-components containing '/'
previously with an ACL for the path "/foo/bar" without propagation and a
check for `&["foo", "bar/baz"] this code would return the ACL (roles)
for "/foo/bar" for the path "/foo/bar/baz".

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-05-25 17:18:56 +02:00
Fabian Grünbichler 83e3000349 sync job: don't require privs on datastore
syncing to a namespace only requires privileges on the namespace (and
potentially its children during execution).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-05-25 17:18:56 +02:00
Fabian Grünbichler 4a4dd66c26 api: list snapshots: fix log param order
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-05-25 17:18:56 +02:00
Fabian Grünbichler b9b2d635fe sync job: fix worker ID parsing
the namespace is optional, but should be captured to allow ACL checks
for unprivileged non-job-owners.

also add FIXME for other job types and workers that (might) need
updating.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-05-25 17:18:56 +02:00
Fabian Grünbichler 9f8aa8c5e2 debug: recover: allow overriding output-path
including to STDOUT.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Hannes Laimer <h.laimer@proxmox.com>
2022-05-24 11:46:04 +02:00
Fabian Grünbichler b11693b2f7 debug: move outfile_or_stdout to module for reuse
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Hannes Laimer <h.laimer@proxmox.com>
2022-05-24 11:45:59 +02:00
Fabian Grünbichler 53435bc4d5 debug: recover: allow ignoring missing/corrupt chunks
replacing them with chunks of zero bytes.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Hannes Laimer <h.laimer@proxmox.com>
2022-05-24 11:45:54 +02:00
Dominik Csapak 8bec3ff691 tape/pool_writer: give proper types to 'contains_snapshot'
instead of a string. The underlying catalog implementation has to
care about how this is formatted, not the external caller

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-05-23 16:20:13 +02:00
Dominik Csapak 789e22d905 proxmox-tape: use correct api call for 'load-media-from-slot'
it's a 'post' api call, not 'put'

reported here:
https://forum.proxmox.com/threads/lto8.109946/
and here:
https://forum.proxmox.com/threads/cant-clear-tape.86454/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-05-23 16:14:41 +02:00
Fabian Grünbichler a1c30e0194 cargo fmt
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-05-23 16:12:22 +02:00
Fabian Grünbichler d4c6e68bf0 fix typo
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-05-23 15:05:38 +02:00
Thomas Lamprecht e642344f98 ui: datastore content: enable recursive/depth selector for prune all
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-19 13:35:01 +02:00
Thomas Lamprecht d4574bb138 ui: prune input: support opt-in recursive/max-depth field
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-19 13:34:17 +02:00
Thomas Lamprecht 26b40687b3 prune datastore: add depth info to tak log
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-19 13:32:45 +02:00
Thomas Lamprecht e3c26aea31 prune datastore: support max-depth and improve priv checks
use the relatively new variant of ListAccessibleBackupGroups to also
allow pruning the groups that one doesn't own but has the respective
privileges on their namespace level.

This was previously handled by the API endpoint itself, which was ok
as long as only one level was looked at.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-19 13:31:09 +02:00
Thomas Lamprecht 65aba79a9b prune datastore: rework tak log
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-19 13:23:24 +02:00
Thomas Lamprecht 4b6a653a0f verify filter: improve comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-19 12:36:51 +02:00
Thomas Lamprecht 3c41d86010 verify all: adhere to NS privs for non-owned groups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-19 12:36:06 +02:00
Thomas Lamprecht 93821e87e6 accessible group iter: rename "new" to "new_owned"
to clarify that it's only returning owned backups that way.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-19 12:34:06 +02:00
Thomas Lamprecht f12f408e91 api: datastore status: adhere to NS privs for non-owner
Not only check all owned backup groups, but also all that an auth_id
has DATASTORE_AUDIT or DATASTORE_READ on the whole namespace.

best viewed with whitespace change ignore (-w)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-19 12:32:35 +02:00
Thomas Lamprecht 71cad8cac0 accessible group iter: add owner override and owner + extra priv handling
The "owner override" privs will skip the owner check completely if
the authid has a permission for any of the bitwise OR'd privs
requested on the namespace level.

The "owner and privs" are for the case where being the owner is not
enough, e.g., pruning, if set they need to match all, not just any,
on the namespace, otherwise we don't even look at the groups from the
current NS level.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-19 12:27:58 +02:00
Thomas Lamprecht 49bea6b5d9 accessible group iter: allow NS descending with DATASTORE_READ
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-19 12:26:48 +02:00
Thomas Lamprecht f7247e2b84 ui: datastore content: add icons to top bar prune/verify buttons
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-18 18:37:20 +02:00
Thomas Lamprecht 5664b41c30 ui: acl view: make path column flex, but enforce minWidth
with namespaces the paths can get pretty complex, so make the path
column take some flex space too, but not too much to avoid making it
look odd for the short paths we have otherwise

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-18 18:22:17 +02:00
Thomas Lamprecht 33612525e1 ui: datastore permissions: allow ACL path edit & query namespaces
Without namespaces this had not much use, but now that we can have
permissions below we should allow so.

For convenience also query the namsepaces here and add them to the
list of available ACL paths, the read-dir shouldn't be that expensive
(albeit, we could cache them in the frontend)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-18 18:14:37 +02:00
Thomas Lamprecht a502bc5617 ui: small style cleanups/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-18 18:04:16 +02:00
Thomas Lamprecht 8772ca727c api types: verify job: fix doc comment typo
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-18 15:45:55 +02:00
Thomas Lamprecht 7f3b4a94e6 api types: verify job: allow outdated-afer == 0 for backward compat
We can have those in existing verify jobs configs, and that'd break
stuff. So, even while the "bad" commit got released only recently
with `2.1.6-1` (14 April 2022), we still need to cope with those that
used it, and using some serde parser magic to transform on read only
is hard here due to section config (json-value and verify currently
happen before we can do anything about it)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-18 15:39:59 +02:00
Thomas Lamprecht 327d14b3d1 Revert "verify: allow '0' days for reverification"
This reverts commit 7a1a5d206d.

We could already cause the behavior by simply setting ignore-verified
to false, aas that flag is basically an on/off switch for even
considering outdated-after or not.

So avoid the extra logic and just make the gui use the previously
existing way.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-18 12:53:08 +02:00
Thomas Lamprecht 0f8fd71093 cargo: update commented-out path patched dependencies
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-18 09:00:41 +02:00
Thomas Lamprecht 8d3b84e719 d/changelog: fixup last entry
as this obviously is released...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-18 08:45:53 +02:00
Thomas Lamprecht d1d328d582 bump version to 2.2.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 14:03:30 +02:00
Thomas Lamprecht 72e344a1b4 ui: namespace & maintenance mode: refer to onlineHelp
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 14:03:00 +02:00
Thomas Lamprecht f71a4ce6d6 docs: client usage: add some hints for namespace
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 13:55:21 +02:00
Thomas Lamprecht a3b1026753 docs: some textwidth cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 13:55:04 +02:00
Dominik Csapak 5e1b17018b ui: namespace selector: show picker empty text if no namespace
by filtering out the empty namespace from the api, and putting
manually a div with the grid-empty xclass around the gettext

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ T: reword commit message ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 13:40:27 +02:00
Thomas Lamprecht 9615d9a6b6 ui: tape restore: reword comment w.r.t. mapping value
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 13:35:55 +02:00
Dominik Csapak 3ae4dab4b9 ui: tape restore: fix form validation for datastore mapping
'defaultStore' can be '' or null, so check for truthyness also, we
want the mapping to be a formField so that the validation triggers
and the restore button gets en/disabled accordingly. We still have to
call 'getValue' manually, because the onGetValues will get it as
string instead of an array

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 13:35:21 +02:00
Oguz Bektas d74172bfc1 node info: fix typo in product name
s/Bacckup/Backup

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2022-05-17 13:30:36 +02:00
Thomas Lamprecht 2e9a9f94a4 update online help reference info
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 13:30:11 +02:00
Thomas Lamprecht ed9797d67e storage: add some initial namespace docs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 13:29:02 +02:00
Thomas Lamprecht 56f0ce27ac docs: storage: refer to options
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 13:28:50 +02:00
Thomas Lamprecht 67d4131158 docs: basic maintenance mode section
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 13:28:24 +02:00
Thomas Lamprecht acbb19498a docs: also mention Sync in heading of Managing Remotes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 13:28:05 +02:00
Thomas Lamprecht 187ec50488 docs: refer more to screenshots all over the place
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 13:27:37 +02:00
Thomas Lamprecht b3116e5680 docs: update and add screenshots
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 13:27:09 +02:00
Thomas Lamprecht 77baca66eb ui: datastore list: drop duplicate errorBox reference, neither is used
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 11:07:46 +02:00
Thomas Lamprecht e7ddae292a ui: datastore selector: move maintenance mode inline with icon
else it's a lot of wasted space for the ordinary case, that hasn't
permanent maintenance modes activated, and even if, their admins
should be used to it, so not the best space/usability ROI there
either.

Just use the icon as visual clue and add a tooltip for the
maintenance mode info.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 10:49:31 +02:00
Dominik Csapak c15b058db7 ui: form/DataStoreSelector: show maintenance mode in selector
to not having to query the activeTasks everywhere, change the renderer
to omit the check/spinner when no activeTasks are given

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-05-17 10:40:56 +02:00
Thomas Lamprecht 8af1fa5477 ui: use base 10 (SI) for all storage related displays
matches what we do for (most) of such things in PVE since 7.0 there
and also what the disk management gui shows, further disks are sold
with SI units for their advertised capacity, so its more fitting
there too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 10:21:26 +02:00