]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
3 years agobump version to 1.1.0-1
Thomas Lamprecht [Tue, 13 Apr 2021 12:42:24 +0000 (14:42 +0200)]
bump version to 1.1.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: typo fixes
Thomas Lamprecht [Tue, 13 Apr 2021 12:42:01 +0000 (14:42 +0200)]
docs: typo fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: mention client repository and rework client installation
Thomas Lamprecht [Tue, 13 Apr 2021 12:37:36 +0000 (14:37 +0200)]
docs: mention client repository and rework client installation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: get help: actually link customer portal
Thomas Lamprecht [Tue, 13 Apr 2021 12:08:01 +0000 (14:08 +0200)]
docs: get help: actually link customer portal

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: client: add "Backup" to "Repository Locations" heading to avoid confusion
Thomas Lamprecht [Tue, 13 Apr 2021 12:07:24 +0000 (14:07 +0200)]
docs: client: add "Backup" to "Repository Locations" heading to avoid confusion

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agofix regression tests
Dietmar Maurer [Tue, 13 Apr 2021 12:02:37 +0000 (14:02 +0200)]
fix regression tests

3 years agoTapeRead: add skip_data()
Dietmar Maurer [Tue, 13 Apr 2021 11:11:44 +0000 (13:11 +0200)]
TapeRead: add skip_data()

3 years agod/rules: update binary path for proxmox-backup-file-restore
Thomas Lamprecht [Tue, 13 Apr 2021 10:18:29 +0000 (12:18 +0200)]
d/rules: update binary path for proxmox-backup-file-restore

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/control: update to track thiserror build dependency
Thomas Lamprecht [Tue, 13 Apr 2021 10:16:34 +0000 (12:16 +0200)]
d/control: update to track thiserror build dependency

was in Cargo.toml since commit
64ad7b706148b289d4ca67b87630cdc60f464cc

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoproxmox-backup-file-restore: fix various postinst bugs/bad-behavior
Thomas Lamprecht [Tue, 13 Apr 2021 09:39:54 +0000 (11:39 +0200)]
proxmox-backup-file-restore: fix various postinst bugs/bad-behavior

1. The exit was never called as `test ... || echo "foo" || exit 1`
   can never come to the exit, as echo will not fail

2. The echo was meant to be redirected to stderr (FD #2) but it was
   actually redirected to a file named '2'

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: tape/DriveStatus: show that no tape is loaded in grid title
Dominik Csapak [Tue, 13 Apr 2021 08:18:52 +0000 (10:18 +0200)]
ui: tape/DriveStatus: show that no tape is loaded in grid title

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/DriveStatus: remove buffer-mode
Dominik Csapak [Tue, 13 Apr 2021 08:18:51 +0000 (10:18 +0200)]
ui: tape/DriveStatus: remove buffer-mode

since this will almost always be set to '1', it has no real
value to show to the user

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotape: SgTapeReader::read_block - disable reading beyond EOF
Dietmar Maurer [Tue, 13 Apr 2021 09:44:06 +0000 (11:44 +0200)]
tape: SgTapeReader::read_block - disable reading beyond EOF

3 years agotape: cleanup MediaCatalog on tape reuse
Dietmar Maurer [Tue, 13 Apr 2021 07:43:00 +0000 (09:43 +0200)]
tape: cleanup MediaCatalog on tape reuse

3 years agod/control: bump versioned dependency for proxmox-widget-toolkit
Thomas Lamprecht [Tue, 13 Apr 2021 07:14:09 +0000 (09:14 +0200)]
d/control: bump versioned dependency for proxmox-widget-toolkit

to ensure we have the moved out file browser widget available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: file browser: adapt to abi changes
Thomas Lamprecht [Tue, 13 Apr 2021 07:06:30 +0000 (09:06 +0200)]
ui: file browser: adapt to abi changes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agouse FileBrowser from proxmox-widget-toolkit
Stefan Reiter [Thu, 1 Apr 2021 15:34:44 +0000 (17:34 +0200)]
use FileBrowser from proxmox-widget-toolkit

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoapi/datastore: allow pxar file download of entire archive
Stefan Reiter [Mon, 12 Apr 2021 15:32:52 +0000 (17:32 +0200)]
api/datastore: allow pxar file download of entire archive

Treat filepaths like "/root.pxar.didx" without a trailing slash as
wanting to download the entire archive content instead of erroring. The
zip-creation code already works fine for this scenario.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoui: index: drop enableTapeUI
Thomas Lamprecht [Mon, 12 Apr 2021 13:55:52 +0000 (15:55 +0200)]
ui: index: drop enableTapeUI

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: nav tree: code cleanup
Thomas Lamprecht [Mon, 12 Apr 2021 12:11:18 +0000 (14:11 +0200)]
ui: nav tree: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: nav tree: make datastore-add button less special cased
Thomas Lamprecht [Mon, 12 Apr 2021 12:10:57 +0000 (14:10 +0200)]
ui: nav tree: make datastore-add button less special cased

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: nav tree: code cleanup and unification between datastore and tapes
Thomas Lamprecht [Mon, 12 Apr 2021 12:09:29 +0000 (14:09 +0200)]
ui: nav tree: code cleanup and unification between datastore and tapes

datastore and tape entries are very similar but differ in some points
in such a way that a nice unification is not really that helpful, but
making similar key parts the same is still nice when reading the code

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotools/async_io: do not error on Accept for StaticIncoming
Dominik Csapak [Thu, 8 Apr 2021 12:28:20 +0000 (14:28 +0200)]
tools/async_io: do not error on Accept for StaticIncoming

in proxmox-backup-proxy, we log and discard any errors on 'accept',
so that we can continue to server requests

in proxmox-backup-api, we just have the StaticIncoming that accepts,
which will forward any errors from the underlying TcpListener

this patch also logs and discards the errors, like in the proxy.
Otherwise it could happen that if the api-daemon has more files open
than the proxy, it will shut itself down because of a
'too many open files' error if there are many open connections

(the service should also restart on exit i think, but this is
a separate issue)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotape: fix regression tests
Dietmar Maurer [Mon, 12 Apr 2021 12:08:05 +0000 (14:08 +0200)]
tape: fix regression tests

3 years agofix gathering io stats for zpools
Dominik Csapak [Mon, 12 Apr 2021 09:24:29 +0000 (11:24 +0200)]
fix gathering io stats for zpools

if a datastore or root is not used directly on the pool dir
(e.g. the installer creates 2 sub datasets ROOT/pbs-1), info in
/proc/self/mountinfo returns not the pool, but the path to the
dataset, which has no iostats itself in /proc/spl/kstat/zfs/
but only the pool itself

so instead of not gathering data at all, gather the info from the
underlying pool instead. if one has multiple datastores on the same
pool those rrd stats will be the same for all those datastores now
(instead of empty) similar to 'normal' directories

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotape: improve EOT error handling
Dietmar Maurer [Mon, 12 Apr 2021 09:25:40 +0000 (11:25 +0200)]
tape: improve EOT error handling

3 years agosgutils2: use thiserror to derive Error
Dietmar Maurer [Mon, 12 Apr 2021 07:36:29 +0000 (09:36 +0200)]
sgutils2: use thiserror to derive Error

3 years agobuildsys: fix restore package names
Thomas Lamprecht [Mon, 12 Apr 2021 10:52:19 +0000 (12:52 +0200)]
buildsys: fix restore package names

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: improve code-readability s/tapestore/tapeStore/
Thomas Lamprecht [Mon, 12 Apr 2021 10:34:26 +0000 (12:34 +0200)]
ui: improve code-readability s/tapestore/tapeStore/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoenable tape backup by default
Thomas Lamprecht [Mon, 12 Apr 2021 10:31:56 +0000 (12:31 +0200)]
enable tape backup by default

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/control: file restore: only recommend proxmox-backup-restore-image
Thomas Lamprecht [Fri, 9 Apr 2021 14:50:56 +0000 (16:50 +0200)]
d/control: file restore: only recommend proxmox-backup-restore-image

should not be a hard dependency, as one can use the file-restore tool
for pxar archives without it too

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/control: rename proxmox-file-restore to proxmox-backup-file-restore
Thomas Lamprecht [Fri, 9 Apr 2021 14:18:02 +0000 (16:18 +0200)]
d/control: rename proxmox-file-restore to proxmox-backup-file-restore

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agocleanup: move tape SCSI code to src/tape/drive/lto/sg_tape/
Dietmar Maurer [Fri, 9 Apr 2021 09:33:33 +0000 (11:33 +0200)]
cleanup: move tape SCSI code to src/tape/drive/lto/sg_tape/

3 years agobuildsys: dinstall: only install server/client debs
Thomas Lamprecht [Fri, 9 Apr 2021 08:08:55 +0000 (10:08 +0200)]
buildsys: dinstall: only install server/client debs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotape: read_drive_status - ignore media changed sense info
Dietmar Maurer [Fri, 9 Apr 2021 07:45:28 +0000 (09:45 +0200)]
tape: read_drive_status - ignore media changed sense info

3 years agosgutils2: implement scsi_request_sense()
Dietmar Maurer [Fri, 9 Apr 2021 07:44:51 +0000 (09:44 +0200)]
sgutils2: implement scsi_request_sense()

3 years agobump version to 1.0.14-1
Thomas Lamprecht [Thu, 8 Apr 2021 14:35:45 +0000 (16:35 +0200)]
bump version to 1.0.14-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/postinst: check for old tape.cfg
Thomas Lamprecht [Thu, 8 Apr 2021 16:05:01 +0000 (18:05 +0200)]
d/postinst: check for old tape.cfg

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoavoid extra separate upload to pbs repo
Thomas Lamprecht [Thu, 8 Apr 2021 15:12:00 +0000 (17:12 +0200)]
avoid extra separate upload to pbs repo

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoupload file restore package only to PVE for now
Thomas Lamprecht [Thu, 8 Apr 2021 15:11:15 +0000 (17:11 +0200)]
upload file restore package only to PVE for now

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agofile-restore: add 'extract' command for VM file restore
Stefan Reiter [Wed, 31 Mar 2021 10:22:02 +0000 (12:22 +0200)]
file-restore: add 'extract' command for VM file restore

The data on the restore daemon is either encoded into a pxar archive, to
provide the most accurate data for local restore, or encoded directly
into a zip file (or written out unprocessed for files), depending on the
'pxar' argument to the 'extract' API call.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agotools/zip: add zip_directory helper
Stefan Reiter [Wed, 31 Mar 2021 10:22:01 +0000 (12:22 +0200)]
tools/zip: add zip_directory helper

Encodes an entire local directory into an AsyncWrite recursively.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agopxar/extract: add sequential variant of extract_sub_dir
Stefan Reiter [Wed, 31 Mar 2021 10:22:00 +0000 (12:22 +0200)]
pxar/extract: add sequential variant of extract_sub_dir

extract_sub_dir_seq, together with seq_files_extractor, allow extracting
files from a pxar Decoder, along with the existing option for an
Accessor. To facilitate code re-use, some helper functions are extracted
in the process.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agofile-restore(-daemon): implement list API
Stefan Reiter [Wed, 31 Mar 2021 10:21:59 +0000 (12:21 +0200)]
file-restore(-daemon): implement list API

Allows listing files and directories on a block device snapshot.
Hierarchy displayed is:

/archive.img.fidx/bucket/component/<path>
e.g.
/drive-scsi0.img.fidx/part/2/etc/passwd
(corresponding to /etc/passwd on the second partition of drive-scsi0)

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodebian/client: add postinst hook to rebuild file-restore initramfs
Stefan Reiter [Wed, 31 Mar 2021 10:21:58 +0000 (12:21 +0200)]
debian/client: add postinst hook to rebuild file-restore initramfs

This will be triggered on updating proxmox-file-restore (via configure,
necessary since the daemon binary might change) and
proxmox-backup-restore-image (via 'activate-noawait', necessary since
the base image might change).

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agofile-restore: add basic VM/block device support
Stefan Reiter [Thu, 1 Apr 2021 15:43:52 +0000 (17:43 +0200)]
file-restore: add basic VM/block device support

Includes methods to start, stop and list QEMU file-restore VMs, as well
as CLI commands do the latter two (start is implicit).

The implementation is abstracted behind the concept of a
"BlockRestoreDriver", so other methods can be implemented later (e.g.
mapping directly to loop devices on the host, using other hypervisors
then QEMU, etc...).

Starting VMs is currently unused but will be needed for further changes.

The design for the QEMU driver uses a locked 'map' file
(/run/proxmox-backup/$UID/restore-vm-map.json) containing a JSON
encoding of currently running VMs. VMs are addressed by a 'name', which
is a systemd-unit encoded combination of repository and snapshot string,
thus uniquely identifying it.

Note that currently you need to run proxmox-file-restore as root to use
this method of restoring.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoadd tools/cpio encoding module
Stefan Reiter [Wed, 31 Mar 2021 10:21:55 +0000 (12:21 +0200)]
add tools/cpio encoding module

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agofile-restore-daemon: add disk module
Stefan Reiter [Wed, 31 Mar 2021 10:21:54 +0000 (12:21 +0200)]
file-restore-daemon: add disk module

Includes functionality for scanning and referring to partitions on
attached disks (i.e. snapshot images).

Fairly modular structure, so adding ZFS/LVM/etc... support in the future
should be easy.

The path is encoded as "/disk/bucket/component/path/to/file", e.g.
"/drive-scsi0/part/0/etc/passwd". See the comments for further
explanations on the design.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agofile-restore-daemon: add watchdog module
Stefan Reiter [Wed, 31 Mar 2021 10:21:53 +0000 (12:21 +0200)]
file-restore-daemon: add watchdog module

Add a watchdog that will automatically shut down the VM after 10
minutes, if no API call is received.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agofile-restore-daemon: add binary with virtio-vsock API server
Stefan Reiter [Wed, 31 Mar 2021 10:21:52 +0000 (12:21 +0200)]
file-restore-daemon: add binary with virtio-vsock API server

Implements the base of a small daemon to run within a file-restore VM.

The binary spawns an API server on a virtio-vsock socket, listening for
connections from the host. This happens mostly manually via the standard
Unix socket API, since tokio/hyper do not have support for vsock built
in. Once we have the accept'ed file descriptor, we can create a
UnixStream and use our tower service implementation for that.

The binary is deliberately not installed in the usual $PATH location,
since it shouldn't be executed on the host by a user anyway.

For now, only the API calls 'status' and 'stop' are implemented, to
demonstrate and test proxmox::api functionality.

Authorization is provided via a custom ApiAuth only checking a header
value against a static /ticket file.

Since the REST server implementation uses the log!() macro, we can
redirect its output to stdout by registering env_logger as the logging
target. env_logger is already in our dependency tree via zstd/bindgen.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoserver/rest: add ApiAuth trait to make user auth generic
Stefan Reiter [Wed, 31 Mar 2021 10:21:51 +0000 (12:21 +0200)]
server/rest: add ApiAuth trait to make user auth generic

This allows switching the base user identification/authentication method
in the rest server. Will initially be used for single file restore VMs,
where authentication is based on a ticket file, not the PBS user
backend (PAM/local).

To avoid putting generic types into the RestServer type for this, we
merge the two calls "extract_auth_data" and "check_auth" into a single
one, which can use whatever type it wants internally.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agofile-restore: allow specifying output-format
Stefan Reiter [Wed, 31 Mar 2021 10:21:49 +0000 (12:21 +0200)]
file-restore: allow specifying output-format

Makes CLI use more comfortable by not just printing JSON to the
terminal.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agofile-restore: add binary and basic commands
Dominik Csapak [Wed, 31 Mar 2021 10:21:48 +0000 (12:21 +0200)]
file-restore: add binary and basic commands

For now it only supports 'list' and 'extract' commands for 'pxar.didx'
files. This should be the foundation for a general file-restore
interface that is shared with block-level snapshots.

This is packaged as a seperate .deb file, since for block level restore
it will need to depend on pve-qemu-kvm, which we want to seperate from
proxmox-backup-client.

[original code for proxmox-file-restore.rs]
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
[code cleanups/clippy, use helpers::list_dir_content/ArchiveEntry, no
/block subdir for .fidx files, seperate binary and package]
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoupdate d/control
Thomas Lamprecht [Thu, 8 Apr 2021 11:54:33 +0000 (13:54 +0200)]
update d/control

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: tape/DriveStatus: improve status grid a bit
Dominik Csapak [Thu, 8 Apr 2021 11:39:20 +0000 (13:39 +0200)]
ui: tape/DriveStatus: improve status grid a bit

by using format_boolean for compression/write protect,
combining file/block posiition into one (saves a line)

and adding the missing alert-flags

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: hide selector for single drives in barcode-label
Dominik Csapak [Thu, 8 Apr 2021 11:39:19 +0000 (13:39 +0200)]
ui: tape/ChangerStatus: hide selector for single drives in barcode-label

it is rather pointless to let the user select something were there
is no choice. We have to keep the window though, since the user may
want to choose a pool

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: shortcut Inventory for single drives
Dominik Csapak [Thu, 8 Apr 2021 11:39:18 +0000 (13:39 +0200)]
ui: tape/ChangerStatus: shortcut Inventory for single drives

like 'load-media'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: shortcut 'load-media' for single drive
Dominik Csapak [Thu, 8 Apr 2021 11:39:17 +0000 (13:39 +0200)]
ui: tape/ChangerStatus: shortcut 'load-media' for single drive

if a changer only has a single drive, there is no point in showing
a window with a DriveSelector, just do want the user wanted.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: rework EraseWindow
Dominik Csapak [Thu, 8 Apr 2021 11:39:16 +0000 (13:39 +0200)]
ui: tape/ChangerStatus: rework EraseWindow

to make it more like a 'dangerous' remove window
also works in the singleDrive logic to hide/show the driveselector

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: save assigned drives
Dominik Csapak [Thu, 8 Apr 2021 11:39:15 +0000 (13:39 +0200)]
ui: tape/ChangerStatus: save assigned drives

so that we can shortcut later if we only have one

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/ChangerStatus: add missing property
Dominik Csapak [Thu, 8 Apr 2021 11:39:14 +0000 (13:39 +0200)]
ui: tape/ChangerStatus: add missing property

it will actually not fail, but we declare it nonetheless to indicate
that it exists

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: dashobard/DataStoreStatistics: add 'Available' column
Dominik Csapak [Mon, 29 Mar 2021 12:07:15 +0000 (14:07 +0200)]
ui: dashobard/DataStoreStatistics: add 'Available' column

for some storages, it is valuable information, e.g. if one has datastores
on separate datasets of the same zpool

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotape: add TapeDensity::Unknown
Dietmar Maurer [Thu, 8 Apr 2021 10:23:54 +0000 (12:23 +0200)]
tape: add TapeDensity::Unknown

3 years agoui: update tape DriveStatus for new driver
Dietmar Maurer [Thu, 8 Apr 2021 10:04:14 +0000 (12:04 +0200)]
ui: update tape DriveStatus for new driver

3 years agotape: avoid unneccessary SCSI request in Drop
Dietmar Maurer [Thu, 8 Apr 2021 09:26:08 +0000 (11:26 +0200)]
tape: avoid unneccessary SCSI request in Drop

3 years agotape: clear encryption key after backup (for security reasons)
Dietmar Maurer [Thu, 8 Apr 2021 08:37:49 +0000 (10:37 +0200)]
tape: clear encryption key after backup (for security reasons)

3 years agocleanup: remove unused linux tape driver code
Dietmar Maurer [Thu, 8 Apr 2021 08:15:52 +0000 (10:15 +0200)]
cleanup: remove unused linux tape driver code

3 years agoui: tape/TapeRestore: use correct value check for store & mapping
Dominik Csapak [Mon, 29 Mar 2021 11:25:37 +0000 (13:25 +0200)]
ui: tape/TapeRestore: use correct value check for store & mapping

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: tape/TapeRestore: fix restoring without mapping
Dominik Csapak [Mon, 29 Mar 2021 11:25:36 +0000 (13:25 +0200)]
ui: tape/TapeRestore: fix restoring without mapping

we have to delete the 'mapping' variable in any case since it's not
a valid api parameter

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agodocs: Mention our new user space tape driver, adopt device path names
Dietmar Maurer [Thu, 8 Apr 2021 07:50:09 +0000 (09:50 +0200)]
docs: Mention our new user space tape driver, adopt device path names

3 years agodo not depend on mt-st and mtx
Dietmar Maurer [Thu, 8 Apr 2021 07:48:47 +0000 (09:48 +0200)]
do not depend on mt-st and mtx

We now use our own driver, so those tools are no longer required.

3 years agotape: add vendor, product and revision to LtoDriveAndMediaStatus
Dietmar Maurer [Thu, 8 Apr 2021 06:00:30 +0000 (08:00 +0200)]
tape: add vendor, product and revision to LtoDriveAndMediaStatus

3 years agotape: pmt - implement options command
Dietmar Maurer [Wed, 7 Apr 2021 14:52:11 +0000 (16:52 +0200)]
tape: pmt - implement options command

3 years agotape: implement locate_file without LOCATE(10)
Dietmar Maurer [Wed, 7 Apr 2021 14:16:55 +0000 (16:16 +0200)]
tape: implement locate_file without LOCATE(10)

3 years agotape: pmt - re-implement lock/unlock command
Dietmar Maurer [Wed, 7 Apr 2021 10:12:26 +0000 (12:12 +0200)]
tape: pmt - re-implement lock/unlock command

3 years agotape: pmt - re-implement fsr/bsr
Dietmar Maurer [Wed, 7 Apr 2021 09:50:09 +0000 (11:50 +0200)]
tape: pmt - re-implement fsr/bsr

3 years agotape: correctly set/display drive option
Dietmar Maurer [Wed, 7 Apr 2021 09:11:35 +0000 (11:11 +0200)]
tape: correctly set/display drive option

3 years agosgutils2: add scsi_mode_sense helper
Dietmar Maurer [Tue, 6 Apr 2021 12:59:35 +0000 (14:59 +0200)]
sgutils2: add scsi_mode_sense helper

3 years agotape: make sure there is a filemark at the end of the tape
Dietmar Maurer [Tue, 6 Apr 2021 10:17:59 +0000 (12:17 +0200)]
tape: make sure there is a filemark at the end of the tape

3 years agotape: make fsf/bsf driver specific
Dietmar Maurer [Tue, 6 Apr 2021 09:09:21 +0000 (11:09 +0200)]
tape: make fsf/bsf driver specific

Because the virtual tape driver behaves different than LTO drives.

3 years agotape: fix LEOM handling
Dietmar Maurer [Thu, 1 Apr 2021 08:32:30 +0000 (10:32 +0200)]
tape: fix LEOM handling

3 years agotape: implement format/erase
Dietmar Maurer [Wed, 31 Mar 2021 07:19:19 +0000 (09:19 +0200)]
tape: implement format/erase

3 years agotape: implement LTO userspace driver
Dietmar Maurer [Tue, 30 Mar 2021 15:07:59 +0000 (17:07 +0200)]
tape: implement LTO userspace driver

3 years agotape: introduce trait BlockWrite
Dietmar Maurer [Mon, 29 Mar 2021 10:52:26 +0000 (12:52 +0200)]
tape: introduce trait BlockWrite

3 years agotape: introduce trait BlockRead
Dietmar Maurer [Mon, 29 Mar 2021 08:09:49 +0000 (10:09 +0200)]
tape: introduce trait BlockRead

3 years agoserver: rest: collapse nested if for less indentation
Thomas Lamprecht [Wed, 7 Apr 2021 15:57:19 +0000 (17:57 +0200)]
server: rest: collapse nested if for less indentation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoserver: rest: switch from fastest to default deflate compression level
Thomas Lamprecht [Wed, 7 Apr 2021 15:12:01 +0000 (17:12 +0200)]
server: rest: switch from fastest to default deflate compression level

I made some comparision with bombardier[0], the one listed here are
30s looped requests with two concurrent clients:

[ static download of ext-all.js ]:
  lvl                              avg /   stdev  / max
 none        1.98 MiB  100 %    5.17ms /  1.30ms / 32.38ms
 fastest   813.14 KiB   42 %   20.53ms /  2.85ms / 58.71ms
 default   626.35 KiB   30 %   39.70ms /  3.98ms / 85.47ms

[ deterministic (pre-defined data), but real API call ]:
  lvl                              avg /   stdev  / max
 none      129.09 KiB  100 %    2.70ms / 471.58us / 26.93ms
 fastest    42.12 KiB   33 %    3.47ms / 606.46us / 32.42ms
 default    34.82 KiB   27 %    4.28ms / 737.99us / 33.75ms

The reduction is quite better with default, but it's also slower, but
only when testing over unconstrained network. For real world
scenarios where compression actually matters, e.g., when using a
spotty train connection, we will be faster again with better
compression.

A GPRS limited connection (Firefox developer console) requires the
following load (until the DOMContentLoaded event triggered) times:
  lvl        t      x faster
 none      9m 18.6s   x 1.0
 fastest   3m 20.0s   x 2.8
 default   2m 30.0s   x 3.7

So for worst case using sligthly more CPU time on the server has a
tremendous effect on the client load time.

Using a more realistical example and limiting for "Good 2G" gives:

 none      1m  1.8s   x 1.0
 fastest      22.6s   x 2.7
 default      16.6s   x 3.7

16s is somewhat OK, >1m just isn't...

So, use default level to ensure we get bearable load times on
clients, and if we want to improve transmission size AND speed then
we could always use a in-memory cache, only a few MiB would be
required for the compressable static files we server.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotools/zip: compress zips with deflate
Dominik Csapak [Tue, 6 Apr 2021 09:03:47 +0000 (11:03 +0200)]
tools/zip: compress zips with deflate

by using our DeflateEncoder

for this to work, we have to create wrapper reader that generates the crc32
checksum while reading.

also we need to put the target writer in an Option, so that we can take
it out of self and move it into the DeflateEncoder while writing
compressed

we can drop the internal buffer then, since that is managed by the
deflate encoder now

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/zip: run rustfmt
Dominik Csapak [Tue, 6 Apr 2021 09:03:46 +0000 (11:03 +0200)]
tools/zip: run rustfmt

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoserver/rest: compress static files
Dominik Csapak [Tue, 6 Apr 2021 09:03:45 +0000 (11:03 +0200)]
server/rest: compress static files

compress them on the fly
and refactor the size limit for chunking files

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoserver/rest: compress api calls
Dominik Csapak [Tue, 6 Apr 2021 09:03:44 +0000 (11:03 +0200)]
server/rest: compress api calls

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoserver/rest: add helper to extract compression headers
Dominik Csapak [Tue, 6 Apr 2021 09:03:43 +0000 (11:03 +0200)]
server/rest: add helper to extract compression headers

for now we only extract 'deflate'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/compression: add DeflateEncoder and helpers
Dominik Csapak [Tue, 6 Apr 2021 09:03:42 +0000 (11:03 +0200)]
tools/compression: add DeflateEncoder and helpers

implements a deflate encoder that can compress anything that implements
AsyncRead + Unpin into a file with the helper 'compress'

if the inner type is a Stream, it implements Stream itself, this way
some streaming data can be streamed compressed

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools: add compression module
Dominik Csapak [Tue, 6 Apr 2021 09:03:41 +0000 (11:03 +0200)]
tools: add compression module

only contains a basic enum for the different compresssion methods

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agodocs: fix MathJax inclusion in build
Thomas Lamprecht [Mon, 5 Apr 2021 09:59:43 +0000 (11:59 +0200)]
docs: fix MathJax inclusion in build

Else it does not gets picked up on release builds...

Also the mathjax path option affects HTML not EPUB so move it to the
correct section in conf.py

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: fix heading
Thomas Lamprecht [Mon, 5 Apr 2021 09:59:18 +0000 (11:59 +0200)]
docs: fix heading

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 1.0.13-1 v1.0.13
Thomas Lamprecht [Fri, 2 Apr 2021 13:32:27 +0000 (15:32 +0200)]
bump version to 1.0.13-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agopxar: handle missing GROUP_OBJ ACL entries
Wolfgang Bumiller [Fri, 2 Apr 2021 08:45:07 +0000 (10:45 +0200)]
pxar: handle missing GROUP_OBJ ACL entries

Previously we did not store GROUP_OBJ ACL entries for
directories, this means that these were lost which may
potentially elevate group permissions if they were masked
before via ACLs, so we also show a warning.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agopxar: fix directory ACL entry creation
Wolfgang Bumiller [Fri, 2 Apr 2021 08:06:36 +0000 (10:06 +0200)]
pxar: fix directory ACL entry creation

Don't override `group_obj` with `None` when handling
`ACL_TYPE_DEFAULT` entries for directories.

Reproducer: /var/log/journal ends up without a `MASK` type
entry making it invalid as it has `USER` and `GROUP`
entries.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoserver/rest: drop now unused imports
Thomas Lamprecht [Thu, 1 Apr 2021 09:53:13 +0000 (11:53 +0200)]
server/rest: drop now unused imports

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>