]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
3 years agoverify: introduce & use new Datastore.Verify privilege
Fabian Grünbichler [Fri, 30 Oct 2020 11:36:39 +0000 (12:36 +0100)]
verify: introduce & use new Datastore.Verify privilege

for verifying a whole datastore. Datastore.Backup now allows verifying
only backups owned by the triggering user.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoprivs: use Datastore.Modify|Backup to set backup notes
Fabian Grünbichler [Fri, 30 Oct 2020 11:36:38 +0000 (12:36 +0100)]
privs: use Datastore.Modify|Backup to set backup notes

Datastore.Backup is limited to owned groups, as usual.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoprivs: allow reading notes with Datastore.Audit
Fabian Grünbichler [Fri, 30 Oct 2020 11:36:37 +0000 (12:36 +0100)]
privs: allow reading notes with Datastore.Audit

they are returned when reading the manifest, which just requires
Datastore.Audit as well. Datastore.Read is for reading backup contents,
not metadata.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoui: permission path selector: cbind typeAhead to editable
Thomas Lamprecht [Fri, 30 Oct 2020 15:30:57 +0000 (16:30 +0100)]
ui: permission path selector: cbind typeAhead to editable

ExtJS throws an exception if 'typeAhead' is true but 'editable' is
false.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoupdate d/control
Wolfgang Bumiller [Fri, 30 Oct 2020 15:11:50 +0000 (16:11 +0100)]
update d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoimpl From<Authid> for Userid
Wolfgang Bumiller [Fri, 30 Oct 2020 08:13:05 +0000 (09:13 +0100)]
impl From<Authid> for Userid

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agobump proxmox dependency to 0.7.0 for totp udpates
Wolfgang Bumiller [Fri, 30 Oct 2020 14:18:00 +0000 (15:18 +0100)]
bump proxmox dependency to 0.7.0 for totp udpates

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoui: Utils: add product specific task descriptions
Dominik Csapak [Fri, 30 Oct 2020 13:02:58 +0000 (14:02 +0100)]
ui: Utils: add product specific task descriptions

and sort them alphabetically

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoserver/rest: accept also = as token separator
Thomas Lamprecht [Fri, 30 Oct 2020 12:34:21 +0000 (13:34 +0100)]
server/rest: accept also = as token separator

Like we do in Proxmox VE

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoserver/rest: user constants for HTTP headers
Thomas Lamprecht [Fri, 30 Oct 2020 12:33:36 +0000 (13:33 +0100)]
server/rest: user constants for HTTP headers

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi tokens: add authorization method
Fabian Grünbichler [Fri, 30 Oct 2020 12:10:38 +0000 (13:10 +0100)]
api tokens: add authorization method

and properly decode secret (which is a no-op with the current scheme).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoproxmox-backup-manager: add subscription commands
Thomas Lamprecht [Fri, 30 Oct 2020 11:51:19 +0000 (12:51 +0100)]
proxmox-backup-manager: add subscription commands

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi: define subscription module and methods as public
Thomas Lamprecht [Fri, 30 Oct 2020 12:03:51 +0000 (13:03 +0100)]
api: define subscription module and methods as public

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi: define subscription key schema and use it
Thomas Lamprecht [Fri, 30 Oct 2020 11:56:35 +0000 (12:56 +0100)]
api: define subscription key schema and use it

nicer to have the correct regex checked in parameter verification
already

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoproxy: fix warnings
Fabian Grünbichler [Fri, 30 Oct 2020 11:49:43 +0000 (12:49 +0100)]
proxy: fix warnings

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoproxy: split out code to run garbage collection job
Dietmar Maurer [Fri, 30 Oct 2020 09:54:31 +0000 (10:54 +0100)]
proxy: split out code to run garbage collection job

3 years agocheck_schedule cleanup: use &str instead of String
Dietmar Maurer [Fri, 30 Oct 2020 08:48:35 +0000 (09:48 +0100)]
check_schedule cleanup: use &str instead of String

This way we can avoid many clone() calls.

3 years agoproxy: extract commonly used logic for scheduling into new function
Hannes Laimer [Fri, 30 Oct 2020 08:07:25 +0000 (09:07 +0100)]
proxy: extract commonly used logic for scheduling into new function

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
3 years agoproxy: move prune logic into new file
Hannes Laimer [Fri, 30 Oct 2020 08:07:24 +0000 (09:07 +0100)]
proxy: move prune logic into new file

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
3 years agoui: user menu: allow changing language while logged in
Thomas Lamprecht [Fri, 30 Oct 2020 08:46:04 +0000 (09:46 +0100)]
ui: user menu: allow changing language while logged in

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 0.9.4-2
Thomas Lamprecht [Thu, 29 Oct 2020 19:09:40 +0000 (20:09 +0100)]
bump version to 0.9.4-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/postinst: followup: grep and sed use different regex escaping ..
Thomas Lamprecht [Thu, 29 Oct 2020 19:25:28 +0000 (20:25 +0100)]
d/postinst: followup: grep and sed use different regex escaping ..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/postinst: make more resilient
Thomas Lamprecht [Thu, 29 Oct 2020 18:58:41 +0000 (19:58 +0100)]
d/postinst: make more resilient

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 0.9.3-2 v0.9.4
Thomas Lamprecht [Thu, 29 Oct 2020 16:19:20 +0000 (17:19 +0100)]
bump version to 0.9.3-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: move user, token and permissions into an access control tab panel
Thomas Lamprecht [Thu, 29 Oct 2020 15:47:18 +0000 (16:47 +0100)]
ui: move user, token and permissions into an access control tab panel

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/control: update
Thomas Lamprecht [Thu, 29 Oct 2020 15:18:40 +0000 (16:18 +0100)]
d/control: update

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore summary: handle missing snapshot of a types
Thomas Lamprecht [Thu, 29 Oct 2020 14:52:45 +0000 (15:52 +0100)]
ui: datastore summary: handle missing snapshot of a types

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi2/access/user: fix return type schema
Wolfgang Bumiller [Thu, 29 Oct 2020 14:20:10 +0000 (15:20 +0100)]
api2/access/user: fix return type schema

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoapi2/access/user: drop Option, treat empty Vec as None
Wolfgang Bumiller [Thu, 29 Oct 2020 14:17:53 +0000 (15:17 +0100)]
api2/access/user: drop Option, treat empty Vec as None

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agofixup hardcoded paths
Wolfgang Bumiller [Thu, 29 Oct 2020 14:15:17 +0000 (15:15 +0100)]
fixup hardcoded paths

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agogui: add API token ACLs
Fabian Grünbichler [Wed, 28 Oct 2020 10:07:27 +0000 (11:07 +0100)]
gui: add API token ACLs

and the needed API token selector.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoacls: allow viewing/editing user's token ACLs
Fabian Grünbichler [Wed, 28 Oct 2020 08:49:25 +0000 (09:49 +0100)]
acls: allow viewing/editing user's token ACLs

even for otherwise unprivileged users.

since effective privileges of an API token are always intersected with
those of their owning user, this does not allow an unprivileged user to
elevate their privileges in practice, but avoids the need to involve a
privileged user to deploy API tokens.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agogui: add API token UI
Fabian Grünbichler [Thu, 22 Oct 2020 09:40:43 +0000 (11:40 +0200)]
gui: add API token UI

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agogui: add permissions button to user view
Fabian Grünbichler [Wed, 21 Oct 2020 07:42:56 +0000 (09:42 +0200)]
gui: add permissions button to user view

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agomanager: add user permissions command
Fabian Grünbichler [Fri, 16 Oct 2020 09:18:02 +0000 (11:18 +0200)]
manager: add user permissions command

useful for debugging complex ACL setups.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agomanager: add token commands
Fabian Grünbichler [Thu, 15 Oct 2020 12:49:04 +0000 (14:49 +0200)]
manager: add token commands

to generate, list and delete tokens. adding them to ACLs already works
out of the box.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agotasks: allow unpriv users to read their tokens' tasks
Fabian Grünbichler [Thu, 15 Oct 2020 09:27:47 +0000 (11:27 +0200)]
tasks: allow unpriv users to read their tokens' tasks

and tighten down the return schema while we're at it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoowner checks: handle backups owned by API tokens
Fabian Grünbichler [Thu, 8 Oct 2020 13:32:41 +0000 (15:32 +0200)]
owner checks: handle backups owned by API tokens

a user should be allowed to read/list/overwrite backups owned by their
own tokens, but a token should not be able to read/list/overwrite
backups owned by their owning user.

when changing ownership of a backup group, a user should be able to
transfer ownership to/from their own tokens if the backup is owned by
them (or one of their tokens).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoclient/remote: allow using ApiToken + secret
Fabian Grünbichler [Thu, 8 Oct 2020 13:19:39 +0000 (15:19 +0200)]
client/remote: allow using ApiToken + secret

in place of user + password.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoapi: add permissions endpoint
Fabian Grünbichler [Thu, 8 Oct 2020 08:34:07 +0000 (10:34 +0200)]
api: add permissions endpoint

and adapt privilege calculation to return propagate flag

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoapi: allow listing users + tokens
Fabian Grünbichler [Wed, 7 Oct 2020 12:38:12 +0000 (14:38 +0200)]
api: allow listing users + tokens

since it's not possible to extend existing structs, UserWithTokens
duplicates most of user::User.. to avoid duplicating user::ApiToken as
well, this returns full API token IDs, not just the token name part.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoapi: add API token endpoints
Fabian Grünbichler [Wed, 7 Oct 2020 11:12:37 +0000 (13:12 +0200)]
api: add API token endpoints

beneath the user endpoint.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoREST: extract and handle API tokens
Fabian Grünbichler [Wed, 7 Oct 2020 11:10:37 +0000 (13:10 +0200)]
REST: extract and handle API tokens

and refactor handling of headers in the REST server while we're at it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoreplace Userid with Authid
Fabian Grünbichler [Fri, 23 Oct 2020 11:33:21 +0000 (13:33 +0200)]
replace Userid with Authid

in most generic places. this is accompanied by a change in
RpcEnvironment to purposefully break existing call sites.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agobump proxmox dependency to 0.6.0 for api tokens and tfa
Wolfgang Bumiller [Thu, 29 Oct 2020 14:10:23 +0000 (15:10 +0100)]
bump proxmox dependency to 0.6.0 for api tokens and tfa

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoconfig: add token.shadow file
Fabian Grünbichler [Wed, 7 Oct 2020 11:09:13 +0000 (13:09 +0200)]
config: add token.shadow file

containing pairs of token ids and hashed secret values.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoapi: add Authid as wrapper around Userid
Fabian Grünbichler [Fri, 23 Oct 2020 11:18:09 +0000 (13:18 +0200)]
api: add Authid as wrapper around Userid

with an optional Tokenname, appended with '!' as delimiter in the string
representation like for PVE.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agobump version to 0.9.3-1 v0.9.3
Thomas Lamprecht [Thu, 29 Oct 2020 13:58:21 +0000 (14:58 +0100)]
bump version to 0.9.3-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoGC: improve task logs
Thomas Lamprecht [Thu, 29 Oct 2020 13:45:32 +0000 (14:45 +0100)]
GC: improve task logs

Make it more clear that removed files are chunks (not indexes or
something like that, user cannot know that we do not touch them here)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoGC: fix logging leftover bad chunks
Thomas Lamprecht [Thu, 29 Oct 2020 13:40:26 +0000 (14:40 +0100)]
GC: fix logging leftover bad chunks

fixes commit b4fb2623355259528587a0ab87e3970e6bb73b40, which copied
over the "Removed bad files:" block, but only adapted the log text,
not the actual variable.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore: fix sync/verify job removal prompt
Thomas Lamprecht [Thu, 29 Oct 2020 13:34:31 +0000 (14:34 +0100)]
ui: datastore: fix sync/verify job removal prompt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: drop id field from verify/sync add window
Thomas Lamprecht [Thu, 29 Oct 2020 13:22:39 +0000 (14:22 +0100)]
ui: drop id field from verify/sync add window

the config is shared between multiple datastores with the ID as, well
the unique ID, but we only show those of a single datastore.

So if a user adds a new one with a fixed ID "12345" but a job with
that ID exists already on another store, they get a error about
duplicate IDs, but cannot relate as that duplicate job is not visible
(filtered away)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoserver/worker_task: simplify task log writing
Dominik Csapak [Thu, 29 Oct 2020 09:50:13 +0000 (10:50 +0100)]
server/worker_task: simplify task log writing

instead of prerotating 1000 tasks
(which resulted in 2 writes each time an active worker was finished)
simply append finished tasks to the archive (which will be rotated)

page cache should be good enough so that we can get the task logs fast

since existing installations might have an 'index' file, we
still have to read tasks from there, but only if it exists

this simplifies the TaskListInfoIterator a good amount

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoworker task: remove debug print, faster modulo
Thomas Lamprecht [Thu, 29 Oct 2020 11:35:33 +0000 (12:35 +0100)]
worker task: remove debug print, faster modulo

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi: datstore status: introduce proper structs and restore compatibility
Dominik Csapak [Thu, 29 Oct 2020 10:51:26 +0000 (11:51 +0100)]
api: datstore status: introduce proper structs and restore compatibility

by moving the properties of the storage status out again to the top
level object

also introduce proper structs for the types used, to get type-safety
and better documentation for the api calls

this changes the backup counts from an array of [groups,snapshots] to
an object/struct with { groups, snapshots } and include 'other' types
(though we do not have any at this moment)

this way it is better documented

this also adapts the ui code to cope with the api changes

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agosend sync job status emails
Dietmar Maurer [Thu, 29 Oct 2020 11:07:46 +0000 (12:07 +0100)]
send sync job status emails

3 years agoschedule_datastore_sync_jobs: remove unneccessary clone()
Dietmar Maurer [Thu, 29 Oct 2020 10:27:35 +0000 (11:27 +0100)]
schedule_datastore_sync_jobs: remove unneccessary clone()

3 years agosend_job_status_mail: corectly escape html characters
Dietmar Maurer [Thu, 29 Oct 2020 10:22:08 +0000 (11:22 +0100)]
send_job_status_mail: corectly escape html characters

3 years agogarbage_collection: log deduplication factor
Dietmar Maurer [Thu, 29 Oct 2020 09:37:43 +0000 (10:37 +0100)]
garbage_collection: log deduplication factor

3 years agoui: datastore: use pointer cursor for edit notes
Thomas Lamprecht [Thu, 29 Oct 2020 09:45:37 +0000 (10:45 +0100)]
ui: datastore: use pointer cursor for edit notes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agogarbage_collection: log bad chunks (still_bad value)
Dietmar Maurer [Thu, 29 Oct 2020 09:24:31 +0000 (10:24 +0100)]
garbage_collection: log bad chunks (still_bad value)

3 years agofix #2998: encode mtime as i64 instead of u64
Dominik Csapak [Thu, 22 Oct 2020 07:05:37 +0000 (09:05 +0200)]
fix #2998: encode mtime as i64 instead of u64

saves files mtime as i64 instead of u64 which enables backup of
files with negative mtime

the catalog_decode_i64 is compatible to encoded u64 values (if < 2^63)
but not reverse, so all "old" catalogs can be read with the new
decoder, but catalogs that contain negative mtimes will decode wrongly
on older clients

also remove the arbitrary maximum value of 2^63 - 1 for
encode_u64 (we just use up to 10 bytes now) and correctly
decode them and update the comments accordingly

adds also test for i64 encode/decode and for compatibility between
u64 encode and i64 decode

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoverify: directly pass manifest to filter function
Dietmar Maurer [Thu, 29 Oct 2020 06:59:19 +0000 (07:59 +0100)]
verify: directly pass manifest to filter function

In order to avoid loading the manifest twice during verify.

3 years agobump version to 0.9.2-2
Thomas Lamprecht [Wed, 28 Oct 2020 22:05:56 +0000 (23:05 +0100)]
bump version to 0.9.2-2

re-use the changelog as this was not released publicly and it's just
a small fix

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoclient: adapt to change datastroe status return schema
Thomas Lamprecht [Wed, 28 Oct 2020 21:59:39 +0000 (22:59 +0100)]
client: adapt to change datastroe status return schema

fixes commit 16f9f244cfc19f021afa193929f40441434f0349 which extended
the return schema of the status API but did not adapted the client
status command to that.

Simply define our own tiny return schema and use that.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 0.9.2-1 v0.9.2
Thomas Lamprecht [Wed, 28 Oct 2020 20:27:15 +0000 (21:27 +0100)]
bump version to 0.9.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotools: socket: fix typo in comment
Thomas Lamprecht [Wed, 28 Oct 2020 20:26:11 +0000 (21:26 +0100)]
tools: socket: fix typo in comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore: rework sync layout, make job ID optional
Thomas Lamprecht [Wed, 28 Oct 2020 20:25:30 +0000 (21:25 +0100)]
ui: datastore: rework sync layout, make job ID optional

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore: rework verify layout, make job ID optional
Thomas Lamprecht [Wed, 28 Oct 2020 20:25:07 +0000 (21:25 +0100)]
ui: datastore: rework verify layout, make job ID optional

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore summary: indentation/whitespace error fix
Thomas Lamprecht [Wed, 28 Oct 2020 20:24:25 +0000 (21:24 +0100)]
ui: datastore summary: indentation/whitespace error fix

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotools/logrotate: fix compression logic
Dominik Csapak [Wed, 28 Oct 2020 09:58:00 +0000 (10:58 +0100)]
tools/logrotate: fix compression logic

we never actually compressed any files, since we only looked at
the extension:
* if it was 'zst' (which was always true for newly rotated files), we
  would not compress it
* even if it was not 'zst', we compressed it inplace, never adding '.zst'
  (possibly compressing them multiple times as zstd)

now we add new rotated files simply as '.X' and add a 'target' to the
compress fn, where we rename it to (but now we have to unlink the source
path)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agod/control.in: bump versioned dependcy for proxmox-widget-toolkit
Thomas Lamprecht [Wed, 28 Oct 2020 17:49:09 +0000 (18:49 +0100)]
d/control.in: bump versioned dependcy for proxmox-widget-toolkit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore: show comment, allow to edit notes
Thomas Lamprecht [Wed, 28 Oct 2020 17:25:47 +0000 (18:25 +0100)]
ui: datastore: show comment, allow to edit notes

the "comment" is the first line of the "notes" field from a manifest,
show it in the grid and allow editing the full notes.

Hack the click event listener a bit together for the right aligned
edit action button, but it works out well and is efficient (only one
event listener is much cheaper than per-buttons ones).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore: extend action tooltips with IDs
Thomas Lamprecht [Wed, 28 Oct 2020 17:24:29 +0000 (18:24 +0100)]
ui: datastore: extend action tooltips with IDs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore: use simple V. for verify action button
Thomas Lamprecht [Wed, 28 Oct 2020 17:22:20 +0000 (18:22 +0100)]
ui: datastore: use simple V. for verify action button

Choosing a good icon is hard here, while the magnifying glass is
somewhat relatable, it reminds to much of a "Search" function, which
can be quite confusing here.

So use a simple "V.", even if it's probably also not to ideal..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodo_verification_job: fix "never-reverify" and refactor/comment
Thomas Lamprecht [Wed, 28 Oct 2020 14:33:04 +0000 (15:33 +0100)]
do_verification_job: fix "never-reverify" and refactor/comment

commit a4915dfc2bc7bef03354f97f5bbce9fe2df4e0d6 made a wrong fix, as
it did not observed that the last expressions was done under the
invariant that we had a last verification result, because if none
could be loaded we already returned true (include).

It thus broke the case for "never re-verify", which is important when
using multiple schedules, a more high frequent one for new,
unverified snapshots, and a low frequency to re-verify older snapshots,
e.g., monthly.

Fix this case again, rework the code to avoid this easy to oversee
invariant. Use a nested match to better express the implication of
each setting, and add some comments.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocument verify job structs
Thomas Lamprecht [Wed, 28 Oct 2020 14:32:28 +0000 (15:32 +0100)]
document verify job structs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodo verification: always verify if manifest load fails
Thomas Lamprecht [Wed, 28 Oct 2020 12:56:49 +0000 (13:56 +0100)]
do verification: always verify if manifest load fails

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoverify: avoid generics and use &dyn Fn() for filter
Dietmar Maurer [Wed, 28 Oct 2020 12:19:21 +0000 (13:19 +0100)]
verify: avoid generics and use &dyn Fn() for filter

3 years agoverify: improve code reuse, fix filter function
Dietmar Maurer [Wed, 28 Oct 2020 11:58:15 +0000 (12:58 +0100)]
verify: improve code reuse, fix filter function

Try to reuse verify_all_backups(), because this function has better
logging and well defined snaphot order.

3 years agojobstate: fix doctest
Dietmar Maurer [Wed, 28 Oct 2020 09:52:16 +0000 (10:52 +0100)]
jobstate: fix doctest

3 years agofix compile warning
Dietmar Maurer [Wed, 28 Oct 2020 09:47:30 +0000 (10:47 +0100)]
fix compile warning

3 years agosend notification mails for GC and verify jobs
Dietmar Maurer [Tue, 27 Oct 2020 12:36:56 +0000 (13:36 +0100)]
send notification mails for GC and verify jobs

3 years agosrc/server/verify_job.rs: add missing file
Dietmar Maurer [Wed, 28 Oct 2020 06:58:07 +0000 (07:58 +0100)]
src/server/verify_job.rs: add missing file

3 years agomove jobstate to server
Dietmar Maurer [Wed, 28 Oct 2020 06:33:05 +0000 (07:33 +0100)]
move jobstate to server

3 years agoui: datastore summary: clarify that it's a deduplication factor
Thomas Lamprecht [Tue, 27 Oct 2020 16:43:43 +0000 (17:43 +0100)]
ui: datastore summary: clarify that it's a deduplication factor

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore: used fixed-width icons for summary
Thomas Lamprecht [Tue, 27 Oct 2020 16:43:10 +0000 (17:43 +0100)]
ui: datastore: used fixed-width icons for summary

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore: change GC/Prune title and buttons a bit
Thomas Lamprecht [Tue, 27 Oct 2020 16:42:29 +0000 (17:42 +0100)]
ui: datastore: change GC/Prune title and buttons a bit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore: add confirmation message to verify all
Thomas Lamprecht [Tue, 27 Oct 2020 16:41:55 +0000 (17:41 +0100)]
ui: datastore: add confirmation message to verify all

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: DataStorePanel: save active tab statefully
Dominik Csapak [Tue, 27 Oct 2020 15:20:11 +0000 (16:20 +0100)]
ui: DataStorePanel: save active tab statefully

so that the last selected tab for datastores will get selected
the next time any datastore is selected, even across browser
reloads

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: MainView/NavigationTree: improve tree selection handling
Dominik Csapak [Tue, 27 Oct 2020 15:20:10 +0000 (16:20 +0100)]
ui: MainView/NavigationTree: improve tree selection handling

this fixes some bugs related to selection handling in the treelist:
* datastores were not selected after a reload
* reloading when in a tabpanel on any tab but the first, would
  not select a treenode
* changing between datastores on any tab but the first would
  not select the same tab on the new datastore

fixed those by mostly rewriting the changePath handling for
datastores and tabpanels in general

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: NavigationTree: add 'Add Datastore' button below datastore list
Dominik Csapak [Tue, 27 Oct 2020 15:20:09 +0000 (16:20 +0100)]
ui: NavigationTree: add 'Add Datastore' button below datastore list

and make 'Datastore' unclickable

since we have all options and information on the relevant datastore panels,
we do not need a datastore config anymore (besides the creation,
which we add here)

this also fixes the sorted insertion and removal of new/old datastores

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: move sync/verify jobs to the datastores
Dominik Csapak [Tue, 27 Oct 2020 15:20:08 +0000 (16:20 +0100)]
ui: move sync/verify jobs to the datastores

add the datastore as parameter for the store, remove
the datastore selector for the edit windows and give the datastore
to it instead

also remove the autostart from the rstore, since we only want to start
it when we change to the relevant tab

and add icons for all other datastore tabs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: add DataStoreSummary and move Statistics into it
Dominik Csapak [Tue, 27 Oct 2020 15:20:07 +0000 (16:20 +0100)]
ui: add DataStoreSummary and move Statistics into it

this adds a 'Summary' panel to the datastores, similar to what we have
for PVE's nodes/guests/storages

contains an info panel with useful information, a comment field, and
the charts from the statistics panel (which can be deleted since it is
not necessary any more)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: add DataStorePruneAndGC panel and add it to datastore panel
Dominik Csapak [Tue, 27 Oct 2020 15:20:06 +0000 (16:20 +0100)]
ui: add DataStorePruneAndGC panel and add it to datastore panel

a simple objectgrid to display datastore gc/prune options
needs the prune inputpanel to be refactored in its own class

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: DataStoreContent: add 'Verify All' button
Dominik Csapak [Tue, 27 Oct 2020 15:20:05 +0000 (16:20 +0100)]
ui: DataStoreContent: add 'Verify All' button

to verify the complete datastore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi/{verify, syncjobs}: add optional datastore parameter
Dominik Csapak [Tue, 27 Oct 2020 15:20:04 +0000 (16:20 +0100)]
api/{verify, syncjobs}: add optional datastore parameter

to limit the lists to the given datastores

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoadmin/datastore: add more info to status call
Dominik Csapak [Fri, 23 Oct 2020 14:32:33 +0000 (16:32 +0200)]
admin/datastore: add more info to status call

add also the snapshot counts as well as the status of the last garbage
collection

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agobackup/datastore: save garbage collection status to disk
Dominik Csapak [Fri, 23 Oct 2020 14:32:32 +0000 (16:32 +0200)]
backup/datastore: save garbage collection status to disk

and load it again when opening it

this way we can persist the status of the last garbage collect across
daemon reloads and reboots

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agobackup/datastore: count still bad chunks for the status
Dominik Csapak [Fri, 23 Oct 2020 14:32:31 +0000 (16:32 +0200)]
backup/datastore: count still bad chunks for the status

we want to show the user that there are still bad chunks after a garbage
collection

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