]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
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

2 years agoproxmox-rrd: implement non blocking journal
Dietmar Maurer [Fri, 15 Oct 2021 10:26:33 +0000 (12:26 +0200)]
proxmox-rrd: implement non blocking journal

Do not block while applying the journal.

2 years agoproxmox-rrd: rename RRDCacheState to JournalState
Dietmar Maurer [Fri, 15 Oct 2021 07:35:44 +0000 (09:35 +0200)]
proxmox-rrd: rename RRDCacheState to JournalState

2 years agoproxmox-rrd: avoild blocking readers while applying the journal
Dietmar Maurer [Fri, 15 Oct 2021 07:22:07 +0000 (09:22 +0200)]
proxmox-rrd: avoild blocking readers while applying the journal

By using and extra RwLock<RRDMap> on the rrd data.

2 years agoproxmox-rrd: log journal apply/flush times, split apply and flush
Dietmar Maurer [Thu, 14 Oct 2021 14:41:08 +0000 (16:41 +0200)]
proxmox-rrd: log journal apply/flush times, split apply and flush

We need to apply the journal only once.

2 years agoproxmox-rrd: cleanup - use slot_end_time()
Dietmar Maurer [Thu, 14 Oct 2021 14:29:00 +0000 (16:29 +0200)]
proxmox-rrd: cleanup - use slot_end_time()

2 years agoproxmox-rrd: cleanup - use staturating_add instead of if/else
Dietmar Maurer [Thu, 14 Oct 2021 14:10:55 +0000 (16:10 +0200)]
proxmox-rrd: cleanup - use staturating_add instead of if/else

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

2 years agoproxmox-rrd: make rrd load callback configurable
Dietmar Maurer [Thu, 14 Oct 2021 09:41:26 +0000 (11:41 +0200)]
proxmox-rrd: make rrd load callback configurable

2 years agoproxmox-rrd: add more regression tests
Dietmar Maurer [Thu, 14 Oct 2021 08:55:12 +0000 (10:55 +0200)]
proxmox-rrd: add more regression tests

2 years agoproxmox-rrd: add regression tests and two minor fixes
Dietmar Maurer [Thu, 14 Oct 2021 08:17:07 +0000 (10:17 +0200)]
proxmox-rrd: add regression tests and two minor fixes

2 years agoproxmox-rrd: pass time and value to update function
Dietmar Maurer [Thu, 14 Oct 2021 06:11:04 +0000 (08:11 +0200)]
proxmox-rrd: pass time and value to update function

2 years agocleanup: move rrd cache related code into extra file
Dietmar Maurer [Thu, 14 Oct 2021 05:48:32 +0000 (07:48 +0200)]
cleanup: move rrd cache related code into extra file

2 years agoproxmox-rrd: add some integration tests (file format tests)
Dietmar Maurer [Wed, 13 Oct 2021 16:20:06 +0000 (18:20 +0200)]
proxmox-rrd: add some integration tests (file format tests)

2 years agobump d/control
Wolfgang Bumiller [Wed, 13 Oct 2021 12:47:24 +0000 (14:47 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-tools: drop borrow module
Wolfgang Bumiller [Wed, 13 Oct 2021 08:40:50 +0000 (10:40 +0200)]
pbs-tools: drop borrow module

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agouse complete_file_name from proxmox-router 1.1
Dietmar Maurer [Wed, 13 Oct 2021 10:55:51 +0000 (12:55 +0200)]
use complete_file_name from proxmox-router 1.1

2 years agoproxmox-rrd: move unshipped cli tool to examples
Thomas Lamprecht [Wed, 13 Oct 2021 11:33:15 +0000 (13:33 +0200)]
proxmox-rrd: move unshipped cli tool to examples

it's a rather low-level tool mostly useful for debugging and some of
it is rather "dumb" (by design) anyway, e.g., it does not
transparently applies journal but really only operates on the DB
files as is (which can conflict with daemon operations).

In summary, not (yet) a tool meant for end user consumption.
Move it to examples folder to avoid compilation on packaging (we do
not ship it anyway) which allows us to move the rather expensive
proxmox-router (pulls in hyper) to the dev-dependencies section.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: add more commands to the rrd cli tool
Dietmar Maurer [Wed, 13 Oct 2021 08:24:52 +0000 (10:24 +0200)]
proxmox-rrd: add more commands to the rrd cli tool

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: rename last_counter to last_value
Dietmar Maurer [Wed, 13 Oct 2021 08:24:51 +0000 (10:24 +0200)]
proxmox-rrd: rename last_counter to last_value

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: protect against negative update time
Dietmar Maurer [Wed, 13 Oct 2021 08:24:50 +0000 (10:24 +0200)]
proxmox-rrd: protect against negative update time

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: new helpers: slot, slot_start_time & slot_end_time
Dietmar Maurer [Wed, 13 Oct 2021 08:24:49 +0000 (10:24 +0200)]
proxmox-rrd: new helpers: slot, slot_start_time & slot_end_time

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: avoid expensive modulo (%) inside loop
Dietmar Maurer [Wed, 13 Oct 2021 08:24:48 +0000 (10:24 +0200)]
proxmox-rrd: avoid expensive modulo (%) inside loop

Modulo is very slow, so we try to avoid it inside loops.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: add binary to create/manage rrd files
Dietmar Maurer [Wed, 13 Oct 2021 08:24:47 +0000 (10:24 +0200)]
proxmox-rrd: add binary to create/manage rrd files

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: split out load_rrd (cleanup)
Dietmar Maurer [Wed, 13 Oct 2021 08:24:46 +0000 (10:24 +0200)]
proxmox-rrd: split out load_rrd (cleanup)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: support CF::Last
Dietmar Maurer [Wed, 13 Oct 2021 08:24:45 +0000 (10:24 +0200)]
proxmox-rrd: support CF::Last

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoremove proxmox-rrd-api-types crate, s/RRDTimeFrameResolution/RRDTimeFrame/
Dietmar Maurer [Wed, 13 Oct 2021 08:24:44 +0000 (10:24 +0200)]
remove proxmox-rrd-api-types crate, s/RRDTimeFrameResolution/RRDTimeFrame/

Because the types used inside the RRD have other requirements
than the API types:

- other serialization format
- the API may not support all RRD features

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: extract_data: include values from current slot
Dietmar Maurer [Wed, 13 Oct 2021 08:24:43 +0000 (10:24 +0200)]
proxmox-rrd: extract_data: include values from current slot

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: remove dependency to proxmox-rrd-api-types
Dietmar Maurer [Wed, 13 Oct 2021 08:24:42 +0000 (10:24 +0200)]
proxmox-rrd: remove dependency to proxmox-rrd-api-types

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: implement new CBOR based format
Dietmar Maurer [Wed, 13 Oct 2021 08:24:41 +0000 (10:24 +0200)]
proxmox-rrd: implement new CBOR based format

Storing much more data points now got get better graphs.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-backup-proxy: use tokio::task::spawn_blocking instead of block_in_place
Dietmar Maurer [Wed, 13 Oct 2021 08:24:40 +0000 (10:24 +0200)]
proxmox-backup-proxy: use tokio::task::spawn_blocking instead of block_in_place

allow the current thread to do some other work in-between

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoRRD_CACHE: use a OnceCell instead of lazy_static
Dietmar Maurer [Wed, 13 Oct 2021 08:24:39 +0000 (10:24 +0200)]
RRD_CACHE: use a OnceCell instead of lazy_static

And initialize only with proxmox-backup-proxy. Other binaries dont need it.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: use a journal to reduce amount of bytes written
Dietmar Maurer [Wed, 13 Oct 2021 08:24:38 +0000 (10:24 +0200)]
proxmox-rrd: use a journal to reduce amount of bytes written

Append pending changes in a simple text based format that allows for
lockless appends as long as we stay below 4 KiB data per write.

Apply the journal every 30 minutes and on daemon startup.

Note that we do not ensure that the journal is synced, this is a
perfomance optimization we can make as the kernel defaults to
writeback in-flight data every 30s (sysctl vm/dirty_expire_centisecs)
anyway, so we lose at max half a minute of data on a crash, here one
should have in mind that we normally expose 1 minute as finest
granularity anyway, so not really much lost.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoremove pbs-tools::ops::ControlFlow
Wolfgang Bumiller [Tue, 12 Oct 2021 12:34:08 +0000 (14:34 +0200)]
remove pbs-tools::ops::ControlFlow

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-config: drop default-features on proxmox-router dep
Wolfgang Bumiller [Tue, 12 Oct 2021 11:11:06 +0000 (13:11 +0200)]
pbs-config: drop default-features on proxmox-router dep

we don't need the 'cli' feature in there

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodocs: language and formatting fixup
Dylan Whyte [Mon, 11 Oct 2021 15:15:19 +0000 (17:15 +0200)]
docs: language and formatting fixup

Some minor langague and formatting fixes to sections: Proxmox VE
Integration, pxar Command Line Tool, Managing Remotes, Maintenance
Tasks, Host System Administration, Network Management, and Technical
Overview.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
2 years agodocs: backup-client: langauge and formatting fixup
Dylan Whyte [Mon, 11 Oct 2021 11:46:34 +0000 (13:46 +0200)]
docs: backup-client: langauge and formatting fixup

also remove todo item for scheduling garbage collect with cron, and add
note about schedule configuration through proxmox-backup-manager/PBS GUI

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
2 years agodocs: Update for new features/functionality
Dylan Whyte [Mon, 11 Oct 2021 11:11:44 +0000 (13:11 +0200)]
docs: Update for new features/functionality

Update GUI section and GUI instructions to reflect current layout and
features

List OpenID connect in possible realms (user management)

Link Access Control section when referring to it (user management)

Include Tape roles in access control section

Minor formatting changes

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
2 years agodocs: language and formatting fixup
Dylan Whyte [Mon, 11 Oct 2021 11:11:43 +0000 (13:11 +0200)]
docs: language and formatting fixup

Some minor changes to the sections: Introduction, Installation,
Terminology, GUI, Storage, and User Management

Mention tape backup in main features

Update epilog.rst with link for 'LXC'.
Remove FIXME from epilog.rst (I believe this was a note to repair
the not-yet-created pbs wiki link).

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
2 years agoapi daemons: fix sending log-reopen command
Dominik Csapak [Mon, 11 Oct 2021 12:14:32 +0000 (14:14 +0200)]
api daemons: fix sending log-reopen command

send_command serializes everything so it cannot be used to send a
raw, optimized command. Normally that means we get an error like
> 'unable to parse parameters (expected json object)'
when used that way.

Switch over to send_raw_command which does not re-serializes the
command.

Fixes: 45b8a032 ("refactor send_command")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump d/control
Wolfgang Bumiller [Mon, 11 Oct 2021 10:08:11 +0000 (12:08 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoupdate to first proxmox crate split
Wolfgang Bumiller [Fri, 8 Oct 2021 09:19:37 +0000 (11:19 +0200)]
update to first proxmox crate split

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump proxmox dependency to 0.14.0 and proxmox-http to 0.5.0
Wolfgang Bumiller [Fri, 8 Oct 2021 09:18:22 +0000 (11:18 +0200)]
bump proxmox dependency to 0.14.0 and proxmox-http to 0.5.0

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoproxmox-backup-proxy: clean up old tasks when the task log was rotated
Dominik Csapak [Thu, 7 Oct 2021 12:03:37 +0000 (14:03 +0200)]
proxmox-backup-proxy: clean up old tasks when the task log was rotated

we maybe have old tasks when the task list was rotated, so clean them up

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agorest-server: add cleanup_old_tasks
Dominik Csapak [Thu, 7 Oct 2021 12:03:36 +0000 (14:03 +0200)]
rest-server: add cleanup_old_tasks

this is a helper that removes task log files that are not referenced
by the task archive anymore

it gets the oldest task archive file, gets the first endtime (the
oldest) and removes all files in the taskdir where the mtime is older
than that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoproxmox-rrd: use correct directory options in create_rrdb_dir
Dietmar Maurer [Thu, 7 Oct 2021 06:50:50 +0000 (08:50 +0200)]
proxmox-rrd: use correct directory options in create_rrdb_dir

2 years agoproxmox-rrd: cleanup error handling
Dietmar Maurer [Thu, 7 Oct 2021 06:01:12 +0000 (08:01 +0200)]
proxmox-rrd: cleanup error handling

2 years agoproxmox-rrd: use log crate instead of eprintln, avoid duplicate logs
Dietmar Maurer [Wed, 6 Oct 2021 16:19:22 +0000 (18:19 +0200)]
proxmox-rrd: use log crate instead of eprintln, avoid duplicate logs

2 years agoproxmox-rrd: fix update (do not update) when time is in the past
Dietmar Maurer [Wed, 6 Oct 2021 16:00:37 +0000 (18:00 +0200)]
proxmox-rrd: fix update (do not update) when time is in the past

2 years agodrop dynamic_index.rs duplicate in pbs-client
Wolfgang Bumiller [Wed, 6 Oct 2021 13:29:27 +0000 (15:29 +0200)]
drop dynamic_index.rs duplicate in pbs-client

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-tools::io::pipe: use nix Error type
Wolfgang Bumiller [Wed, 6 Oct 2021 13:18:06 +0000 (15:18 +0200)]
pbs-tools::io::pipe: use nix Error type

there's no need to upgrade to anyhow::Error there already

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoproxmox-rrd: improve developer docs
Dietmar Maurer [Wed, 6 Oct 2021 10:19:54 +0000 (12:19 +0200)]
proxmox-rrd: improve developer docs

2 years agoproxmox-rrd: remove serde dependency
Dietmar Maurer [Wed, 6 Oct 2021 08:55:46 +0000 (10:55 +0200)]
proxmox-rrd: remove serde dependency

2 years agosplit out RRD api types into proxmox-rrd-api-types crate
Dietmar Maurer [Wed, 6 Oct 2021 07:49:51 +0000 (09:49 +0200)]
split out RRD api types into proxmox-rrd-api-types crate

2 years agoproxmox-rrd: use create_path instead of std::fs::create_dir_all
Dietmar Maurer [Wed, 6 Oct 2021 06:37:14 +0000 (08:37 +0200)]
proxmox-rrd: use create_path instead of std::fs::create_dir_all

To ensure correct file ownership.

2 years agomove RRD code into proxmox-rrd crate
Dietmar Maurer [Wed, 6 Oct 2021 05:06:17 +0000 (07:06 +0200)]
move RRD code into proxmox-rrd crate

2 years agobump version to 2.0.11-1
Thomas Lamprecht [Tue, 5 Oct 2021 14:34:35 +0000 (16:34 +0200)]
bump version to 2.0.11-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/changelog: fixup release
Thomas Lamprecht [Tue, 5 Oct 2021 12:23:28 +0000 (14:23 +0200)]
d/changelog: fixup release

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rest-server: use new ServerAdapter trait instead of callbacks
Dietmar Maurer [Tue, 5 Oct 2021 09:01:05 +0000 (11:01 +0200)]
proxmox-rest-server: use new ServerAdapter trait instead of callbacks

Async callbacks are a PITA, so we now pass a single trait object which
implements check_auth and get_index.

2 years agoproxmox-rest-server: pass owned RestEnvironment to get_index
Dietmar Maurer [Mon, 4 Oct 2021 12:49:25 +0000 (14:49 +0200)]
proxmox-rest-server: pass owned RestEnvironment to get_index

This way we avoid pointers with lifetimes.

2 years agoproxmox-rest-server: cleanup, access api_auth using a method
Dietmar Maurer [Mon, 4 Oct 2021 11:32:19 +0000 (13:32 +0200)]
proxmox-rest-server: cleanup, access api_auth using a method