]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
3 years agotools/daemon: improve reload behaviour
Dominik Csapak [Thu, 17 Dec 2020 14:50:18 +0000 (15:50 +0100)]
tools/daemon: improve reload behaviour

it seems that sometimes, the child process signal gets handled
before the parent process signal. Systemd then ignores the
childs signal (finished reloading) and only after going into
reloading state because of the parent. this will never finish.

Instead, wait for the state to change to 'reloading' after sending
that signal in the parent, an only fork afterwards. This way
we ensure that systemd knows about the reloading before actually trying
to do it.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Fabian Ebner <f.ebner@proxmox.com>
3 years agotape: MediaPool::with_config() - remove name parameter
Dietmar Maurer [Fri, 18 Dec 2020 07:14:24 +0000 (08:14 +0100)]
tape: MediaPool::with_config() - remove name parameter

Not required, because config already contains the pool name.

3 years agotape: return current_file_number as u64
Dietmar Maurer [Fri, 18 Dec 2020 06:44:50 +0000 (07:44 +0100)]
tape: return current_file_number as u64

3 years agotools/process_locker: Decrement writer count in drop handler
Dominik Csapak [Thu, 17 Dec 2020 14:33:31 +0000 (15:33 +0100)]
tools/process_locker: Decrement writer count in drop handler

of ProcessLockSharedGuard.

We use a counter to determine if we can unlock the file again, but
we never actually decremented the writer count, so we held the
lock forever.

This fixes the issue that we could not start a garbage collect after
a reload, as long as the old process is still running, even when that
process has no active backup anymore but another long running task
(e.g. file download, terminal, etc.).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoacl: rustfmt module
Fabian Grünbichler [Thu, 17 Dec 2020 14:27:45 +0000 (15:27 +0100)]
acl: rustfmt module

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoacl: reformat privileges
Fabian Grünbichler [Thu, 17 Dec 2020 14:27:44 +0000 (15:27 +0100)]
acl: reformat privileges

for better readability, and tell rustfmt to leave those definitions
alone.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoacl: add docs and adapt visibility
Fabian Grünbichler [Thu, 17 Dec 2020 14:27:43 +0000 (15:27 +0100)]
acl: add docs and adapt visibility

document all public things, add some doc links and make some
previously-public things only available for test cases or within the
crate:

previously public, now private:
- AclTreeNode::extract_user_roles (we have extract_roles())
- AclTreeNode::extract_group_roles (same)
- AclTreeNode::delete_group_role (exists on AclTree)
- AclTreeNode::delete_user_role (same)
- AclTreeNode::insert_group_role (same)
- AclTreeNode::insert_user_role (same)
- AclTree::write_config (we have save_config())
- AclTree::load (we have config()/cached_config())

previously public, now crate-internal:
- AclTree::from_raw (only used by tests)
- split_acl_path (used by some test binaries)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agotape: add helper to read snapshot contents
Dietmar Maurer [Thu, 17 Dec 2020 12:05:00 +0000 (13:05 +0100)]
tape: add helper to read snapshot contents

- lock the snapshot for reading
- use openat to open files
- provides an iterator over all chunks

3 years agoKeyConfig: bail on wrong fingerprint
Fabian Grünbichler [Thu, 17 Dec 2020 09:53:21 +0000 (10:53 +0100)]
KeyConfig: bail on wrong fingerprint

instead of just logging the error. this should never happen in practice
unless someone is messing with the keyfile, in which case, it's better
to abort.

update tests accordingly (wrong fingerprint should fail, no fingerprint
should get the expected one).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agotape: add code to write backup snapshot files (without chunks) to tape
Dietmar Maurer [Thu, 17 Dec 2020 07:28:47 +0000 (08:28 +0100)]
tape: add code to write backup snapshot files (without chunks) to tape

3 years agotape: cleanup MediaCatalog
Dietmar Maurer [Thu, 17 Dec 2020 07:04:56 +0000 (08:04 +0100)]
tape: cleanup MediaCatalog

3 years agoKeyConfig: always calculate fingerprint
Fabian Grünbichler [Wed, 16 Dec 2020 13:41:11 +0000 (14:41 +0100)]
KeyConfig: always calculate fingerprint

and warn if stored and calculated fingerprint don't match.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoKeyConfig: add encrypt/decrypt test
Fabian Grünbichler [Wed, 16 Dec 2020 13:41:10 +0000 (14:41 +0100)]
KeyConfig: add encrypt/decrypt test

the RSA key and the encryption key itself are hard-coded to avoid
stalling the test runs because of lack of entropy, they have no special
significance otherwise.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agodocs: replace openssl command with client
Fabian Grünbichler [Wed, 16 Dec 2020 13:41:09 +0000 (14:41 +0100)]
docs: replace openssl command with client

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoclient: add 'import-with-master-key' command
Fabian Grünbichler [Wed, 16 Dec 2020 13:41:08 +0000 (14:41 +0100)]
client: add 'import-with-master-key' command

to import an encrypted encryption key using a master key.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agokey: move RSA-encryption to KeyConfig
Fabian Grünbichler [Wed, 16 Dec 2020 13:41:07 +0000 (14:41 +0100)]
key: move RSA-encryption to KeyConfig

since that is what gets encrypted, and not a CryptConfig.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agofix #3197: skip fingerprint check when restoring key
Fabian Grünbichler [Wed, 16 Dec 2020 13:41:06 +0000 (14:41 +0100)]
fix #3197: skip fingerprint check when restoring key

when restoring an encrypted key, the original one is obviously not
available to check the fingerprint with.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agomaster key: store blob name in constant
Fabian Grünbichler [Wed, 16 Dec 2020 13:41:05 +0000 (14:41 +0100)]
master key: store blob name in constant

since we will use it in more than one place.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agotape: remove MediaLabelInfo, use MediaId instead
Dietmar Maurer [Wed, 16 Dec 2020 12:27:53 +0000 (13:27 +0100)]
tape: remove MediaLabelInfo, use MediaId instead

The additional content_uuid was quite useless...

3 years agoupdate pxar dependency to 0.6.2
Thomas Lamprecht [Wed, 16 Dec 2020 12:13:31 +0000 (13:13 +0100)]
update pxar dependency to 0.6.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotape: improve docu
Dietmar Maurer [Wed, 16 Dec 2020 11:43:51 +0000 (12:43 +0100)]
tape: improve docu

3 years agotape: improve docu
Dietmar Maurer [Wed, 16 Dec 2020 11:23:52 +0000 (12:23 +0100)]
tape: improve docu

3 years agotape: add chunk archive reader/writer
Dietmar Maurer [Wed, 16 Dec 2020 11:08:34 +0000 (12:08 +0100)]
tape: add chunk archive reader/writer

3 years agotape: cleanup MediaLocation type for direct use with API
Dietmar Maurer [Wed, 16 Dec 2020 09:45:58 +0000 (10:45 +0100)]
tape: cleanup MediaLocation type for direct use with API

3 years agodocs: prune-sim: folluwp: add missing semicolon
Thomas Lamprecht [Wed, 16 Dec 2020 09:08:08 +0000 (10:08 +0100)]
docs: prune-sim: folluwp: add missing semicolon

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotape: add magic number to identify media catalog files
Dietmar Maurer [Wed, 16 Dec 2020 07:59:27 +0000 (08:59 +0100)]
tape: add magic number to identify media catalog files

3 years agoprune sim: correctly keep track of already included backups
Fabian Ebner [Mon, 14 Dec 2020 15:04:53 +0000 (15:04 +0000)]
prune sim: correctly keep track of already included backups

This needs to happen in a separate loop, because some time intervals are not
subsets of others, i.e. weeks and months. Previously, with a daily backup
schedule, having:
* a backup on Sun, 06 Dec 2020 kept by keep-daily
* a backup on Sun, 29 Nov 2020 kept by keep-weekly
would lead to the backup on Mon, 30 Nov 2020 to be selected for keep-monthly,
because the iteration did not yet reach the backup on Sun, 29 Nov 2020 that
would mark November as being covered.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agofollowup: use arrow function for sorting
Thomas Lamprecht [Tue, 15 Dec 2020 12:45:36 +0000 (13:45 +0100)]
followup: use arrow function for sorting

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoprune sim: fix #3192: by fixing usage of sort()
Fabian Ebner [Tue, 15 Dec 2020 12:01:33 +0000 (13:01 +0100)]
prune sim: fix #3192: by fixing usage of sort()

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agotape: add MediaCatalog implementation
Dietmar Maurer [Tue, 15 Dec 2020 12:13:44 +0000 (13:13 +0100)]
tape: add MediaCatalog implementation

3 years agotape: rename DriveLabel to MediaLabel
Dietmar Maurer [Mon, 14 Dec 2020 16:37:16 +0000 (17:37 +0100)]
tape: rename DriveLabel to MediaLabel

3 years agotape: improve file format docu
Dietmar Maurer [Mon, 14 Dec 2020 16:29:57 +0000 (17:29 +0100)]
tape: improve file format docu

3 years agotape: minor code cleanup
Dietmar Maurer [Mon, 14 Dec 2020 15:56:26 +0000 (16:56 +0100)]
tape: minor code cleanup

3 years agotape: scan - print more debug info
Dietmar Maurer [Mon, 14 Dec 2020 12:16:18 +0000 (13:16 +0100)]
tape: scan - print more debug info

3 years agotape: implement scan command (useful for debug)
Dietmar Maurer [Mon, 14 Dec 2020 11:55:49 +0000 (12:55 +0100)]
tape: implement scan command (useful for debug)

3 years agotape: implement eod cli command (debug tool)
Dietmar Maurer [Mon, 14 Dec 2020 08:56:59 +0000 (09:56 +0100)]
tape: implement eod cli command (debug tool)

3 years agotape: rename cli 'media media-destroy' toö 'media destroy'
Dietmar Maurer [Mon, 14 Dec 2020 08:30:32 +0000 (09:30 +0100)]
tape: rename cli 'media media-destroy' toö 'media destroy'

3 years agotape: implement destroy_media
Dietmar Maurer [Mon, 14 Dec 2020 07:58:40 +0000 (08:58 +0100)]
tape: implement destroy_media

3 years agotape: add media api
Dietmar Maurer [Mon, 14 Dec 2020 06:55:57 +0000 (07:55 +0100)]
tape: add media api

3 years agotape: make changer get_status async
Dietmar Maurer [Mon, 14 Dec 2020 06:14:24 +0000 (07:14 +0100)]
tape: make changer get_status async

3 years agotape: split api type definitions for changers into extra file
Dietmar Maurer [Sun, 13 Dec 2020 08:31:02 +0000 (09:31 +0100)]
tape: split api type definitions for changers into extra file

3 years agotape: rename CHANGER_ID_SCHEMA to CHANGER_NAME_SCHEMA
Dietmar Maurer [Sun, 13 Dec 2020 08:22:08 +0000 (09:22 +0100)]
tape: rename CHANGER_ID_SCHEMA to CHANGER_NAME_SCHEMA

3 years agotape: rename DRIVE_ID_SCHEMA to DRIVE_NAME_SCHEMA
Dietmar Maurer [Sun, 13 Dec 2020 08:18:16 +0000 (09:18 +0100)]
tape: rename DRIVE_ID_SCHEMA to DRIVE_NAME_SCHEMA

3 years agotape: correctly call Async handler in proxmox-tape
Dietmar Maurer [Sat, 12 Dec 2020 08:58:47 +0000 (09:58 +0100)]
tape: correctly call Async handler in proxmox-tape

3 years agotape: avoid executor blocking in changer api
Dietmar Maurer [Sat, 12 Dec 2020 08:45:08 +0000 (09:45 +0100)]
tape: avoid executor blocking in changer api

3 years agotape: avoid executor blocking in drive API
Dietmar Maurer [Sat, 12 Dec 2020 08:20:04 +0000 (09:20 +0100)]
tape: avoid executor blocking in drive API

By using tokio::task::spawn_blocking().

3 years agobump version to 1.0.6-1 v1.0.6
Thomas Lamprecht [Fri, 11 Dec 2020 11:58:14 +0000 (12:58 +0100)]
bump version to 1.0.6-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodebian: just install whole images directory
Thomas Lamprecht [Fri, 11 Dec 2020 13:18:37 +0000 (14:18 +0100)]
debian: just install whole images directory

fixes build for recently added tape icon (and includes it for real)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotape: add svg icon
Dietmar Maurer [Fri, 11 Dec 2020 12:02:23 +0000 (13:02 +0100)]
tape: add svg icon

3 years agotape: use WorkerTask for erase and rewind
Dietmar Maurer [Fri, 11 Dec 2020 10:15:58 +0000 (11:15 +0100)]
tape: use WorkerTask for erase and rewind

3 years agotape: split inventory api
Dietmar Maurer [Fri, 11 Dec 2020 09:42:29 +0000 (10:42 +0100)]
tape: split inventory api

inventory: sync, list labels with uuids,
update_inventory: WorkerTask, updates database

3 years agotape: run label commands as WorkerTask (threads)
Dietmar Maurer [Fri, 11 Dec 2020 08:10:22 +0000 (09:10 +0100)]
tape: run label commands as WorkerTask (threads)

3 years agotape: implement barcode-label-mdedia
Dietmar Maurer [Fri, 11 Dec 2020 06:50:19 +0000 (07:50 +0100)]
tape: implement barcode-label-mdedia

3 years agotape: implement inventory command
Dietmar Maurer [Fri, 11 Dec 2020 06:39:28 +0000 (07:39 +0100)]
tape: implement inventory command

3 years agodepend on package mt-st
Dietmar Maurer [Fri, 11 Dec 2020 05:38:45 +0000 (06:38 +0100)]
depend on package mt-st

We do not use the mt utility directly, but the package also provides
an udev helper to correctly initialize tape drives (stinit). Also,
the mt utility is helpful for debugging tap issues.

3 years agocontrol.in: fix indentation
Oguz Bektas [Thu, 10 Dec 2020 15:42:09 +0000 (16:42 +0100)]
control.in: fix indentation

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
3 years agofix build: add missing file
Dietmar Maurer [Thu, 10 Dec 2020 12:40:20 +0000 (13:40 +0100)]
fix build: add missing file

3 years agotape: implement read-label command
Dietmar Maurer [Thu, 10 Dec 2020 12:20:39 +0000 (13:20 +0100)]
tape: implement read-label command

3 years agotape: implement label command
Dietmar Maurer [Thu, 10 Dec 2020 11:30:27 +0000 (12:30 +0100)]
tape: implement label command

3 years agotape: add media pool handling
Dietmar Maurer [Thu, 10 Dec 2020 10:41:35 +0000 (11:41 +0100)]
tape: add media pool handling

3 years agotape: add media pool cli
Dietmar Maurer [Thu, 10 Dec 2020 10:08:29 +0000 (11:08 +0100)]
tape: add media pool cli

3 years agotape: add media pool config api
Dietmar Maurer [Thu, 10 Dec 2020 09:52:27 +0000 (10:52 +0100)]
tape: add media pool config api

3 years agotape: correctly sort drive api subdir
Dietmar Maurer [Thu, 10 Dec 2020 09:09:12 +0000 (10:09 +0100)]
tape: correctly sort drive api subdir

3 years agotape: implement option changer-drive-id
Dietmar Maurer [Thu, 10 Dec 2020 08:09:06 +0000 (09:09 +0100)]
tape: implement option changer-drive-id

3 years agotape: cli cleanup - avoid api redefinition
Dietmar Maurer [Thu, 10 Dec 2020 07:35:11 +0000 (08:35 +0100)]
tape: cli cleanup - avoid api redefinition

3 years agotape: implement delete property for drive update command
Dietmar Maurer [Thu, 10 Dec 2020 07:25:46 +0000 (08:25 +0100)]
tape: implement delete property for drive update command

3 years agotape: cleanup load-slot api
Dietmar Maurer [Thu, 10 Dec 2020 07:04:55 +0000 (08:04 +0100)]
tape: cleanup load-slot api

3 years agotape: cli cleanup - rename scana-for-* into scan
Dietmar Maurer [Thu, 10 Dec 2020 06:58:45 +0000 (07:58 +0100)]
tape: cli cleanup - rename scana-for-* into scan

3 years agotape: implement load-media command
Dietmar Maurer [Thu, 10 Dec 2020 06:52:56 +0000 (07:52 +0100)]
tape: implement load-media command

3 years agotape: implement eject
Dietmar Maurer [Wed, 9 Dec 2020 16:50:48 +0000 (17:50 +0100)]
tape: implement eject

3 years agotape: implement rewind
Dietmar Maurer [Wed, 9 Dec 2020 16:43:38 +0000 (17:43 +0100)]
tape: implement rewind

3 years agotape: implement erase media
Dietmar Maurer [Wed, 9 Dec 2020 16:35:31 +0000 (17:35 +0100)]
tape: implement erase media

3 years agotape: add command line interface proxmox-tape
Dietmar Maurer [Wed, 9 Dec 2020 11:58:43 +0000 (12:58 +0100)]
tape: add command line interface proxmox-tape

3 years agotape: do not remove changer while still used
Dietmar Maurer [Wed, 9 Dec 2020 11:55:54 +0000 (12:55 +0100)]
tape: do not remove changer while still used

3 years agotape: add changer property to drive create api
Dietmar Maurer [Wed, 9 Dec 2020 11:55:10 +0000 (12:55 +0100)]
tape: add changer property to drive create api

3 years agotape: set protected flag for configuration change api methods
Dietmar Maurer [Wed, 9 Dec 2020 11:02:55 +0000 (12:02 +0100)]
tape: set protected flag for configuration change api methods

3 years agoclient: move connect_to_localhost into client module
Dietmar Maurer [Wed, 9 Dec 2020 10:59:50 +0000 (11:59 +0100)]
client: move connect_to_localhost into client module

3 years agotape: add media state database
Dietmar Maurer [Wed, 9 Dec 2020 09:16:01 +0000 (10:16 +0100)]
tape: add media state database

3 years agoupdate control file
Dietmar Maurer [Wed, 9 Dec 2020 10:19:50 +0000 (11:19 +0100)]
update control file

3 years agoremove unused descriptions from api macros
Wolfgang Bumiller [Wed, 9 Dec 2020 09:54:38 +0000 (10:54 +0100)]
remove unused descriptions from api macros

these are now a hard error in the api macro

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agotape: expose basic tape/changer functionality at api2/tape/
Dietmar Maurer [Tue, 8 Dec 2020 14:42:50 +0000 (15:42 +0100)]
tape: expose basic tape/changer functionality at api2/tape/

3 years agotape: check digest on config update
Dietmar Maurer [Tue, 8 Dec 2020 10:24:38 +0000 (11:24 +0100)]
tape: check digest on config update

3 years agotape: add changer configuration API
Dietmar Maurer [Tue, 8 Dec 2020 08:04:56 +0000 (09:04 +0100)]
tape: add changer configuration API

3 years agotape: add tape drive configuration API
Dietmar Maurer [Mon, 7 Dec 2020 12:04:32 +0000 (13:04 +0100)]
tape: add tape drive configuration API

3 years agotape: add tape device driver
Dietmar Maurer [Mon, 7 Dec 2020 07:27:15 +0000 (08:27 +0100)]
tape: add tape device driver

3 years agotape: add BlockeReader/BlockedWriter streams
Dietmar Maurer [Sun, 6 Dec 2020 11:09:55 +0000 (12:09 +0100)]
tape: add BlockeReader/BlockedWriter streams

This is the basic format used to write data to tapes.

3 years agotape: add BlockHeader impl
Dietmar Maurer [Sun, 6 Dec 2020 09:26:24 +0000 (10:26 +0100)]
tape: add BlockHeader impl

3 years agotape: add helpers to emulate tape read/write behavior
Dietmar Maurer [Sun, 6 Dec 2020 08:41:16 +0000 (09:41 +0100)]
tape: add helpers to emulate tape read/write behavior

3 years agofix bug #3189: fix change_password permission checks, run protected
Dietmar Maurer [Sat, 5 Dec 2020 15:20:29 +0000 (16:20 +0100)]
fix bug #3189: fix change_password permission checks, run protected

3 years agodepend on mtx (tape changer control)
Dietmar Maurer [Sat, 5 Dec 2020 13:50:16 +0000 (14:50 +0100)]
depend on mtx (tape changer control)

A very small package with no additional dependencies.

3 years agotape: add tape changer support using 'mtx' command
Dietmar Maurer [Sat, 5 Dec 2020 13:46:57 +0000 (14:46 +0100)]
tape: add tape changer support using 'mtx' command

3 years agotape: add media invenotry
Dietmar Maurer [Sat, 5 Dec 2020 11:53:08 +0000 (12:53 +0100)]
tape: add media invenotry

3 years agotape: define useful constants
Dietmar Maurer [Sat, 5 Dec 2020 11:20:46 +0000 (12:20 +0100)]
tape: define useful constants

3 years agotape: add media pool config
Dietmar Maurer [Sat, 5 Dec 2020 10:59:38 +0000 (11:59 +0100)]
tape: add media pool config

3 years agotape: add tape read trait
Dietmar Maurer [Sat, 5 Dec 2020 09:54:38 +0000 (10:54 +0100)]
tape: add tape read trait

3 years agotape: add tape write trait
Dietmar Maurer [Sat, 5 Dec 2020 09:51:34 +0000 (10:51 +0100)]
tape: add tape write trait

3 years agotape: add file format definitions
Dietmar Maurer [Sat, 5 Dec 2020 09:45:08 +0000 (10:45 +0100)]
tape: add file format definitions

3 years agocommit missing file: tape api type definitions
Dietmar Maurer [Fri, 4 Dec 2020 15:00:16 +0000 (16:00 +0100)]
commit missing file: tape api type definitions

3 years agotape support: add drive configuration
Dietmar Maurer [Fri, 4 Dec 2020 14:42:32 +0000 (15:42 +0100)]
tape support: add drive configuration

3 years agostart experimental tape management GUI
Dietmar Maurer [Fri, 4 Dec 2020 11:50:08 +0000 (12:50 +0100)]
start experimental tape management GUI

You need to set the environment TEST_TAPE_GUI=1 to enable this.
The current GUI is only a placeholder.