]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
3 years agobump proxmox dep to 0.10.7
Wolfgang Bumiller [Tue, 23 Feb 2021 13:44:03 +0000 (14:44 +0100)]
bump proxmox dep to 0.10.7

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoui: tape/BackupJobs: add CRUD functions
Dominik Csapak [Tue, 23 Feb 2021 10:58:01 +0000 (11:58 +0100)]
ui: tape/BackupJobs: add CRUD functions

similar to the other jobs grids (add/edit/remove etc.)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/config/tape_backup_job: enable update api call
Dominik Csapak [Tue, 23 Feb 2021 10:58:00 +0000 (11:58 +0100)]
api2/config/tape_backup_job: enable update api call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotape: improve backup task logging
Dietmar Maurer [Tue, 23 Feb 2021 11:58:44 +0000 (12:58 +0100)]
tape: improve backup task logging

3 years agotape: volume-statistics - use format_size to display byte counts
Dietmar Maurer [Tue, 23 Feb 2021 10:38:41 +0000 (11:38 +0100)]
tape: volume-statistics - use format_size to display byte counts

3 years agoui: use grid to display tape drivbe status
Dietmar Maurer [Tue, 23 Feb 2021 10:29:43 +0000 (11:29 +0100)]
ui: use grid to display tape drivbe status

3 years agoui: fix tape volume statistics
Dietmar Maurer [Tue, 23 Feb 2021 10:20:27 +0000 (11:20 +0100)]
ui: fix tape volume statistics

3 years agoui: use grid to display tape label information
Dietmar Maurer [Tue, 23 Feb 2021 10:13:48 +0000 (11:13 +0100)]
ui: use grid to display tape label information

3 years agoapi-viewer: do not show permission for backup/restore protocol
Dietmar Maurer [Tue, 23 Feb 2021 09:04:16 +0000 (10:04 +0100)]
api-viewer: do not show permission for backup/restore protocol

Permission check is done before the H2 upgrade.

3 years agoui: tape/ChangerStatus: do not show progress on drive clean
Dominik Csapak [Tue, 23 Feb 2021 08:14:41 +0000 (09:14 +0100)]
ui: tape/ChangerStatus: do not show progress on drive clean

since we have the state in the grid

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: do not show progressbar for (un)load
Dominik Csapak [Tue, 23 Feb 2021 08:06:33 +0000 (09:06 +0100)]
ui: tape/ChangerStatus: do not show progressbar for (un)load

since we already show the state of the drive in the grid, this is
not necessary

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: add missing model fields
Dominik Csapak [Tue, 23 Feb 2021 08:06:32 +0000 (09:06 +0100)]
ui: tape/ChangerStatus: add missing model fields

the DiffStore only updates the fiels given in the model, so we have to
list all the fields we depend on, else we have incomplete data,
e.g. for rendering

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: disable drive buttons when it's blocked
Dominik Csapak [Mon, 22 Feb 2021 13:25:37 +0000 (14:25 +0100)]
ui: tape/ChangerStatus: disable drive buttons when it's blocked

if the drive state is not empty, some action blocks it, so we cannot
do any task anyway. Since we now refresh the state every 5 seconds,
we can disable/enable them 'live'.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: convert grid stores to DiffStores
Dominik Csapak [Mon, 22 Feb 2021 13:25:36 +0000 (14:25 +0100)]
ui: tape/ChangerStatus: convert grid stores to DiffStores

to not deselect items when the store is updated

this makes the ui a bit better to use

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: reload changer status (cached) every 5000ms
Dominik Csapak [Mon, 22 Feb 2021 13:25:35 +0000 (14:25 +0100)]
ui: tape/ChangerStatus: reload changer status (cached) every 5000ms

so that we can have an updated drive status without having to
press 'reload'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: only show loading on 'force refresh'
Dominik Csapak [Mon, 22 Feb 2021 13:25:34 +0000 (14:25 +0100)]
ui: tape/ChangerStatus: only show loading on 'force refresh'

so that we can update in the background without interfering with the
users workflow

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agodocs: fix some typos/grammar
Thomas Lamprecht [Mon, 22 Feb 2021 17:08:57 +0000 (18:08 +0100)]
docs: fix some typos/grammar

Rund `codespell` tool, but it picked up not as much as I hoped.
Rest was found with vim + (hun)spell

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodoc: fix wrong api method description
Dietmar Maurer [Mon, 22 Feb 2021 11:10:34 +0000 (12:10 +0100)]
doc: fix wrong api method description

3 years agoapi-viewer: show permissions
Dietmar Maurer [Mon, 22 Feb 2021 11:01:24 +0000 (12:01 +0100)]
api-viewer: show permissions

3 years agodocs: improve MEDIA_SET_NAMING_TEMPLATE_SCHEMA description
Dietmar Maurer [Mon, 22 Feb 2021 08:50:16 +0000 (09:50 +0100)]
docs: improve MEDIA_SET_NAMING_TEMPLATE_SCHEMA description

3 years agotape: use correct schema for changer path (SCSI_CHANGER_PATH_SCHEMA)
Dietmar Maurer [Mon, 22 Feb 2021 08:43:13 +0000 (09:43 +0100)]
tape: use correct schema for changer path (SCSI_CHANGER_PATH_SCHEMA)

3 years agocleanup: cleanup use clause (avoid *)
Dietmar Maurer [Mon, 22 Feb 2021 08:33:29 +0000 (09:33 +0100)]
cleanup: cleanup use clause (avoid *)

3 years agodocs: fix EXPORT_SLOT_LIST_SCHEMA description
Dietmar Maurer [Mon, 22 Feb 2021 08:05:07 +0000 (09:05 +0100)]
docs: fix EXPORT_SLOT_LIST_SCHEMA description

3 years agoapi-viewer: fix path for upgraded HTTP/2 proptocls
Dietmar Maurer [Mon, 22 Feb 2021 07:38:27 +0000 (08:38 +0100)]
api-viewer: fix path for upgraded HTTP/2 proptocls

3 years agodocgen: improve regex format
Dietmar Maurer [Sun, 21 Feb 2021 15:14:11 +0000 (16:14 +0100)]
docgen: improve regex format

3 years agodocgen: dump string format (property strings)
Dietmar Maurer [Sun, 21 Feb 2021 14:52:38 +0000 (15:52 +0100)]
docgen: dump string format (property strings)

3 years agodocgen: improve api schema dump
Dietmar Maurer [Sun, 21 Feb 2021 11:00:06 +0000 (12:00 +0100)]
docgen: improve api schema dump

3 years agodocs: api-viewer - add backup and restore APIs
Dietmar Maurer [Sun, 21 Feb 2021 09:38:33 +0000 (10:38 +0100)]
docs: api-viewer - add backup and restore APIs

3 years ago.gitignore: do not ingnor .html files - we have some of them in the repository
Dietmar Maurer [Sun, 21 Feb 2021 09:04:52 +0000 (10:04 +0100)]
.gitignore: do not ingnor .html files - we have some of them in the repository

3 years agoadd missing file docs/api-viewer/index.html
Dietmar Maurer [Sun, 21 Feb 2021 09:04:23 +0000 (10:04 +0100)]
add missing file docs/api-viewer/index.html

3 years agodocs: install API viewer
Dietmar Maurer [Sun, 21 Feb 2021 08:00:13 +0000 (09:00 +0100)]
docs: install API viewer

3 years agoadopt PVEAPI.js for PBS, rename to PBSAPI.js
Dietmar Maurer [Sun, 21 Feb 2021 07:55:16 +0000 (08:55 +0100)]
adopt PVEAPI.js for PBS, rename to PBSAPI.js

3 years agocopy api-viewer from pve-docs
Dietmar Maurer [Sun, 21 Feb 2021 07:51:52 +0000 (08:51 +0100)]
copy api-viewer from pve-docs

3 years agodocgen: implement api schema generation (for api-viewer)
Dietmar Maurer [Sun, 21 Feb 2021 07:45:42 +0000 (08:45 +0100)]
docgen: implement api schema generation (for api-viewer)

Just a start - not complete jet.

3 years agotape: extend MediaChange trait to return MtxStatus
Dietmar Maurer [Sat, 20 Feb 2021 09:23:16 +0000 (10:23 +0100)]
tape: extend MediaChange trait to return MtxStatus

3 years agotape: update changer status inside ScsiMediaChange implementation
Dietmar Maurer [Sat, 20 Feb 2021 08:56:27 +0000 (09:56 +0100)]
tape: update changer status inside ScsiMediaChange implementation

3 years agotape: update changer status cache after load/unload
Dietmar Maurer [Sat, 20 Feb 2021 08:06:17 +0000 (09:06 +0100)]
tape: update changer status cache after load/unload

3 years agotape: create tmp dirs early at server startup
Dietmar Maurer [Fri, 19 Feb 2021 16:49:50 +0000 (17:49 +0100)]
tape: create tmp dirs early at server startup

3 years agoui: window/Settings / WebAuthn: add browser setting for userVerificationo
Dominik Csapak [Fri, 19 Feb 2021 14:40:49 +0000 (15:40 +0100)]
ui: window/Settings / WebAuthn: add browser setting for userVerificationo

some fido2/webauthn keys can have a pin, and the client can request
a mode for the user verification.

'default' (no value set), lets the browser/device decide if the user has to
enter the pin of the device
'discouraged' requests that the user should not need to enter the pin
'preferred' requests that the user should need to enter the pin (if possible)

since we use webauthn only as a 2nd factor, having the user enter
the device pin on login may seem too much hassle for some users, so
give them the option

since this is a client option anyway, do not save it in the backend, but
in the browser local storage

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: add browser settings window
Dominik Csapak [Fri, 19 Feb 2021 14:40:48 +0000 (15:40 +0100)]
ui: add browser settings window

mostly copied from pve (for now; will refactor when i add it to
pmg too (soon)) without the pve specific features like dashboard
storages

contains some eslint fixes comparing to pves window

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: fixup for conditional
Dominik Csapak [Fri, 19 Feb 2021 14:40:24 +0000 (15:40 +0100)]
ui: tape/ChangerStatus: fixup for conditional

the statement !a === "somestring" cannot be true since
!a is either true or false and thus not a string

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape: fix eslint warnings (trailing comma)
Dominik Csapak [Fri, 19 Feb 2021 14:40:23 +0000 (15:40 +0100)]
ui: tape: fix eslint warnings (trailing comma)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotape: cache changer state
Dietmar Maurer [Fri, 19 Feb 2021 15:48:19 +0000 (16:48 +0100)]
tape: cache changer state

3 years agoupdate gitignore
Thomas Lamprecht [Fri, 19 Feb 2021 11:38:40 +0000 (12:38 +0100)]
update gitignore

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: tape/ChangerStatus: show the state of the drive
Dominik Csapak [Thu, 18 Feb 2021 14:40:30 +0000 (15:40 +0100)]
ui: tape/ChangerStatus: show the state of the drive

an optimize the columns for smaller layouts (1280 width)
we show either:
* Idle
* spinner + status (if no upid)
* spinner + rendered UPID (clickable, opens task viewer)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/tape/{backup, restore}, proxmox-tape: set device state
Dominik Csapak [Thu, 18 Feb 2021 14:40:28 +0000 (15:40 +0100)]
api2/tape/{backup, restore}, proxmox-tape: set device state

set the drive device state everywhere we lock it, so that we
know what it currently does

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/tape/changer: add drive state to changer status output
Dominik Csapak [Thu, 18 Feb 2021 14:40:27 +0000 (15:40 +0100)]
api2/tape/changer: add drive state to changer status output

if we can find the drive in the config and it has a state

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/tape/drive: wrap some api calls in run_drive_blocking_task
Dominik Csapak [Thu, 18 Feb 2021 14:40:26 +0000 (15:40 +0100)]
api2/tape/drive: wrap some api calls in run_drive_blocking_task

those calls could also block, so we have to run them in a blocking
tokio task, as to not block the current thread

nice side effect is that we now also update the state for that
drive in those instances

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/tape/drive: use run_drive_blocking_task where possible
Dominik Csapak [Thu, 18 Feb 2021 14:40:25 +0000 (15:40 +0100)]
api2/tape/drive: use run_drive_blocking_task where possible

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/tape/drive: add wrapper for tokio::task::spawn_blocking
Dominik Csapak [Thu, 18 Feb 2021 14:40:24 +0000 (15:40 +0100)]
api2/tape/drive: add wrapper for tokio::task::spawn_blocking

similar to the worker wrapper, lock, write status, run code, unset status

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/tape/drive: use 'run_drive_worker' where possible
Dominik Csapak [Thu, 18 Feb 2021 14:40:23 +0000 (15:40 +0100)]
api2/tape/drive: use 'run_drive_worker' where possible

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/tape/drive: add run_drive_worker wrapper
Dominik Csapak [Thu, 18 Feb 2021 14:40:22 +0000 (15:40 +0100)]
api2/tape/drive: add run_drive_worker wrapper

a wrapper for locking, starting the worker and writing the state

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotape/drive: add get/set status functions
Dominik Csapak [Thu, 18 Feb 2021 14:40:21 +0000 (15:40 +0100)]
tape/drive: add get/set status functions

simply writes into/reads from a file in /run, we will use this
for writing the upid (or potential other states) per drive

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotape/drive: add test_device_path_lock
Dominik Csapak [Thu, 18 Feb 2021 14:40:20 +0000 (15:40 +0100)]
tape/drive: add test_device_path_lock

this makes it possible to detect if the drive was locked in a
non-blocking manner

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agocleanup: use serde(flatten) for VerificationJobStatus, improve code reuse
Dietmar Maurer [Fri, 19 Feb 2021 08:50:25 +0000 (09:50 +0100)]
cleanup: use serde(flatten) for VerificationJobStatus, improve code reuse

3 years agocleanup: use serde(flatten) for SyncJobStatus, improve code reuse
Dietmar Maurer [Fri, 19 Feb 2021 08:36:39 +0000 (09:36 +0100)]
cleanup: use serde(flatten) for SyncJobStatus, improve code reuse

3 years agoui: cleanup - reuse existing code
Dietmar Maurer [Fri, 19 Feb 2021 08:14:31 +0000 (09:14 +0100)]
ui: cleanup - reuse existing code

3 years agoui: tape/BackupJobs.js - render task scheduling status
Dietmar Maurer [Fri, 19 Feb 2021 08:08:00 +0000 (09:08 +0100)]
ui: tape/BackupJobs.js - render task scheduling status

3 years agoapi: list tape backup jobs with scheduling status
Dietmar Maurer [Fri, 19 Feb 2021 08:02:13 +0000 (09:02 +0100)]
api: list tape backup jobs with scheduling status

3 years agoadd helper to compute job scheduling state
Dietmar Maurer [Fri, 19 Feb 2021 07:58:50 +0000 (08:58 +0100)]
add helper to compute job scheduling state

3 years agoapi: add new type JobScheduleStatus
Dietmar Maurer [Fri, 19 Feb 2021 07:23:41 +0000 (08:23 +0100)]
api: add new type JobScheduleStatus

3 years agoui: start tape backup job GUI
Dietmar Maurer [Thu, 18 Feb 2021 11:48:54 +0000 (12:48 +0100)]
ui: start tape backup job GUI

3 years agoui: tape/ChangerStatus.js - avoid update status in list_media
Dietmar Maurer [Thu, 18 Feb 2021 11:06:49 +0000 (12:06 +0100)]
ui: tape/ChangerStatus.js - avoid update status in list_media

We do not use the media location, so there is no need to update
the online status in the list_media call. Besides, we already update
the online status when we query the changer/status.

3 years agoui: tape/ChangerStatus.js - only update status for selected changer
Dietmar Maurer [Thu, 18 Feb 2021 10:08:13 +0000 (11:08 +0100)]
ui: tape/ChangerStatus.js - only update status for selected changer

To reduce load/wait time.

3 years agotape: media_list API - allow to update online status for a single changer
Dietmar Maurer [Thu, 18 Feb 2021 09:59:33 +0000 (10:59 +0100)]
tape: media_list API - allow to update online status for a single changer

3 years agoui: tape/TapeInventory.js - avoid update changer status
Dietmar Maurer [Thu, 18 Feb 2021 09:10:51 +0000 (10:10 +0100)]
ui: tape/TapeInventory.js - avoid update changer status

We do not update changer status by default - only when pressing "Reload" button.

3 years agoui: tape/TapeInventory: set defaultValue for pool to ''
Dominik Csapak [Thu, 18 Feb 2021 08:26:44 +0000 (09:26 +0100)]
ui: tape/TapeInventory: set defaultValue for pool to ''

otherwise the grouping feature of the grid gets confused as it encounters
undefined values

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: adapt load/unload to WorkerTask
Dominik Csapak [Thu, 18 Feb 2021 08:18:09 +0000 (09:18 +0100)]
ui: tape/ChangerStatus: adapt load/unload to WorkerTask

those are now workertasks (behind a 'POST' request), so show the
progress with the upid

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: rename 'slot' column to 'id'
Dominik Csapak [Thu, 18 Feb 2021 08:18:08 +0000 (09:18 +0100)]
ui: tape/ChangerStatus: rename 'slot' column to 'id'

slot is already in the title of the grid, and hide it by default for
drives (the user does not need it there)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: add Inventory column to drives/import-export
Dominik Csapak [Thu, 18 Feb 2021 08:18:07 +0000 (09:18 +0100)]
ui: tape/ChangerStatus: add Inventory column to drives/import-export

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: improve task description for loat/unload media
Dietmar Maurer [Thu, 18 Feb 2021 08:23:50 +0000 (09:23 +0100)]
ui: improve task description for loat/unload media

3 years agoupdate d/control
Wolfgang Bumiller [Thu, 18 Feb 2021 08:13:38 +0000 (09:13 +0100)]
update d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agotape: use worker tasks for media load/unload
Dietmar Maurer [Thu, 18 Feb 2021 08:04:51 +0000 (09:04 +0100)]
tape: use worker tasks for media load/unload

3 years agoui: tape/TapeInventory.js - use grid grouping feature - group by pool
Dietmar Maurer [Thu, 18 Feb 2021 06:30:37 +0000 (07:30 +0100)]
ui: tape/TapeInventory.js - use grid grouping feature - group by pool

3 years agoclient: extract common functions to proxmox_client_tools module
Stefan Reiter [Tue, 16 Feb 2021 17:06:57 +0000 (18:06 +0100)]
client: extract common functions to proxmox_client_tools module

...including common schemata, connect(), extract_*() and completion
functions.

For later use with proxmox-file-restore binary.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agobump pxar to 0.9.0
Wolfgang Bumiller [Wed, 17 Feb 2021 08:56:56 +0000 (09:56 +0100)]
bump pxar to 0.9.0

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoasyncify pxar create_archive
Stefan Reiter [Tue, 9 Feb 2021 12:03:48 +0000 (13:03 +0100)]
asyncify pxar create_archive

...to take advantage of the aio::Encoder from the pxar create.

Rather straightforward conversion, but does require getting rid of
references in the Archiver struct, and thus has to be given the Mutex
for the catalog directly. The callback is boxed.

archive_dir_contents can call itself recursively, and thus needs to
return a boxed future.

Users are adjusted, namely PxarBackupStream is converted to use an
Abortable future instead of a thread so it supports async in its handler
function, and the pxar bin create_archive is converted to an async API
function. One test case is made to just use 'block_on'.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agopxar/extract: add extract_sub_dir
Dominik Csapak [Tue, 16 Feb 2021 17:06:55 +0000 (18:06 +0100)]
pxar/extract: add extract_sub_dir

to extract some subdirectory of a pxar into a given target
this will be used in the client

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoapi2/admin/datastore: refactor create_zip into pxar/extract
Dominik Csapak [Tue, 16 Feb 2021 17:06:54 +0000 (18:06 +0100)]
api2/admin/datastore: refactor create_zip into pxar/extract

we will reuse that code in the client, so we need to move it to
where we can access it from the client

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
[clippy fixes]
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoapi2/admin/datastore: accept "/" as path for root
Dominik Csapak [Tue, 16 Feb 2021 17:06:53 +0000 (18:06 +0100)]
api2/admin/datastore: accept "/" as path for root

makes more sense than sending "root'"

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoapi2/admin/datastore: refactor list_dir_content in catalog_reader
Dominik Csapak [Tue, 16 Feb 2021 17:06:52 +0000 (18:06 +0100)]
api2/admin/datastore: refactor list_dir_content in catalog_reader

we will reuse that later in the client, so we need it somewhere
we can use from there

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
[add strongly typed ArchiveEntry and put api code into helpers.rs]
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoclient: add VsockClient to connect to virtio-vsock VMs
Stefan Reiter [Tue, 16 Feb 2021 17:07:02 +0000 (18:07 +0100)]
client: add VsockClient to connect to virtio-vsock VMs

Currently useful only for single file restore, but kept generic enough
to use any compatible API endpoint over a virtio-vsock[0,1] interface.

VsockClient is adapted and slimmed down from HttpClient.

A tower-compatible VsockConnector is implemented, using a wrapped
UnixStream as transfer. The UnixStream has to be wrapped in a custom
struct to implement 'Connection', Async{Read,Write} are simply forwarded
directly to the underlying stream.

[0] https://www.man7.org/linux/man-pages/man7/vsock.7.html
[1] https://wiki.qemu.org/Features/VirtioVsock

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agorest: implement tower service for UnixStream
Stefan Reiter [Tue, 16 Feb 2021 17:07:01 +0000 (18:07 +0100)]
rest: implement tower service for UnixStream

This allows anything that can be represented as a UnixStream to be used
as transport for an API server (e.g. virtio sockets).

A tower service expects an IP address as it's peer, which we can't
reliably provide for unix socket based transports, so just fake one.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agotape: add regression test for compute_media_state
Dietmar Maurer [Wed, 17 Feb 2021 05:57:29 +0000 (06:57 +0100)]
tape: add regression test for compute_media_state

3 years agoui: tape/BackupOverview: insert the tapes between media-set and snapshot
Dominik Csapak [Tue, 16 Feb 2021 11:48:12 +0000 (12:48 +0100)]
ui: tape/BackupOverview: insert the tapes between media-set and snapshot

but auto-expand them, so no additional click is necessary

this shows the user which tapes are involved for the media sets

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: css: remove vertical align for pbs-tape-icon
Dominik Csapak [Tue, 16 Feb 2021 11:48:11 +0000 (12:48 +0100)]
ui: css: remove vertical align for pbs-tape-icon

and combine the unnecessary duplicate definition

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape: improve tape-erase and add it to library view
Dominik Csapak [Tue, 16 Feb 2021 11:48:10 +0000 (12:48 +0100)]
ui: tape: improve tape-erase and add it to library view

refactor erase window, limit drives to changer if given

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotape: erase_media - automatically load media (with tape libraries).
Dietmar Maurer [Tue, 16 Feb 2021 10:05:26 +0000 (11:05 +0100)]
tape: erase_media - automatically load media (with tape libraries).

3 years agoui: tape/BackupOverview: show mediaset loading error in msg box instead
Dominik Csapak [Tue, 16 Feb 2021 08:35:26 +0000 (09:35 +0100)]
ui: tape/BackupOverview: show mediaset loading error in msg box instead

if a catalog is missing (or the loading otherwise throws an error), show
the error message in a msg box instead of a mask. this way a user can
still navigate the tree

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/TapeInventory: add erase button
Dominik Csapak [Tue, 16 Feb 2021 08:35:25 +0000 (09:35 +0100)]
ui: tape/TapeInventory: add erase button

to erase the selected tape

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/tape/drive: add optional label-text to erase
Dominik Csapak [Tue, 16 Feb 2021 08:35:24 +0000 (09:35 +0100)]
api2/tape/drive: add optional label-text to erase

if given, erases the tape only iff the inserted tape contains that label
used to safeguard tape erasing from ui for standalone drives

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotape: add regression test for alloc_writable_media
Dietmar Maurer [Tue, 16 Feb 2021 09:14:45 +0000 (10:14 +0100)]
tape: add regression test for alloc_writable_media

3 years agoui: tape/TapeManagement: change Text of Backup/Tape Inventory
Dominik Csapak [Mon, 15 Feb 2021 14:22:23 +0000 (15:22 +0100)]
ui: tape/TapeManagement: change Text of Backup/Tape Inventory

to 'Content' and 'Inventory' respectively

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/TapeInventory: add 'Add Tape' button
Dominik Csapak [Mon, 15 Feb 2021 14:22:22 +0000 (15:22 +0100)]
ui: tape/TapeInventory: add 'Add Tape' button

by adapting and reusing the 'LabelMedia' window

shows a short notice about inserting the correct tape in the drive
and now allows to select a drive

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/TapeInventory: change to regular store
Dominik Csapak [Mon, 15 Feb 2021 14:22:21 +0000 (15:22 +0100)]
ui: tape/TapeInventory: change to regular store

listing the media can potentially hang (changer status), so do not
reload in the background, only on activate

also increase the timeout to 5 minutes and add a reload button

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: use whole drives grid for masking on unload
Dominik Csapak [Mon, 15 Feb 2021 11:18:20 +0000 (12:18 +0100)]
ui: tape/ChangerStatus: use whole drives grid for masking on unload

instead of just the tableview

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: increase timeout for api calls
Dominik Csapak [Mon, 15 Feb 2021 11:18:19 +0000 (12:18 +0100)]
ui: tape/ChangerStatus: increase timeout for api calls

since tape commands can take a while and we do not want to change
all of those to worker tasks, increase the timeout to 5 minutes

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotape: ui - avoid changer status query in backup content panel
Dietmar Maurer [Mon, 15 Feb 2021 11:17:36 +0000 (12:17 +0100)]
tape: ui - avoid changer status query in backup content panel

3 years agotape: implement API to run tape backup jobs
Dietmar Maurer [Mon, 15 Feb 2021 10:09:30 +0000 (11:09 +0100)]
tape: implement API to run tape backup jobs

3 years agocleanup: tape_backup_job.rs - do not use #[allow(non_camel_case_types)]
Dietmar Maurer [Mon, 15 Feb 2021 09:39:39 +0000 (10:39 +0100)]
cleanup: tape_backup_job.rs - do not use #[allow(non_camel_case_types)]