Commit Graph

2084 Commits

Author SHA1 Message Date
Dietmar Maurer b31c8019d7 src/api2/types.rs: define and use GroupListItem 2020-01-17 10:17:18 +01:00
Christian Ebner 2bbbade367 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>
2020-01-17 09:40:39 +01:00
Christian Ebner 95c9460c4a 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>
2020-01-17 09:40:39 +01:00
Christian Ebner 6744440714 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>
2020-01-17 09:40:39 +01:00
Dietmar Maurer f357390c15 renamed: src/config/remotes.rs -> src/config/remote.rs
And use 'remote' instead of 'remotes' everywhere.
2020-01-16 14:32:06 +01:00
Dietmar Maurer d2dd827877 src/backup/catalog.rs - SenderWriter: use tokio::task::block_in_place
Make sure we do not block the executor.
2020-01-16 14:24:15 +01:00
Dietmar Maurer 94609e2380 src/api2/pull.rs: use reference to remote configuration 2020-01-16 13:55:19 +01:00
Dietmar Maurer 625d19621f src/client/remote_chunk_reader.rs: use tokio::task::block_in_place to avoid blocking
Else we block the current executor.
2020-01-16 13:55:19 +01:00
Fabian Grünbichler dbd3e5da12 update tokio to 0.2.9
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-01-16 13:23:24 +01:00
Wolfgang Bumiller 6a0dc4a5bc bump proxmox crate version
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-01-16 11:40:23 +01:00
Dietmar Maurer 51697c283d remove the rust-toolchain file 2020-01-16 10:45:46 +01:00
Dietmar Maurer 933687d959 set toolchain to system 2020-01-16 10:34:45 +01:00
Wolfgang Bumiller 4f0c4523f6 debian: bump dependency versions
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-01-16 10:20:41 +01:00
Wolfgang Bumiller 619495b25e fix use of deprecated items
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-01-16 08:58:54 +01:00
Wolfgang Bumiller 18c0df4c92 import ordering cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-01-16 08:51:52 +01:00
Christian Ebner ef2d7f2f96 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>
2020-01-15 14:44:53 +01:00
Dietmar Maurer 3be839c61c src/bin/proxmox-backup-manager.rs: add completion function for update commands 2020-01-15 12:42:13 +01:00
Dietmar Maurer 002a191abf src/api2/config: check digest 2020-01-15 12:27:05 +01:00
Dietmar Maurer 347834df25 src/api2/config: correctly lock files 2020-01-15 11:57:12 +01:00
Oguz Bektas 1c79e1017f services: fix indentation
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2020-01-15 10:55:04 +01:00
Oguz Bektas cbe01dc5c7 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>
2020-01-15 10:52:57 +01:00
Christian Ebner ea5061979b pxar::fuse: Avoid macro to generate filler function, use closure instead.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2020-01-15 10:25:16 +01:00
Dietmar Maurer f3ec5dae7f src/api2/config: improve api schema by adding return type 2020-01-14 14:55:58 +01:00
Dietmar Maurer ddc526623f src/bin/proxmox-backup-manager.rs: add datastore update cli 2020-01-14 14:47:26 +01:00
Dietmar Maurer c5799e4043 src/api2/config/datastore.rs: improve api, implement update and read 2020-01-14 14:45:56 +01:00
Dietmar Maurer 08195ac823 src/api2/config/remotes.rs: improve api, implement update and read 2020-01-14 14:20:16 +01:00
Dietmar Maurer 16f04b9d79 src/section_config.rs: add lookup_json() helper 2020-01-14 14:19:22 +01:00
Dietmar Maurer 71805bb7ec src/api2/config/remotes.rs: fix variable name -> s/remote/id/ 2020-01-14 13:20:13 +01:00
Dietmar Maurer d0187a51a9 src/section_config.rs - convert_to_array: optionally add digest
datastore::config() -> also return digest
remotes::config() -> also return digest
2020-01-14 12:57:03 +01:00
Dietmar Maurer 4566303b05 src/section_config.rs - write: improve error message 2020-01-14 12:02:46 +01:00
Dietmar Maurer f51420ba1f src/section_config.rs: do not allow control characters 2020-01-14 11:41:48 +01:00
Dietmar Maurer 7e7b781a18 src/api2/types.rs: also define PASSWORD_FORMAT and use it correctly 2020-01-14 11:32:02 +01:00
Dietmar Maurer da4a15a351 src/api2/types.rs: define and use PASSWORD_REGEX 2020-01-14 11:22:42 +01:00
Dietmar Maurer ff620a3d1a src/api2/types.rs: add regression test for PROXMOX_USER_ID_SCHEMA 2020-01-13 17:26:43 +01:00
Dietmar Maurer ae62c4fe59 src/api2/types.rs: fix regex patterns 2020-01-13 14:38:31 +01:00
Dietmar Maurer 163dc16c0b src/api2/types.rs: define PROXMOX_AUTH_REALM_SCHEMA and PROXMOX_USER_ID_SCHEMA
And try to use nbew schemas with config api...
2020-01-13 14:18:19 +01:00
Dietmar Maurer b25f313d66 src/api2/types.rs: define HOSTNAME_FORMAT, DNS_NAME_FORMAT and DNS_NAME_OR_IP_FORMAT 2020-01-13 13:10:52 +01:00
Dietmar Maurer 8aea35fcff src/config/*: add #[serde(skip_serializing_if="Option::is_none")] to optinal comment 2020-01-13 12:14:14 +01:00
Dietmar Maurer 454c13edce src/api2/types.rs: define SINGLE_LINE_COMMENT_SCHEMA 2020-01-13 12:02:13 +01:00
Dietmar Maurer 167971ed49 src/api2/types.rs: define REMOTE_ID_SCHEMA here 2020-01-13 11:47:07 +01:00
Christian Ebner 6de36b94b1 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>
2020-01-13 11:17:34 +01:00
Christian Ebner caa201d895 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>
2020-01-13 11:16:06 +01:00
Oguz Bektas 6d20a29d73 fix typo for function name load_and_decrypt_key
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2020-01-13 11:14:47 +01:00
Dietmar Maurer 50af953e1b src/section_config.rs: make set_data generic 2020-01-11 11:09:27 +01:00
Dietmar Maurer 688fbe07a1 cleanup config api, add remotes config cli interface 2020-01-11 10:42:09 +01:00
Dietmar Maurer 9e9bc6525e src/config/datastore.rs: define DataStoreConfig using api macro 2020-01-11 09:18:42 +01:00
Dietmar Maurer ca44172404 src/api2/config/remotes.rs: cleanup - avoid compiler warnings 2020-01-10 19:25:26 +01:00
Christian Ebner c7257c5539 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>
2020-01-10 13:45:58 +01:00
Christian Ebner 90fc97af6a 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>
2020-01-10 13:45:40 +01:00
Christian Ebner 6fc053ed85 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>
2020-01-10 13:45:08 +01:00