]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
4 years agosrc/bin/proxmox-backup-client.rs - status: use format_and_print_result_full
Dietmar Maurer [Wed, 26 Feb 2020 12:29:00 +0000 (13:29 +0100)]
src/bin/proxmox-backup-client.rs - status: use format_and_print_result_full

4 years agosrc/bin/proxmox-backup-manager.rs: use crate::tools::runtime::block_on()
Dietmar Maurer [Wed, 26 Feb 2020 10:37:38 +0000 (11:37 +0100)]
src/bin/proxmox-backup-manager.rs: use crate::tools::runtime::block_on()

4 years agosrc/tools/runtime.rs: call OPENSSL_thread_stop to avoid race with openssl cleanup...
Dietmar Maurer [Wed, 26 Feb 2020 09:38:55 +0000 (10:38 +0100)]
src/tools/runtime.rs: call OPENSSL_thread_stop to avoid race with openssl cleanup handlers

4 years agosrc/client/backup_writer.rs: also print archive size
Dietmar Maurer [Tue, 25 Feb 2020 13:11:36 +0000 (14:11 +0100)]
src/client/backup_writer.rs: also print archive size

4 years agocleanup unused module
Wolfgang Bumiller [Tue, 25 Feb 2020 10:35:35 +0000 (11:35 +0100)]
cleanup unused module

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agodocs: add documentation for pxar
Christian Ebner [Thu, 20 Feb 2020 17:55:29 +0000 (18:55 +0100)]
docs: add documentation for pxar

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: Change text of warning for files matched by exclude patterns.
Christian Ebner [Thu, 20 Feb 2020 13:29:13 +0000 (14:29 +0100)]
pxar: Change text of warning for files matched by exclude patterns.

In addition to the .pxarexclude files, glob match patterns can be passed to pxar
also via cli parameters.
Therefore the warning is rephrased to be more ambiguous.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/client/backup_writer.rs: prefix upload stats with archive name
Dietmar Maurer [Mon, 24 Feb 2020 12:24:46 +0000 (13:24 +0100)]
src/client/backup_writer.rs: prefix upload stats with archive name

4 years agosrc/client/backup_writer.rs: implement verbose options
Dietmar Maurer [Mon, 24 Feb 2020 11:48:40 +0000 (12:48 +0100)]
src/client/backup_writer.rs: implement verbose options

4 years agosrc/client/backup_writer.rs: reduce verbosity
Dietmar Maurer [Mon, 24 Feb 2020 10:33:00 +0000 (11:33 +0100)]
src/client/backup_writer.rs: reduce verbosity

4 years agodocs: fix typo
Christian Ebner [Wed, 19 Feb 2020 15:36:59 +0000 (16:36 +0100)]
docs: fix typo

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agodocs: Add documentation for .pxarexclude files
Christian Ebner [Wed, 19 Feb 2020 15:32:39 +0000 (16:32 +0100)]
docs: Add documentation for .pxarexclude files

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/backup/backup_info.rs: fix SNAPSHOT_PATH_REGEX and GROUP_PATH_REGEX
Dietmar Maurer [Tue, 18 Feb 2020 12:16:35 +0000 (13:16 +0100)]
src/backup/backup_info.rs: fix SNAPSHOT_PATH_REGEX and GROUP_PATH_REGEX

4 years agoruntime: fix blocking strategy:
Wolfgang Bumiller [Mon, 17 Feb 2020 08:48:22 +0000 (09:48 +0100)]
runtime: fix blocking strategy:

- do not "double"-block_in_place() (it may not be nested)
- do not call block_in_place() in non-worker threads

is_in_tokio() isn't sufficient, we need to actually know
that we're in a worker-thread, so we do this by remembering
that we're blocking.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoruntime: remove IN_TOKIO thread local variable
Wolfgang Bumiller [Thu, 13 Feb 2020 07:56:37 +0000 (08:56 +0100)]
runtime: remove IN_TOKIO thread local variable

tokio now has Handle::try_current() allowing us to
generally check for a tokio runtime even if spawned by
someone else

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoadministration-guide.rst: documnet new PBS_FINGERPRINT env var
Dietmar Maurer [Tue, 11 Feb 2020 11:06:02 +0000 (12:06 +0100)]
administration-guide.rst: documnet new PBS_FINGERPRINT env var

4 years agosrc/client/http_client.rs: do not store fingerprints passed via options in cache
Dietmar Maurer [Tue, 11 Feb 2020 10:54:43 +0000 (11:54 +0100)]
src/client/http_client.rs: do not store fingerprints passed via options in cache

4 years agosrc/client/http_client.rs: always convert fingerprint to lowercase
Dietmar Maurer [Tue, 11 Feb 2020 10:37:24 +0000 (11:37 +0100)]
src/client/http_client.rs: always convert fingerprint to lowercase

4 years agosrc/client/http_client.rs: remove useless password_env
Dietmar Maurer [Tue, 11 Feb 2020 10:10:13 +0000 (11:10 +0100)]
src/client/http_client.rs: remove useless password_env

4 years agosrc/bin/proxmox-backup-client.rs: allows to pass fingerprint via env vars
Dietmar Maurer [Tue, 11 Feb 2020 10:01:57 +0000 (11:01 +0100)]
src/bin/proxmox-backup-client.rs: allows to pass fingerprint via env vars

4 years agos/pbsbanner/proxmox-backup-banner/ + move to /usr/lib
Thomas Lamprecht [Mon, 10 Feb 2020 13:43:26 +0000 (14:43 +0100)]
s/pbsbanner/proxmox-backup-banner/ + move to /usr/lib

We want to avoid pbs if possible and also avoid placing internal
binaries, not intended for human direct use, in /bin or /sbin paths.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopbsbanner: use match and also return error
Thomas Lamprecht [Fri, 7 Feb 2020 17:30:41 +0000 (18:30 +0100)]
pbsbanner: use match and also return error

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd login banner service
Thomas Lamprecht [Thu, 6 Feb 2020 21:08:07 +0000 (22:08 +0100)]
add login banner service

Modeled after the one from PVE, but using rust instead of perl for
resolving the nodename and writing to /etc/issue

Behavior differs a bit. We write all non-loopback addresses to this
file, as the gui accepts connections from them all, so limiting it to
the first one is not really sensible.
Further an error to resolve, or only getting loopback addresses won't
write out an empty /etc/issue file, but a note about the error at the
place where the address would be displayed.

Named it "pbsbanner", not "proxmox-backup-banner" as it's rather an
internal tool anyway and mirrors pvebanner, pmgbanner

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocatalog: shell: Allow two or more successive slashes in path.
Christian Ebner [Tue, 4 Feb 2020 12:37:03 +0000 (13:37 +0100)]
catalog: shell: Allow two or more successive slashes in path.

Two or more successive slashes should be allowed and treated as a single slash.
We also do not treat two successive slashes at the beginning of a path any
different.

Details are found here:
https://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap04.html#tag_04_11

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopxar::fuse: cleanup: Remove unused code.
Christian Ebner [Mon, 3 Feb 2020 12:34:50 +0000 (13:34 +0100)]
pxar::fuse: cleanup: Remove unused code.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopxar::fuse: Refactor lookup in order to cache accessed entries.
Christian Ebner [Mon, 3 Feb 2020 12:34:49 +0000 (13:34 +0100)]
pxar::fuse: Refactor lookup in order to cache accessed entries.

Context::find_goodbye_entry() is removed and incorporated into the lookup
callback in order to take advantage of the entry_cache and since it is only used
inside this callback.
All entries read on lookup are cached.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopxar: Improve read performance for fuse.
Christian Ebner [Mon, 3 Feb 2020 10:21:28 +0000 (11:21 +0100)]
pxar: Improve read performance for fuse.

By storing the payload start offset in the `DirectoryEntry` and passing this
information to `Decoder::read()`, the payload can be read directly and a repeated
re-reading of the entry information is avoided.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agosrc/bin/proxmox-backup-client.rs: do not use api macro for prune
Dietmar Maurer [Fri, 31 Jan 2020 09:31:00 +0000 (10:31 +0100)]
src/bin/proxmox-backup-client.rs: do not use api macro for prune

So that we can use add_common_prune_prameters!() macro again.

4 years agosrc/config/remote.rs: do not serialize empty option
Dietmar Maurer [Fri, 31 Jan 2020 08:09:24 +0000 (09:09 +0100)]
src/config/remote.rs: do not serialize empty option

4 years agosrc/section_config.rs - write: improve error message
Dietmar Maurer [Fri, 31 Jan 2020 08:08:42 +0000 (09:08 +0100)]
src/section_config.rs - write: improve error message

4 years agodepend on proxmox 0.1.13, use new tty helpers from there
Dietmar Maurer [Fri, 31 Jan 2020 07:16:00 +0000 (08:16 +0100)]
depend on proxmox 0.1.13, use new tty helpers from there

4 years agodocs: fix typos
Christian Ebner [Thu, 30 Jan 2020 13:19:09 +0000 (14:19 +0100)]
docs: fix typos

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agodocs: Add documentation for mounting pxar archives via FUSE.
Christian Ebner [Thu, 30 Jan 2020 13:19:08 +0000 (14:19 +0100)]
docs: Add documentation for mounting pxar archives via FUSE.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agoproxmox-backup-client: add missing prune options to api definition.
Christian Ebner [Wed, 29 Jan 2020 15:34:07 +0000 (16:34 +0100)]
proxmox-backup-client: add missing prune options to api definition.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agoupdate proxmox dependency to 0.1.12
Dietmar Maurer [Fri, 31 Jan 2020 05:59:17 +0000 (06:59 +0100)]
update proxmox dependency to 0.1.12

4 years agosrc/bin/proxmox-backup-manager.rs: remove stale debug comment
Dietmar Maurer [Thu, 30 Jan 2020 16:59:13 +0000 (17:59 +0100)]
src/bin/proxmox-backup-manager.rs: remove stale debug comment

4 years agosrc/bin/proxmox-backup-manager.rs - list remotes: do not use client, call directly
Dietmar Maurer [Thu, 30 Jan 2020 16:57:37 +0000 (17:57 +0100)]
src/bin/proxmox-backup-manager.rs - list remotes: do not use client, call directly

4 years agosrc/bin/proxmox-backup-manager.rs: use new texdt table formatter
Dietmar Maurer [Thu, 30 Jan 2020 12:29:39 +0000 (13:29 +0100)]
src/bin/proxmox-backup-manager.rs: use new texdt table formatter

4 years agosrc/api2/node/tasks.rs; make list_tasks public
Dietmar Maurer [Thu, 30 Jan 2020 12:28:25 +0000 (13:28 +0100)]
src/api2/node/tasks.rs; make list_tasks public

4 years agofixup
Dietmar Maurer [Thu, 30 Jan 2020 12:30:54 +0000 (13:30 +0100)]
fixup

4 years agosrc/section_config.rs - convert_to_array: add option to skip properties
Dietmar Maurer [Thu, 30 Jan 2020 12:26:46 +0000 (13:26 +0100)]
src/section_config.rs - convert_to_array: add option to skip properties

4 years agodocs: Extend documentation on interactive restore with catalog shell.
Christian Ebner [Wed, 29 Jan 2020 14:14:38 +0000 (15:14 +0100)]
docs: Extend documentation on interactive restore with catalog shell.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agodocs: s/RUST/Rust/
Christian Ebner [Wed, 29 Jan 2020 14:14:37 +0000 (15:14 +0100)]
docs: s/RUST/Rust/

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar::fuse: Do not return fcaps value on listxattr.
Christian Ebner [Tue, 28 Jan 2020 11:42:25 +0000 (12:42 +0100)]
pxar::fuse: Do not return fcaps value on listxattr.

listxattr must only return the name list, no extended attribute values.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopxar::fuse: return ACL names in listxattr if present
Christian Ebner [Tue, 28 Jan 2020 11:42:24 +0000 (12:42 +0100)]
pxar::fuse: return ACL names in listxattr if present

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopxar::fuse: add support to read ACLs.
Christian Ebner [Tue, 28 Jan 2020 11:42:23 +0000 (12:42 +0100)]
pxar::fuse: add support to read ACLs.

ACLs are stored separately in the pxar archive. This implements the functionality
needed to read the ACLs and return them as extended attributes in the getxattr
callback.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agotools::acl: Add helpers to create extended attribute buffer.
Christian Ebner [Tue, 28 Jan 2020 11:42:22 +0000 (12:42 +0100)]
tools::acl: Add helpers to create extended attribute buffer.

This helpers are used to construct the extended attributes values from
the ACLs stored in the pxar archive.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopxar: move acl helper functions to src/tools/acl.rs
Christian Ebner [Tue, 28 Jan 2020 11:42:21 +0000 (12:42 +0100)]
pxar: move acl helper functions to src/tools/acl.rs

They are not only needed by the pxar::sequential_decoder but also for the fuse
xattr impl, so it makes more sense to have them there.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agotools: LruCache: add dropcheck marker
Wolfgang Bumiller [Tue, 28 Jan 2020 10:34:25 +0000 (11:34 +0100)]
tools: LruCache: add dropcheck marker

See https://doc.rust-lang.org/nomicon/phantom-data.html

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agosrc/api2/types.rs: define and use struct TaskListItem
Dietmar Maurer [Tue, 28 Jan 2020 10:22:06 +0000 (11:22 +0100)]
src/api2/types.rs: define and use struct TaskListItem

4 years agosrc/api2/node/tasks.rs: use api macro for list_tasks
Dietmar Maurer [Tue, 28 Jan 2020 09:57:33 +0000 (10:57 +0100)]
src/api2/node/tasks.rs: use api macro for list_tasks

4 years agopxar::fuse: Introduce LRU caching for goodbye table and directory entries.
Christian Ebner [Fri, 24 Jan 2020 10:55:14 +0000 (11:55 +0100)]
pxar::fuse: Introduce LRU caching for goodbye table and directory entries.

The goodbye table of directory entries is cached in a LRU cache to speed up
subsequent accesses.
This is especially important for directories with many entries, as then the
readdirplus callback is called repeatedly because of the limited reply buffer
size.

`DirectoryEntry`s are cached for subsequent access in their own LRU cache,
independent of the goodbye tables.

In order to avoid borrow conflicts, the `Context` provides a fn as_mut_refs
as well as a fn run_with_context_refs.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopxar::fuse: refactor fn stat
Christian Ebner [Fri, 24 Jan 2020 10:55:13 +0000 (11:55 +0100)]
pxar::fuse: refactor fn stat

By passing `&DirectoryEntry` to stat, the function interface is simplified.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agouse proxmox 0.1.9 with new cli command helpers
Dietmar Maurer [Mon, 27 Jan 2020 17:08:43 +0000 (18:08 +0100)]
use proxmox 0.1.9 with new cli command helpers

4 years agosrc/client/http_client.rs: new password_env option
Dietmar Maurer [Mon, 27 Jan 2020 09:42:19 +0000 (10:42 +0100)]
src/client/http_client.rs: new password_env option

4 years agosrc/client/http_client.rs: new prefix options
Dietmar Maurer [Mon, 27 Jan 2020 08:34:02 +0000 (09:34 +0100)]
src/client/http_client.rs: new prefix options

4 years agosrc/client/http_client.rs: implement fingerprint cache
Dietmar Maurer [Sat, 25 Jan 2020 14:37:34 +0000 (15:37 +0100)]
src/client/http_client.rs: implement fingerprint cache

4 years agosrc/client/http_client.rs: new struct HttpClientOptions
Dietmar Maurer [Sat, 25 Jan 2020 11:18:00 +0000 (12:18 +0100)]
src/client/http_client.rs: new struct HttpClientOptions

4 years agosrc/config/remote.rs: add fingerprint
Dietmar Maurer [Sat, 25 Jan 2020 08:48:39 +0000 (09:48 +0100)]
src/config/remote.rs: add fingerprint

4 years agosrc/api2/types.rs: add CERT_FINGERPRINT_SHA256_SCHEMA
Dietmar Maurer [Fri, 24 Jan 2020 11:00:28 +0000 (12:00 +0100)]
src/api2/types.rs: add CERT_FINGERPRINT_SHA256_SCHEMA

4 years agosrc/bin/proxmox-backup-client.rs: fix another typo in property description
Christian Ebner [Fri, 24 Jan 2020 12:31:46 +0000 (13:31 +0100)]
src/bin/proxmox-backup-client.rs: fix another typo in property description

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agosrc/bin/proxmox-backup-client.rs: fix typo in property description
Christian Ebner [Fri, 24 Jan 2020 12:07:35 +0000 (13:07 +0100)]
src/bin/proxmox-backup-client.rs: fix typo in property description

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agobump proxmox crate version requirement
Wolfgang Bumiller [Fri, 24 Jan 2020 12:43:25 +0000 (13:43 +0100)]
bump proxmox crate version requirement

it contained an important api macro bugfix

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agotools: add access method to LruCache
Christian Ebner [Thu, 23 Jan 2020 17:12:42 +0000 (18:12 +0100)]
tools: add access method to LruCache

This will return a mutable reference just like get_mut, but on a cache miss
it will get and insert the missing value via the fetch method provided via the
Cacher trait.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agosrc/api2/admin/datastore.rs - download_file: use BACKUP_ARCHIVE_NAME_SCHEMA for file...
Dietmar Maurer [Thu, 23 Jan 2020 12:49:30 +0000 (13:49 +0100)]
src/api2/admin/datastore.rs - download_file: use BACKUP_ARCHIVE_NAME_SCHEMA for file-name

4 years agosrc/api2/types.rs: define and use api type GarbageCollectionStatus
Dietmar Maurer [Thu, 23 Jan 2020 12:31:52 +0000 (13:31 +0100)]
src/api2/types.rs: define and use api type GarbageCollectionStatus

4 years agosrc/api2/admin/datastore.rs: use api macro for start_garbage_collection
Dietmar Maurer [Thu, 23 Jan 2020 12:01:21 +0000 (13:01 +0100)]
src/api2/admin/datastore.rs: use api macro for start_garbage_collection

4 years agosrc/api2/types.rs: define and use struct StorageStatus
Dietmar Maurer [Thu, 23 Jan 2020 11:42:40 +0000 (12:42 +0100)]
src/api2/types.rs: define and use struct StorageStatus

4 years agosrc/api2/types.rs: define struct BackupContent, and use it with list_snapshot_files
Dietmar Maurer [Thu, 23 Jan 2020 10:16:57 +0000 (11:16 +0100)]
src/api2/types.rs: define struct BackupContent, and use it with list_snapshot_files

4 years agosrc/backup/manifest.rs: check if manifest contains files
Dietmar Maurer [Thu, 23 Jan 2020 10:16:12 +0000 (11:16 +0100)]
src/backup/manifest.rs: check if manifest contains files

4 years agosrc/api2/admin/datastore.rs: use api macro for delete_snapshot
Dietmar Maurer [Thu, 23 Jan 2020 09:16:45 +0000 (10:16 +0100)]
src/api2/admin/datastore.rs: use api macro for delete_snapshot

4 years agosrc/backup/datastore.rs: remove_backup_(group/dir) - return Error instead of io:...
Dietmar Maurer [Thu, 23 Jan 2020 09:14:46 +0000 (10:14 +0100)]
src/backup/datastore.rs: remove_backup_(group/dir) - return Error instead of io::Error

4 years agosrc/api2/pull.rs: delete fanished snapshots
Dietmar Maurer [Thu, 23 Jan 2020 08:58:57 +0000 (09:58 +0100)]
src/api2/pull.rs: delete fanished snapshots

4 years agosrc/backup/datastore.rs: improve error messages
Dietmar Maurer [Thu, 23 Jan 2020 08:58:14 +0000 (09:58 +0100)]
src/backup/datastore.rs: improve error messages

4 years agosrc/api2/pull.rs: use new Datastore::last_successful_backup helper
Dietmar Maurer [Wed, 22 Jan 2020 14:06:28 +0000 (15:06 +0100)]
src/api2/pull.rs: use new Datastore::last_successful_backup helper

Do not fail if local group does not exists.

4 years agosrc/backup/datastore.rs: new helpers
Dietmar Maurer [Wed, 22 Jan 2020 14:04:08 +0000 (15:04 +0100)]
src/backup/datastore.rs: new helpers

last_successful_backup: Returns the time of the last successful backup
group_path: Returns the absolute path for a backup_group
snapshot_path: Returns the absolute path for a backup_dir

4 years agofollowup: commit all changes
Thomas Lamprecht [Wed, 22 Jan 2020 13:14:52 +0000 (14:14 +0100)]
followup: commit all changes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapi/datastore: do not allow updating path for now
Thomas Lamprecht [Wed, 15 Jan 2020 15:11:44 +0000 (16:11 +0100)]
api/datastore: do not allow updating path for now

It's a bit dangerous as it points to all the saved backups, so they
would be seemingly lost after updating the path.
Follow our logic from other products, e.g. in PVE we do not allow to
update the backing path/location of a storage either for similar
reasons.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agotools: LRU cache to use for pxar FUSE implementation.
Christian Ebner [Tue, 21 Jan 2020 13:21:53 +0000 (14:21 +0100)]
tools: LRU cache to use for pxar FUSE implementation.

Implements a cache with least recently used cache replacement policy.
Internally the state is tracked by a HashMap (for fast access) and a doubly
linked list (for the access order).

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/bin/proxmox-backup-client.rs: use a std channel to write the catalog
Dietmar Maurer [Wed, 22 Jan 2020 11:49:08 +0000 (12:49 +0100)]
src/bin/proxmox-backup-client.rs: use a std channel to write the catalog

4 years agosrc/client/pxar_backup_stream.rs: use a channel instead of a pipe
Dietmar Maurer [Wed, 22 Jan 2020 10:37:16 +0000 (11:37 +0100)]
src/client/pxar_backup_stream.rs: use a channel instead of a pipe

4 years agosrc/tools/std_channel_writer.rs: new StdChannelWriter helper class
Dietmar Maurer [Wed, 22 Jan 2020 10:33:17 +0000 (11:33 +0100)]
src/tools/std_channel_writer.rs: new StdChannelWriter helper class

4 years agofixup tests for the new proxmox crate layout
Wolfgang Bumiller [Wed, 22 Jan 2020 09:08:40 +0000 (10:08 +0100)]
fixup tests for the new proxmox crate layout

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agobump proxmox crate to 0.1.7
Wolfgang Bumiller [Tue, 21 Jan 2020 11:28:01 +0000 (12:28 +0100)]
bump proxmox crate to 0.1.7

The -sys, -tools and -api crate have now been merged into
the proxmx crate directly. Only macro crates are separate
(but still reexported by the proxmox crate in their
designated locations).

When we need to depend on "parts" of the crate later on
we'll just have to use features.

The reason is mostly that these modules had
inter-dependencies which really make them not independent
enough to be their own crates.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoswitch to debcargo for generating d/control
Fabian Grünbichler [Wed, 15 Jan 2020 09:29:57 +0000 (10:29 +0100)]
switch to debcargo for generating d/control

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agouse proxmox_backup::tools::runtime::main to run async run_cli_command
Dietmar Maurer [Tue, 21 Jan 2020 10:34:45 +0000 (11:34 +0100)]
use proxmox_backup::tools::runtime::main to run async run_cli_command

4 years agoruntime: actually park on Pending...
Wolfgang Bumiller [Tue, 21 Jan 2020 09:37:16 +0000 (10:37 +0100)]
runtime: actually park on Pending...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoruntime: custom block_on implementation
Wolfgang Bumiller [Tue, 21 Jan 2020 09:24:52 +0000 (10:24 +0100)]
runtime: custom block_on implementation

futures::executor::block_on does not allow nesting, but we
need that...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoruntime: drop now not required Send and static restrictions
Wolfgang Bumiller [Mon, 20 Jan 2020 13:09:24 +0000 (14:09 +0100)]
runtime: drop now not required Send and static restrictions

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agointroduce new runtime tokio helpers
Wolfgang Bumiller [Mon, 20 Jan 2020 11:52:22 +0000 (12:52 +0100)]
introduce new runtime tokio helpers

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopxar::fuse: remove open, opendir and releasedir callbacks
Christian Ebner [Mon, 20 Jan 2020 10:49:32 +0000 (11:49 +0100)]
pxar::fuse: remove open, opendir and releasedir callbacks

They are not needed as there is no internal state which needs to be tracked.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: Include symlink target in DirectoryEntry
Christian Ebner [Fri, 17 Jan 2020 10:21:44 +0000 (11:21 +0100)]
pxar: Include symlink target in DirectoryEntry

This allows to read the target path of a symbolic link in the
Decoder::read_directory_entry() function and stores it in the DirectoryEntry.
By this the Decoder::read_link() function becomes obsolete and is therefore
removed.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/client/pxar_backup_stream.rs: use std::thread::Builder to name the thread
Dietmar Maurer [Sat, 18 Jan 2020 11:21:22 +0000 (12:21 +0100)]
src/client/pxar_backup_stream.rs: use std::thread::Builder to name the thread

To make debugging easier.

4 years agotodo: remove done suggestion
Oguz Bektas [Fri, 17 Jan 2020 13:24:24 +0000 (14:24 +0100)]
todo: remove done suggestion

we now ask for the password twice when creating keys or changing
passphrases.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agosrc/api2/pull.rs: implement delete flag for vanished groups
Dietmar Maurer [Fri, 17 Jan 2020 10:24:55 +0000 (11:24 +0100)]
src/api2/pull.rs: implement delete flag for vanished groups

4 years agosrc/backup/backup_info.rs: new list_groups helper
Dietmar Maurer [Fri, 17 Jan 2020 09:39:32 +0000 (10:39 +0100)]
src/backup/backup_info.rs: new list_groups helper

4 years agosrc/api2/types.rs: define and use GroupListItem
Dietmar Maurer [Fri, 17 Jan 2020 09:17:18 +0000 (10:17 +0100)]
src/api2/types.rs: define and use GroupListItem

4 years agopxar: Refactor fuse and remove unused code.
Christian Ebner [Thu, 16 Jan 2020 14:56:42 +0000 (15:56 +0100)]
pxar: Refactor fuse and remove unused code.

By ambiguously using the Decoder::read_directory_entry() the code is simplified
and reading of the DirectoryEntry is concentrated into Context::run_in_context().

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar::fuse: Always use start offset of entries as inode.
Christian Ebner [Thu, 16 Jan 2020 14:56:41 +0000 (15:56 +0100)]
pxar::fuse: Always use start offset of entries as inode.

Previously it was disciminated based on the entry mode.
For directories, the inode was the offset of the corresponding
goodbye tail mark while for all others it was the offset of the filename.

By simply using the start offset as calculated from the corresponding
goodbye table entry (which yields the archive offset of the filename),
the code is simplified and the more ambiguous read_directory_entry()
function can be used.
The disatvantage of this approach is the need to keep track of the
start and end offsets for each entry, as the end offset is needed in
order to access the goodbye table of directory entries.
The root node still has to be treated special, as it's inode is 1 as per fuse
definition and it has no filename as per the pxar file format definition.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar::decoder: refactor Decoder::lookup()
Christian Ebner [Thu, 16 Jan 2020 10:26:58 +0000 (11:26 +0100)]
pxar::decoder: refactor Decoder::lookup()

Use Decoder::read_directory_entry() instead of Decoder::attributes() as this
already returns the needed DirectoryEntry.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>