]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
2 years agoapi: acme: fix typo
Stoiko Ivanov [Tue, 9 Nov 2021 16:54:19 +0000 (16:54 +0000)]
api: acme: fix typo

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoconfig: acme: plugin: rustfmt
Stoiko Ivanov [Tue, 9 Nov 2021 16:54:18 +0000 (16:54 +0000)]
config: acme: plugin: rustfmt

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoapi: config: acme: rustfmt
Stoiko Ivanov [Tue, 9 Nov 2021 16:54:17 +0000 (16:54 +0000)]
api: config: acme: rustfmt

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agod/control: update openid build dependency verison
Thomas Lamprecht [Thu, 18 Nov 2021 10:23:50 +0000 (11:23 +0100)]
d/control: update openid build dependency verison

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoopenid: allow to configure scopes, prompt, ACRs and arbitrary username-claim values
Dietmar Maurer [Thu, 18 Nov 2021 10:19:44 +0000 (11:19 +0100)]
openid: allow to configure scopes, prompt, ACRs and arbitrary username-claim values

- no longer set prompt to 'login' (makes auto-login possible)
- new prompt configuration
- allow arbitrary username-claim values

Depend on proxmox-openid 0.9.0.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agodocs: remote sync: adapt to changed filter param and add some examples
Thomas Lamprecht [Thu, 18 Nov 2021 09:33:51 +0000 (10:33 +0100)]
docs: remote sync: adapt to changed filter param and add some examples

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agogroup filter: rename CLI/API/Config "groups" option to "group-filter"
Thomas Lamprecht [Thu, 18 Nov 2021 08:50:47 +0000 (09:50 +0100)]
group filter: rename CLI/API/Config "groups" option to "group-filter"

we even use that for basically all the related schema names, "groups"
allone is just rather not so telling, i.e., "groups" what?

While due to the additive nature of `group-filter` is not the best
possible name for passing multiple arguments on the CLI (the web-ui
can present this more UX-friendly anyway) due to possible confusion
about if the filter act like AND vs OR it can be documented and even
if a user is confused they still are safe on more being synced than
less. Also, the original param name wasn't really _that_ better in
that regards

Dietmar also suggested to use singular for the CLI option, while
there can be more they're passed over repeating the option, each with
a single filter.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-tape: add groups filter to backup command
Dominik Csapak [Thu, 4 Nov 2021 09:56:22 +0000 (10:56 +0100)]
proxmox-tape: add groups filter to backup command

and add a completion handler to complete the backup groups

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: tape: show configred group filters
Dominik Csapak [Thu, 4 Nov 2021 09:56:21 +0000 (10:56 +0100)]
ui: tape: show configred group filters

in the grid and in the edit window

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3533: tape backup: filter groups according to config
Dominik Csapak [Thu, 4 Nov 2021 09:56:20 +0000 (10:56 +0100)]
fix #3533: tape backup: filter groups according to config

this fixes bug #3533, since now a user can backup a single datastore
on multiple tape media pools in parallel, e.g. vms on one pool, ct on
another.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agotape backup jobs: add group filters to config/api
Dominik Csapak [Thu, 4 Nov 2021 09:56:19 +0000 (10:56 +0100)]
tape backup jobs: add group filters to config/api

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-tape: add missing 'notify-user' option to backup command
Dominik Csapak [Thu, 4 Nov 2021 09:56:18 +0000 (10:56 +0100)]
proxmox-tape: add missing 'notify-user' option to backup command

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #sync.cfg/pull: don't remove by default
Fabian Grünbichler [Thu, 28 Oct 2021 13:00:58 +0000 (15:00 +0200)]
fix #sync.cfg/pull: don't remove by default

and convert existing (manually created/edited) jobs to the previous
default value of 'true'. the GUI has always set this value and defaults
to 'false'.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: mention group filter in sync docs
Fabian Grünbichler [Thu, 28 Oct 2021 13:00:57 +0000 (15:00 +0200)]
docs: mention group filter in sync docs

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomanager: render group filter properly
Fabian Grünbichler [Thu, 28 Oct 2021 13:00:56 +0000 (15:00 +0200)]
manager: render group filter properly

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoremote: add backup group scanning
Fabian Grünbichler [Thu, 28 Oct 2021 13:00:55 +0000 (15:00 +0200)]
remote: add backup group scanning

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agosync: add group filtering
Fabian Grünbichler [Thu, 28 Oct 2021 13:00:54 +0000 (15:00 +0200)]
sync: add group filtering

like for manual pulls, but persisted in the sync job config and visible
in the relevant GUI parts.

GUI is read-only for now (and defaults to no filtering on creation), as
this is a rather advanced feature that requires a complex GUI to be
user-friendly (regex-freeform, type-combobox, remote group scanning +
selector with additional freeform input).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopull: allow pulling groups selectively
Fabian Grünbichler [Thu, 28 Oct 2021 13:00:53 +0000 (15:00 +0200)]
pull: allow pulling groups selectively

without requiring workarounds based on ownership and limited
visibility/access.

if a group filter is set, remove_vanished will only consider filtered
groups for removal to prevent concurrent disjunct filters from trashing
eachother's synced groups.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopull/sync: extract passed along vars into struct
Fabian Grünbichler [Thu, 28 Oct 2021 13:00:52 +0000 (15:00 +0200)]
pull/sync: extract passed along vars into struct

this is basically the sync job config without ID and some stuff
converted already, and a convenient helper to generate the http client
from it.

Suggested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopull: use BackupGroup consistently
Fabian Grünbichler [Thu, 28 Oct 2021 13:00:51 +0000 (15:00 +0200)]
pull: use BackupGroup consistently

instead of `GroupListItem`s. we convert it anyway, so might as well do
that at the start.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoBackupGroup: add filter helper
Fabian Grünbichler [Thu, 28 Oct 2021 13:00:50 +0000 (15:00 +0200)]
BackupGroup: add filter helper

to have a single implementation of "group is matched by group filter".

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: add GroupFilter(List) type
Fabian Grünbichler [Thu, 28 Oct 2021 13:00:49 +0000 (15:00 +0200)]
api: add GroupFilter(List) type

at the API level, this is a simple (wrapped) Vec of Strings with a
verifier function. all users should use the provided helper to get the
actual GroupFilter enum values, which can't be directly used in the API
schema because of restrictions of the api macro.

validation of the schema + parsing into the proper type uses the same fn
intentionally to avoid running out of sync, even if it means compiling
the REs twice.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi-types: add schema for backup group
Fabian Grünbichler [Thu, 28 Oct 2021 13:00:48 +0000 (15:00 +0200)]
api-types: add schema for backup group

the regex was already there, and we need a simple type/schema for
passing in multiple groups as Vec/Array via the API.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-systemd: remove crate, use new proxmox-time 1.1.0 instead
Dietmar Maurer [Wed, 17 Nov 2021 11:29:31 +0000 (12:29 +0100)]
proxmox-systemd: remove crate, use new proxmox-time 1.1.0 instead

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoremove now unused serde_filter module
Wolfgang Bumiller [Wed, 17 Nov 2021 08:50:08 +0000 (09:50 +0100)]
remove now unused serde_filter module

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agowww: use TFA widgets from widget toolkit
Wolfgang Bumiller [Wed, 17 Nov 2021 08:27:21 +0000 (09:27 +0100)]
www: use TFA widgets from widget toolkit

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump d/control rust dependencies
Wolfgang Bumiller [Wed, 17 Nov 2021 08:44:30 +0000 (09:44 +0100)]
bump d/control rust dependencies

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump proxmox-widget-toolkit dependency to 3.4-1
Wolfgang Bumiller [Wed, 17 Nov 2021 08:41:44 +0000 (09:41 +0100)]
bump proxmox-widget-toolkit dependency to 3.4-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoswitch tfa api to use proxmox-tfa::api
Wolfgang Bumiller [Tue, 16 Nov 2021 14:03:26 +0000 (15:03 +0100)]
switch tfa api to use proxmox-tfa::api

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove fingerprint helpers from pbs-tools to pbs-api-types
Dietmar Maurer [Wed, 17 Nov 2021 06:07:40 +0000 (07:07 +0100)]
move fingerprint helpers from pbs-tools to pbs-api-types

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agodocs: add traffic control section
Dietmar Maurer [Mon, 15 Nov 2021 12:42:13 +0000 (13:42 +0100)]
docs: add traffic control section

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agodepend on proxmox-shared-memory 0.1.1
Dietmar Maurer [Mon, 15 Nov 2021 10:35:52 +0000 (11:35 +0100)]
depend on proxmox-shared-memory 0.1.1

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoadd missing file from previous commit
Dietmar Maurer [Sun, 14 Nov 2021 17:49:29 +0000 (18:49 +0100)]
add missing file from previous commit

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agotraffic-controls: add API/CLI to show current traffic
Dietmar Maurer [Sun, 14 Nov 2021 16:20:55 +0000 (17:20 +0100)]
traffic-controls: add API/CLI to show current traffic

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoupdate to proxmox-http 0.5.4
Dietmar Maurer [Sun, 14 Nov 2021 07:27:45 +0000 (08:27 +0100)]
update to proxmox-http 0.5.4

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agocached_traffic_control: fix regression tests
Dietmar Maurer [Sun, 14 Nov 2021 07:05:40 +0000 (08:05 +0100)]
cached_traffic_control: fix regression tests

Avoid using shared memory in tests because of permission problems.

2 years agoimplement rate limiter in shared memory
Dietmar Maurer [Sat, 13 Nov 2021 16:19:07 +0000 (17:19 +0100)]
implement rate limiter in shared memory

This kind of rate limiter can be used among several processes (as long
as all set the same rate/burst).

2 years agocached_traffic_control: use ShareableRateLimit trait object
Dietmar Maurer [Sat, 13 Nov 2021 14:43:56 +0000 (15:43 +0100)]
cached_traffic_control: use ShareableRateLimit trait object

2 years agopbs-config: use new SharedMemory helpers from proxmox-shared-memory crate
Dietmar Maurer [Fri, 12 Nov 2021 17:44:28 +0000 (18:44 +0100)]
pbs-config: use new SharedMemory helpers from proxmox-shared-memory crate

depend on proxmox-shared-memory crate.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agorest: make successful-ticket auth log a debug one to avoid syslog
Thomas Lamprecht [Wed, 10 Nov 2021 16:05:09 +0000 (17:05 +0100)]
rest: make successful-ticket auth log a debug one to avoid syslog

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.0.14-1
Dietmar Maurer [Fri, 12 Nov 2021 07:05:18 +0000 (08:05 +0100)]
bump version to 2.0.14-1

2 years agocreate /var/lib/proxmox-bnackup at server startup
Dietmar Maurer [Fri, 12 Nov 2021 07:08:23 +0000 (08:08 +0100)]
create /var/lib/proxmox-bnackup at server startup

This was missing in previous patch...

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agofix directory permission problems
Dietmar Maurer [Fri, 12 Nov 2021 06:29:18 +0000 (07:29 +0100)]
fix directory permission problems

By carefully setting options on all create_path() calls,
and by creating "/var/lib/proxmox-backup" at api server startup.

2 years agodebian/control: depend on librust-cidr-dev
Dietmar Maurer [Wed, 10 Nov 2021 11:23:16 +0000 (12:23 +0100)]
debian/control: depend on librust-cidr-dev

2 years agoproxmox-backup-proxy: implement traffic control
Dietmar Maurer [Mon, 8 Nov 2021 11:42:38 +0000 (12:42 +0100)]
proxmox-backup-proxy: implement traffic control

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoimplement a traffic control cache for fast rate control limiter lockups
Dietmar Maurer [Mon, 8 Nov 2021 11:40:09 +0000 (12:40 +0100)]
implement a traffic control cache for fast rate control limiter lockups

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agotraffic_control: use Memcom to track. config versions
Dietmar Maurer [Mon, 8 Nov 2021 11:37:15 +0000 (12:37 +0100)]
traffic_control: use Memcom to track. config versions

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoAdd traffic control configuration config with API
Dietmar Maurer [Sat, 6 Nov 2021 17:46:58 +0000 (18:46 +0100)]
Add traffic control configuration config with API

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoDailyDuration: implement time_match()
Dietmar Maurer [Sat, 6 Nov 2021 13:04:42 +0000 (14:04 +0100)]
DailyDuration: implement time_match()

2 years agoNew DailyDuration type with nom parser
Dietmar Maurer [Sat, 6 Nov 2021 10:54:19 +0000 (11:54 +0100)]
New DailyDuration type with nom parser

We will use this to specify timesframes for network rate limits (only
apply limite when inside the time frame).

Note: This is not systemd related, but we can reuse some of the parser
method.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoimplement Servive for RateLimitedStream
Dietmar Maurer [Thu, 4 Nov 2021 12:42:30 +0000 (13:42 +0100)]
implement Servive for RateLimitedStream

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoproxmox-backup-client: add rate/burst parameter to backup CLI
Dietmar Maurer [Wed, 3 Nov 2021 12:56:06 +0000 (13:56 +0100)]
proxmox-backup-client: add rate/burst parameter to backup CLI

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agopbs-client: add option to use the new RateLimiter
Dietmar Maurer [Wed, 3 Nov 2021 12:52:13 +0000 (13:52 +0100)]
pbs-client: add option to use the new RateLimiter

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoopenid_login: vertify that firstname, lastname and email fits our schema definitions
Dietmar Maurer [Wed, 10 Nov 2021 05:44:40 +0000 (06:44 +0100)]
openid_login: vertify that firstname, lastname and email fits our schema definitions

If not, we do not copy the values to our user.cfg.

2 years agocorrectly lock remote config
Dietmar Maurer [Sat, 6 Nov 2021 16:33:08 +0000 (17:33 +0100)]
correctly lock remote config

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agodocs: language fixup: faq and appendix
Dylan Whyte [Wed, 27 Oct 2021 14:19:27 +0000 (16:19 +0200)]
docs: language fixup: faq and appendix

minor formatting and language fixes to the faq section and the appendix

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
2 years agoapi: admin/datastore: reuse 'is_protected' implementation
Dominik Csapak [Thu, 28 Oct 2021 09:47:55 +0000 (11:47 +0200)]
api: admin/datastore: reuse 'is_protected' implementation

we already have that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobackup-client: use () instead of Value as return type
Dominik Csapak [Thu, 28 Oct 2021 09:47:54 +0000 (11:47 +0200)]
backup-client: use () instead of Value as return type

shorter and we do a conversion anyway

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoPruneMark: implement display without the write! macro
Dominik Csapak [Thu, 28 Oct 2021 09:47:53 +0000 (11:47 +0200)]
PruneMark: implement display without the write! macro

by using write_str instead

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoPruneMark: use copied values instead of references
Dominik Csapak [Thu, 28 Oct 2021 09:47:52 +0000 (11:47 +0200)]
PruneMark: use copied values instead of references

the type is small enough

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agorrd: use saturating_sub to avoid underflow
Dominik Csapak [Thu, 28 Oct 2021 09:40:44 +0000 (11:40 +0200)]
rrd: use saturating_sub to avoid underflow

Without this, the tests fail in debug mode.
Also having start (u64) underflow to a value greater than end does
not really make sense

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodocs: add info about protection flag to client docs
Dominik Csapak [Wed, 27 Oct 2021 11:22:38 +0000 (13:22 +0200)]
docs: add info about protection flag to client docs

and mention that sync/pull does not sync the protected flag

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agofix #3602: ui: datastore/Content: add action to set protection status
Dominik Csapak [Wed, 27 Oct 2021 11:22:37 +0000 (13:22 +0200)]
fix #3602: ui: datastore/Content: add action to set protection status

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: add protected icon to snapshots
Dominik Csapak [Wed, 27 Oct 2021 11:22:36 +0000 (13:22 +0200)]
ui: add protected icon to snapshots

if they are protected

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: PruneInputPanel: add keepReason 'protected' for protected backups
Dominik Csapak [Wed, 27 Oct 2021 11:22:35 +0000 (13:22 +0200)]
ui: PruneInputPanel: add keepReason 'protected' for protected backups

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoproxmox-backup-client: add 'protected' commands
Dominik Csapak [Wed, 27 Oct 2021 11:22:34 +0000 (13:22 +0200)]
proxmox-backup-client: add 'protected' commands

includes 'update' and 'show' similar to the notes commands

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoapi2/admin/datastore: add get/set_protection
Dominik Csapak [Wed, 27 Oct 2021 11:22:33 +0000 (13:22 +0200)]
api2/admin/datastore: add get/set_protection

for gettin/setting the protected flag for snapshots (akin to notes)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoapi2: datastore/delete_group: throw error for partially removed group
Dominik Csapak [Wed, 27 Oct 2021 11:22:32 +0000 (13:22 +0200)]
api2: datastore/delete_group: throw error for partially removed group

when a group could not be completely removed due to protected snapshot,
throw an error

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopull_store/group: dont try remove locally protected snapshots
Dominik Csapak [Wed, 27 Oct 2021 11:22:31 +0000 (13:22 +0200)]
pull_store/group: dont try remove locally protected snapshots

and log if a vanished groups could not be completely deleted if it
contains protected snapshots

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobackup/datastore: prevent protected snapshots to be removed
Dominik Csapak [Wed, 27 Oct 2021 11:22:30 +0000 (13:22 +0200)]
backup/datastore: prevent protected snapshots to be removed

by throwing an error for remove_backup_dir, and skipping for
remove_backup_group

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agotests/prune: add tests for protecteded backups
Dominik Csapak [Wed, 27 Oct 2021 11:22:29 +0000 (13:22 +0200)]
tests/prune: add tests for protecteded backups

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoadd protected info of snapshots to api and task logs
Dominik Csapak [Wed, 27 Oct 2021 11:22:28 +0000 (13:22 +0200)]
add protected info of snapshots to api and task logs

adds the info that a snapshot is protected to:
* snapshot list
* manual pruning (also dry-run)
* prune jobs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-datastore: skip protected backups in pruning
Dominik Csapak [Wed, 27 Oct 2021 11:22:27 +0000 (13:22 +0200)]
pbs-datastore: skip protected backups in pruning

as a separate keep reason so it will not be calculated for the other reasons

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-datastore: add protection info to BackupInfo
Dominik Csapak [Wed, 27 Oct 2021 11:22:26 +0000 (13:22 +0200)]
pbs-datastore: add protection info to BackupInfo

and add necessary helper functions (protected_file/is_protected)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: datastore content: improve sorting verification column
Dominik Csapak [Wed, 27 Oct 2021 12:58:43 +0000 (14:58 +0200)]
ui: datastore content: improve sorting verification column

sort failed < no verify < outdated < all ok

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agofix typo s/CGM/GCM/i
Dominik Csapak [Wed, 27 Oct 2021 07:05:51 +0000 (09:05 +0200)]
fix typo s/CGM/GCM/i

only user visible change is in the error message

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agobump d/control
Wolfgang Bumiller [Fri, 22 Oct 2021 12:29:38 +0000 (14:29 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoCargo.toml: set udev dependency to 0.4
Wolfgang Bumiller [Fri, 22 Oct 2021 12:28:32 +0000 (14:28 +0200)]
Cargo.toml: set udev dependency to 0.4

we don't need to bother with 0.3 anymore

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoacme: interpret no TOS as accepted
Dominik Csapak [Thu, 21 Oct 2021 09:12:12 +0000 (11:12 +0200)]
acme: interpret no TOS as accepted

some custom ACME endpoints do not have TOS, interpret this as
'the user has accepted the TOS', like we do for PVE.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump proxmox-acme-rs dependency to 0.3
Wolfgang Bumiller [Fri, 22 Oct 2021 08:54:43 +0000 (10:54 +0200)]
bump proxmox-acme-rs dependency to 0.3

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoacme: new_account: prevent replacing existing accounts
Wolfgang Bumiller [Fri, 22 Oct 2021 06:35:24 +0000 (08:35 +0200)]
acme: new_account: prevent replacing existing accounts

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 2.0.13-1
Dietmar Maurer [Thu, 21 Oct 2021 06:17:38 +0000 (08:17 +0200)]
bump version to 2.0.13-1

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoupdate dedian/control
Dietmar Maurer [Thu, 21 Oct 2021 05:59:45 +0000 (07:59 +0200)]
update dedian/control

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agouse new fsync parameter to replace_file and atomic_open_or_create
Dietmar Maurer [Wed, 20 Oct 2021 12:56:15 +0000 (14:56 +0200)]
use new fsync parameter to replace_file and atomic_open_or_create

Depend on proxmox 0.15.0 and proxmox-openid 0.8.1

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agotape: simplify export_media_set for pool writer
Dominik Csapak [Mon, 18 Oct 2021 09:24:12 +0000 (11:24 +0200)]
tape: simplify export_media_set for pool writer

our export code can handle if the tape is inside the drive, so unloading
it first does not have an benefit, it even makes the exporting slower,
since we first unload it into its original slot, and then moving it
to an import/export slot

so drop the code that unloads the tape from the drive, and let the
export code itself handle that

change the 'eject' into a 'rewind' and comment why we do that first

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agorest-server: use hashmap for parameter errors
Dominik Csapak [Tue, 19 Oct 2021 11:09:27 +0000 (13:09 +0200)]
rest-server: use hashmap for parameter errors

our ui expects a map here with 'field: "error"'. This way it can mark
the relevant field as invalid and correctly shows the complete error
message

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoproxmox-rrd: use fsync instead of syncfs
Dietmar Maurer [Tue, 19 Oct 2021 16:33:19 +0000 (18:33 +0200)]
proxmox-rrd: use fsync instead of syncfs

syncfs can sync unrelated data, and we do not want that.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoproxmox-rrd: fix regression tests
Dietmar Maurer [Tue, 19 Oct 2021 16:41:03 +0000 (18:41 +0200)]
proxmox-rrd: fix regression tests

2 years agoproxmox-rrd: improve dev docs
Dietmar Maurer [Tue, 19 Oct 2021 09:14:57 +0000 (11:14 +0200)]
proxmox-rrd: improve dev docs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoproxmox-rrd: cleanup - impl FromStr for JournalEntry
Dietmar Maurer [Tue, 19 Oct 2021 08:51:22 +0000 (10:51 +0200)]
proxmox-rrd: cleanup - impl FromStr for JournalEntry

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoproxmox-rrd: add option to avoid page cache for load/save
Dietmar Maurer [Tue, 19 Oct 2021 07:46:05 +0000 (09:46 +0200)]
proxmox-rrd: add option to avoid page cache for load/save

use fadvice(.., POSIX_FADV_DONTNEED) for RRD files. We read those files only once,
and always rewrite them.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoproxmox-rrd: use syncfs after writing rrd files
Dietmar Maurer [Mon, 18 Oct 2021 11:45:30 +0000 (13:45 +0200)]
proxmox-rrd: use syncfs after writing rrd files

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agobump version to 2.0.12-1
Thomas Lamprecht [Tue, 19 Oct 2021 08:48:54 +0000 (10:48 +0200)]
bump version to 2.0.12-1

note, this bump happened outside the main branch as it wasn't in a
good state and there was need for bumping (log/task rotate stuff).

Cherry picking the actual bump to avoid changelog/versioning
confusion on the next one, that should again happen on the main
branch.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit edc876c58e619ee4306f252485a4e364e3bb7784)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: use fine grained locking in commit_journal_impl
Dietmar Maurer [Mon, 18 Oct 2021 12:52:27 +0000 (14:52 +0200)]
proxmox-rrd: use fine grained locking in commit_journal_impl

Aquire the rrd_map lock for each file (else we block access for a long time)

2 years agoproxmox-rrd: log all errors from apply_and_commit_journal_thread (but only once)
Dietmar Maurer [Mon, 18 Oct 2021 09:57:19 +0000 (11:57 +0200)]
proxmox-rrd: log all errors from apply_and_commit_journal_thread (but only once)

2 years agotape: improve export_media error message for not found tape
Dominik Csapak [Fri, 15 Oct 2021 08:32:59 +0000 (10:32 +0200)]
tape: improve export_media error message for not found tape

'export_media' can handle if the tape is in either a normal slot of the
library, or in the drive assigned to the current pool writer.
(because we need to lock the drive)

if it is, for some reason, in a different drive, the error message
 'media is not online'
could be slightly confusing for a user, since it would appear in the drive list

add the 'or a differen drive' to make it clearer

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoproxmox-rrd: cleanup list_old_journals
Dietmar Maurer [Mon, 18 Oct 2021 08:00:16 +0000 (10:00 +0200)]
proxmox-rrd: cleanup list_old_journals

2 years agoproxmox-rrd: cleanup - use struct instead of tuple
Dietmar Maurer [Sat, 16 Oct 2021 10:38:34 +0000 (12:38 +0200)]
proxmox-rrd: cleanup - use struct instead of tuple

2 years agoproxmox-rrd: move RRDMap into extra file
Dietmar Maurer [Sat, 16 Oct 2021 10:22:40 +0000 (12:22 +0200)]
proxmox-rrd: move RRDMap into extra file

2 years agoproxmox-rrd: move JournalState into extra file
Dietmar Maurer [Sat, 16 Oct 2021 10:00:25 +0000 (12:00 +0200)]
proxmox-rrd: move JournalState into extra file