]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
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>
4 years agorenamed: src/config/remotes.rs -> src/config/remote.rs
Dietmar Maurer [Thu, 16 Jan 2020 13:32:06 +0000 (14:32 +0100)]
renamed: src/config/remotes.rs -> src/config/remote.rs

And use 'remote' instead of 'remotes' everywhere.

4 years agosrc/backup/catalog.rs - SenderWriter: use tokio::task::block_in_place
Dietmar Maurer [Thu, 16 Jan 2020 13:24:15 +0000 (14:24 +0100)]
src/backup/catalog.rs - SenderWriter: use tokio::task::block_in_place

Make sure we do not block the executor.

4 years agosrc/api2/pull.rs: use reference to remote configuration
Dietmar Maurer [Thu, 16 Jan 2020 12:54:29 +0000 (13:54 +0100)]
src/api2/pull.rs: use reference to remote configuration

4 years agosrc/client/remote_chunk_reader.rs: use tokio::task::block_in_place to avoid blocking
Dietmar Maurer [Thu, 16 Jan 2020 12:52:23 +0000 (13:52 +0100)]
src/client/remote_chunk_reader.rs: use tokio::task::block_in_place to avoid blocking

Else we block the current executor.

4 years agoupdate tokio to 0.2.9
Fabian Grünbichler [Thu, 16 Jan 2020 12:23:24 +0000 (13:23 +0100)]
update tokio to 0.2.9

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agobump proxmox crate version
Wolfgang Bumiller [Thu, 16 Jan 2020 10:39:44 +0000 (11:39 +0100)]
bump proxmox crate version

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoremove the rust-toolchain file
Dietmar Maurer [Thu, 16 Jan 2020 09:45:46 +0000 (10:45 +0100)]
remove the rust-toolchain file

4 years agoset toolchain to system
Dietmar Maurer [Thu, 16 Jan 2020 09:34:45 +0000 (10:34 +0100)]
set toolchain to system

4 years agodebian: bump dependency versions
Wolfgang Bumiller [Thu, 16 Jan 2020 09:20:41 +0000 (10:20 +0100)]
debian: bump dependency versions

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agofix use of deprecated items
Wolfgang Bumiller [Thu, 16 Jan 2020 07:58:54 +0000 (08:58 +0100)]
fix use of deprecated items

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoimport ordering cleanup
Wolfgang Bumiller [Thu, 16 Jan 2020 07:51:52 +0000 (08:51 +0100)]
import ordering cleanup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopxar::fuse: remove readdir implementation
Christian Ebner [Wed, 15 Jan 2020 12:11:42 +0000 (13:11 +0100)]
pxar::fuse: remove readdir implementation

By not implementing readdir but only readdirplus, the FUSE_CAP_READDIRPLUS flag
is set while the FUSE_CAP_READDIRPLUS_AUTO flag is not set.
Thereby the kernel will issue only readdirplus calls.
Documentation at:
https://libfuse.github.io/doxygen/fuse-3_88_80_2include_2fuse__common_8h.html#a9b90333ad08d0e1c2ed0134d9305ee87

As the expensive part for accessing and reading the attributes is seeking and
decoding each directory entry, it is usefull to force readdirplus calls.
By this a struct `EntryParam` is returned for each entry, therebye avoiding a
subsequent lookup call.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/bin/proxmox-backup-manager.rs: add completion function for update commands
Dietmar Maurer [Wed, 15 Jan 2020 11:42:13 +0000 (12:42 +0100)]
src/bin/proxmox-backup-manager.rs: add completion function for update commands

4 years agosrc/api2/config: check digest
Dietmar Maurer [Wed, 15 Jan 2020 11:27:05 +0000 (12:27 +0100)]
src/api2/config: check digest

4 years agosrc/api2/config: correctly lock files
Dietmar Maurer [Wed, 15 Jan 2020 10:57:12 +0000 (11:57 +0100)]
src/api2/config: correctly lock files

4 years agoservices: fix indentation
Oguz Bektas [Mon, 13 Jan 2020 16:03:26 +0000 (17:03 +0100)]
services: fix indentation

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agotools: add read_and_verify_password helper
Oguz Bektas [Mon, 13 Jan 2020 15:05:28 +0000 (16:05 +0100)]
tools: add read_and_verify_password helper

add a helper to perform some basic checks on password prompts.
- verification (asks for a 2nd time)
- check length

also use the new helper where password input in tty is taken to reduce
duplicate code.

this helper should be used when creating keys, changing passphrases etc.

note: this helper can be extended later on to provide better checks for
password strength.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agopxar::fuse: Avoid macro to generate filler function, use closure instead.
Christian Ebner [Mon, 13 Jan 2020 11:48:07 +0000 (12:48 +0100)]
pxar::fuse: Avoid macro to generate filler function, use closure instead.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/api2/config: improve api schema by adding return type
Dietmar Maurer [Tue, 14 Jan 2020 13:55:58 +0000 (14:55 +0100)]
src/api2/config: improve api schema by adding return type

4 years agosrc/bin/proxmox-backup-manager.rs: add datastore update cli
Dietmar Maurer [Tue, 14 Jan 2020 13:47:26 +0000 (14:47 +0100)]
src/bin/proxmox-backup-manager.rs: add datastore update cli

4 years agosrc/api2/config/datastore.rs: improve api, implement update and read
Dietmar Maurer [Tue, 14 Jan 2020 13:45:56 +0000 (14:45 +0100)]
src/api2/config/datastore.rs: improve api, implement update and read

4 years agosrc/api2/config/remotes.rs: improve api, implement update and read
Dietmar Maurer [Tue, 14 Jan 2020 13:20:16 +0000 (14:20 +0100)]
src/api2/config/remotes.rs: improve api, implement update and read

4 years agosrc/section_config.rs: add lookup_json() helper
Dietmar Maurer [Tue, 14 Jan 2020 13:19:22 +0000 (14:19 +0100)]
src/section_config.rs: add lookup_json() helper

4 years agosrc/api2/config/remotes.rs: fix variable name -> s/remote/id/
Dietmar Maurer [Tue, 14 Jan 2020 12:20:13 +0000 (13:20 +0100)]
src/api2/config/remotes.rs: fix variable name -> s/remote/id/

4 years agosrc/section_config.rs - convert_to_array: optionally add digest
Dietmar Maurer [Tue, 14 Jan 2020 11:57:03 +0000 (12:57 +0100)]
src/section_config.rs - convert_to_array: optionally add digest

datastore::config() -> also return digest
remotes::config() -> also return digest

4 years agosrc/section_config.rs - write: improve error message
Dietmar Maurer [Tue, 14 Jan 2020 11:02:25 +0000 (12:02 +0100)]
src/section_config.rs - write: improve error message

4 years agosrc/section_config.rs: do not allow control characters
Dietmar Maurer [Tue, 14 Jan 2020 10:41:48 +0000 (11:41 +0100)]
src/section_config.rs: do not allow control characters

4 years agosrc/api2/types.rs: also define PASSWORD_FORMAT and use it correctly
Dietmar Maurer [Tue, 14 Jan 2020 10:32:02 +0000 (11:32 +0100)]
src/api2/types.rs: also define PASSWORD_FORMAT and use it correctly

4 years agosrc/api2/types.rs: define and use PASSWORD_REGEX
Dietmar Maurer [Tue, 14 Jan 2020 10:22:42 +0000 (11:22 +0100)]
src/api2/types.rs: define and use PASSWORD_REGEX

4 years agosrc/api2/types.rs: add regression test for PROXMOX_USER_ID_SCHEMA
Dietmar Maurer [Mon, 13 Jan 2020 16:26:43 +0000 (17:26 +0100)]
src/api2/types.rs: add regression test for PROXMOX_USER_ID_SCHEMA

4 years agosrc/api2/types.rs: fix regex patterns
Dietmar Maurer [Mon, 13 Jan 2020 13:38:31 +0000 (14:38 +0100)]
src/api2/types.rs: fix regex patterns

4 years agosrc/api2/types.rs: define PROXMOX_AUTH_REALM_SCHEMA and PROXMOX_USER_ID_SCHEMA
Dietmar Maurer [Mon, 13 Jan 2020 13:17:22 +0000 (14:17 +0100)]
src/api2/types.rs: define PROXMOX_AUTH_REALM_SCHEMA and PROXMOX_USER_ID_SCHEMA

And try to use nbew schemas with config api...

4 years agosrc/api2/types.rs: define HOSTNAME_FORMAT, DNS_NAME_FORMAT and DNS_NAME_OR_IP_FORMAT
Dietmar Maurer [Mon, 13 Jan 2020 12:09:54 +0000 (13:09 +0100)]
src/api2/types.rs: define HOSTNAME_FORMAT, DNS_NAME_FORMAT and DNS_NAME_OR_IP_FORMAT

4 years agosrc/config/*: add #[serde(skip_serializing_if="Option::is_none")] to optinal comment
Dietmar Maurer [Mon, 13 Jan 2020 11:14:14 +0000 (12:14 +0100)]
src/config/*:  add #[serde(skip_serializing_if="Option::is_none")] to optinal comment

4 years agosrc/api2/types.rs: define SINGLE_LINE_COMMENT_SCHEMA
Dietmar Maurer [Mon, 13 Jan 2020 11:02:13 +0000 (12:02 +0100)]
src/api2/types.rs: define SINGLE_LINE_COMMENT_SCHEMA

4 years agosrc/api2/types.rs: define REMOTE_ID_SCHEMA here
Dietmar Maurer [Mon, 13 Jan 2020 10:47:07 +0000 (11:47 +0100)]
src/api2/types.rs: define REMOTE_ID_SCHEMA here

4 years agopxar::fuse: impl readdirplus callback
Christian Ebner [Fri, 10 Jan 2020 16:37:33 +0000 (17:37 +0100)]
pxar::fuse: impl readdirplus callback

readdirplus returns the entries together with their `EntryParam`, so subsequent
lookups for each of the entries are avoided.
In order to reduce code duplication, the code for filling the reply buffer is
moved into a macro.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar::fuse: Get rid of broken cacheing
Christian Ebner [Fri, 10 Jan 2020 16:37:32 +0000 (17:37 +0100)]
pxar::fuse: Get rid of broken cacheing

Remove the current caching of attrs and goodbye tables as it is broken anyway.
This will be replaced with a LRU cache.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agofix typo for function name load_and_decrypt_key
Oguz Bektas [Fri, 10 Jan 2020 14:04:31 +0000 (15:04 +0100)]
fix typo for function name load_and_decrypt_key

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agosrc/section_config.rs: make set_data generic
Dietmar Maurer [Sat, 11 Jan 2020 10:09:27 +0000 (11:09 +0100)]
src/section_config.rs: make set_data generic

4 years agocleanup config api, add remotes config cli interface
Dietmar Maurer [Sat, 11 Jan 2020 09:42:09 +0000 (10:42 +0100)]
cleanup config api, add remotes config cli interface

4 years agosrc/config/datastore.rs: define DataStoreConfig using api macro
Dietmar Maurer [Sat, 11 Jan 2020 08:18:42 +0000 (09:18 +0100)]
src/config/datastore.rs: define DataStoreConfig using api macro

4 years agosrc/api2/config/remotes.rs: cleanup - avoid compiler warnings
Dietmar Maurer [Fri, 10 Jan 2020 18:25:26 +0000 (19:25 +0100)]
src/api2/config/remotes.rs: cleanup - avoid compiler warnings

4 years agopxar::fuse: refactor HashMap to store child parent inode relation.
Christian Ebner [Thu, 9 Jan 2020 17:11:53 +0000 (18:11 +0100)]
pxar::fuse: refactor HashMap to store child parent inode relation.

By moving the HashMap into `Context`, the use of lazy_static as well as the
additional Mutex can be avoided (`Context` is already guarded by a Mutex).

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar::decoder::Decoder: include xattrs and payload size in `DirectoryEntry`.
Christian Ebner [Thu, 9 Jan 2020 15:26:33 +0000 (16:26 +0100)]
pxar::decoder::Decoder: include xattrs and payload size in `DirectoryEntry`.

By reading and including xattrs and payload size in struct `DirectoryEntry`,
the tuple of return types is avoided and the code is simpler.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: encoder: limit number of max entries held at once in memory during archive...
Christian Ebner [Fri, 10 Jan 2020 11:50:06 +0000 (12:50 +0100)]
pxar: encoder: limit number of max entries held at once in memory during archive creation.

Limit the total number of entries and therefore the approximate memory
consumption instead of doing this on a per directory basis as it was previously.
This makes more sense as it limits not only the width but also the depth of the
directory tree.

Further, instead of hardcoding this value, allow to pass this information as
additional optional parameter 'entires-max'.
By this, creation of the archive with directories containing a large number of
entries is possible.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/api2/config/remotes.rs: new API to configure remotes
Dietmar Maurer [Fri, 10 Jan 2020 12:28:15 +0000 (13:28 +0100)]
src/api2/config/remotes.rs: new API to configure remotes

4 years agosrc/bin/proxmox-backup-manager.rs: implement shell completion for remote datastore...
Dietmar Maurer [Fri, 10 Jan 2020 10:58:31 +0000 (11:58 +0100)]
src/bin/proxmox-backup-manager.rs: implement shell completion for remote datastore name

4 years agorename src/api2/sync.rs -> src/api2/pull.rs
Dietmar Maurer [Fri, 10 Jan 2020 10:09:55 +0000 (11:09 +0100)]
rename src/api2/sync.rs -> src/api2/pull.rs

Use "pull" instead of "sync", because this also indicates a
direction (like "sync from").

4 years agosrc/section_config.rs: implement generic lookup
Dietmar Maurer [Thu, 9 Jan 2020 16:35:44 +0000 (17:35 +0100)]
src/section_config.rs: implement generic lookup

4 years agosrc/bin/proxmox-backup-manager.rs: implement cli sync command
Dietmar Maurer [Thu, 9 Jan 2020 13:52:29 +0000 (14:52 +0100)]
src/bin/proxmox-backup-manager.rs: implement cli sync command

4 years agosrc/config/remotes.rs: implement SectionConfig for remote hosts
Dietmar Maurer [Thu, 9 Jan 2020 13:49:40 +0000 (14:49 +0100)]
src/config/remotes.rs: implement SectionConfig for remote hosts

4 years agopxar: encoder: warn on lacking read permissions instead of fail.
Christian Ebner [Wed, 8 Jan 2020 14:14:44 +0000 (15:14 +0100)]
pxar: encoder: warn on lacking read permissions instead of fail.

If during creation of the archive, files/dirs with lacking read permissions are
encountered, the user is displayed a warning and the archive is created without
including the file/dir.
Previously this resulted in an error and the archive creation failed.

In order to implement this also for the .pxarexclude files, the Error type of
MatchPattern::from_file() and MatchPattern::from_line() was adopted accordingly.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: encoder: fix incorrect goodbye table entries and update displayed path.
Christian Ebner [Wed, 8 Jan 2020 14:14:43 +0000 (15:14 +0100)]
pxar: encoder: fix incorrect goodbye table entries and update displayed path.

If nodes are excluded by feature flags, they must not appear in the goodbye table.
This is fixed by continuing with the next entry in the for loop.

Further the relative path buffer is now poped in order to correctly display the path.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/encoder.rs: avoid use of macro and initialize Vec with known capacity.
Christian Ebner [Wed, 8 Jan 2020 09:46:56 +0000 (10:46 +0100)]
src/pxar/encoder.rs: avoid use of macro and initialize Vec with known capacity.

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