5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-06 13:18:00 +03:00
Commit Graph

7728 Commits

Author SHA1 Message Date
Thomas Lamprecht
cb3d41e838 bump version to 3.2.7-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-07-03 13:34:21 +02:00
Thomas Lamprecht
d864ed1ca6 update online help reference info
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-07-03 11:59:39 +02:00
Wolfgang Bumiller
226e61361b manager: restore newline in wipe-disk confirmation query
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-03 11:20:40 +02:00
Gabriel Goller
888aede177 backup_manager: use confirmation helper in wipe-disk command
Use `Confirmation` helper in the wipe-disk command prompt.

Improves: 887d83cb (cli: add interactive confirmation for block device wipe, 2023-11-29)
Cc: Markus Frank <m.frank@proxmox.com>
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-07-03 10:57:00 +02:00
Hannes Laimer
0020601d52 datastore: fix problem with operations counting
... if `.chunks/` is not available(deleted/moved) ChunkStore::open
fails, but that would happen after updating the active operations on the
datastore, so no reference that could be dropped is returned. Leading to
the operations counter to always increase. This only updates the counter
when a reference is returned, not before.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2024-07-02 17:02:38 +02:00
Hannes Laimer
c3e6770104 http_client: keep renewal future running on failed re-auth
The re-authentication request can also fail due to network instability,
and not necesarrily only due to an invalid ticket. In that case it makes
sense to retry refreshing the ticket in 15 minutes. Also, the future does
not depend on a failed re-authentication to be clean up properly, so that
happens already somewhere else, therefore we don't rely on this return
anyway. If the ticket is actually invalid or timed out, the main job
will fail and also terminate the renewal future, same applies if the
network is not just unstable but straight up not working.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-02 11:13:42 +02:00
Christian Ebner
de00745354 fix 5304: client: set process uid/gid for .pxarexclude-cli
The .pxarexclude-cli encodes the exclude patterns the client was
invoked with in the pxar archive as regular file entry. The current
behaviour of setting the uid and gid to default 0 (root) causes
however issues when trying to backup and restore the backup as
non-root user.

Opt for using the uid/gid of the user the executable was called as,
allowing the restore for this user to succeed. Root will succeed
to restore anyways.

Link to issue in bugtracker:
https://bugzilla.proxmox.com/show_bug.cgi?id=5304

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
2024-07-02 10:51:21 +02:00
Gabriel Goller
a981ddbc77 client: mount: wait for child to return before exiting
When using the `proxmox-backup-client mount` command, the parent sometimes
exits before we can print any error message. Most notably this happens
when no PBS_REPOSITORY is passed, as this is the first option checked.
If the underlying file descriptor has been closed, wait for the client
to complete and return the error message.

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Suggested-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
2024-07-02 10:49:41 +02:00
Christian Ebner
a08698d32a close #5571: client: fix regression for map command
Commit 08fe5052 introduced functionality to mount split pxar archives
(sharing code with the map command), moving the manifest lookup
exclusive to fixed index archives.

However, the lookup now uses the incorrect archive name, not
containing the `.fidx` extension, which is however required for the
lookup in the manifest.

Fix the issue by calling the method with the correct server archive
name including the required extension.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>

Fixes: 08fe5052 ("client: mount: make split pxar archives mountable")

[FG: reworded, add proper "Fixes:" trailer.]
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-07-02 10:41:38 +02:00
Fabian Grünbichler
8dab8f3301 make: add deb-nostrip target
it builds about 1.5 times faster than regular `make deb` (shaving off a
whopping 100s on my machine). the resulting debs containing executables are of
course bigger (since the debug symbols are not split out into their own
package, and the ELF linkage stripping is also skipped), but other than the
associated file and memory mapping overhead there should be no difference in
behaviour or performance, and such debs are suitable for local testing (both of
the build process, and the built code).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-28 13:52:52 +02:00
Wolfgang Bumiller
42c6224f92 don't call contains_key() before remove()
HashMap::remove() returns the value it removes as an Option<>, so
instead of first checking if the key exists before removing it, just
try to remove it and use the returned Option<> to test whether we
should bail!().

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-28 09:33:23 +02:00
Maximiliano Sandoval
f4130d531f tools: add missing cfg(test) macro
Fixes the rustc warning:

warning: struct `TestAsyncCacher` is never constructed
  --> pbs-tools/src/async_lru_cache.rs:86:12
   |
86 |     struct TestAsyncCacher {
   |            ^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 09:21:07 +02:00
Maximiliano Sandoval
cef764ff85 chunk_store: do not explicitly write implied trait
Fixes the clippy warning:

warning: this bound is already specified as the supertrait of `std::iter::FusedIterator`
   --> pbs-datastore/src/chunk_store.rs:254:14
    |
254 |         impl Iterator<Item = (Result<proxmox_sys::fs::ReadDirEntry, Error>, usize, bool)>
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implied_bounds_in_impls
    = note: `#[warn(clippy::implied_bounds_in_impls)]` on by default
help: try removing this bound
    |
254 -         impl Iterator<Item = (Result<proxmox_sys::fs::ReadDirEntry, Error>, usize, bool)>
255 -             + std::iter::FusedIterator,
254 +         impl std::iter::FusedIterator<Item = (Result<proxmox_sys::fs::ReadDirEntry, Error>, usize, bool)>,

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 09:21:06 +02:00
Maximiliano Sandoval
f619f3e0e7 tools: write multiplication by 01 succinctly
Fixes the clippy warning:

warning: this multiplication by -1 can be written more succinctly
   --> pbs-client/src/tools/mod.rs:700:58
    |
700 |                         SignedDuration::Negative(val) => -1 * i64::try_from(val.as_secs())?,
    |                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `-i64::try_from(val.as_secs())?`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply
    = note: `#[warn(clippy::neg_multiply)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 09:21:04 +02:00
Maximiliano Sandoval
8bd4be15c9 api: remove use of unnecessary pub(self)
Fixes the clippy warning:

warning: unnecessary `pub(self)`
  --> src/api2/access/mod.rs:35:1
   |
35 | pub(self) async fn user_update_auth<S: AsRef<str>>(
   | ^^^^^^^^^ help: remove it
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pub_self
   = note: `#[warn(clippy::needless_pub_self)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 09:21:02 +02:00
Maximiliano Sandoval
1d836ed32a replace get(key).is_none() with !contains_key()
Fixes the clippy warning:

warning: unnecessary use of `get(&user2).is_none()`
    --> pbs-config/src/acl.rs:1067:36
     |
1067 |                 assert!(node.users.get(&user2).is_none());
     |                         -----------^^^^^^^^^^^^^^^^^^^^^
     |                         |
     |                         help: replace it with: `!node.users.contains_key(&user2)`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 09:20:59 +02:00
Maximiliano Sandoval
f3f3c67267 replace get(key).is_some() with contains_key()
Fixes the clippy warning:

warning: unnecessary use of `get(realm).is_some()`
  --> pbs-config/src/domains.rs:68:58
   |
68 |     realm == "pbs" || realm == "pam" || domains.sections.get(realm).is_some()
   |                                                          ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(realm)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 09:20:56 +02:00
Fabian Grünbichler
0003743962 Makefile: drop outdated comment
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-27 09:43:01 +02:00
Fabian Grünbichler
f4a7bddd39 build: fix nocheck build
pbs2to3 was missing from the list of to-be-compiled binaries, and thus was only
compiled as a side-effect of running `cargo test` (which is skipped when the
build is using the `nocheck` build profile).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-27 09:23:25 +02:00
Fabian Grünbichler
d6f4fd4ec7 cargo config: add debug=true
else debug symbols are stipped with 1.79+.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-25 14:21:58 +02:00
Fabian Grünbichler
8c75fcd07c trivial clippy fixes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-25 13:37:35 +02:00
Fabian Grünbichler
71bf1a3b12 run cargo fmt
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-24 10:02:07 +02:00
Fabian Grünbichler
8aa244641d trivial clippy fixes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-24 09:59:27 +02:00
Wolfgang Bumiller
f699c72b20 bump proxmox-rrd to 0.2 and proxmox-time to 2.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 14:08:08 +02:00
Wolfgang Bumiller
d9e9ed845d bump bitflags to 2.4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:38:34 +02:00
Wolfgang Bumiller
a912e551cd update README.rst to refer to .cargo/config.toml
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 12:31:18 +02:00
Maximiliano Sandoval
2170d58b0b fs: update comment to reflect usage of C-string literals
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-20 12:26:49 +02:00
Wolfgang Bumiller
603042d0a4 rename .cargo/config to .cargo/config.toml
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 12:24:27 +02:00
Maximiliano Sandoval
1a76efc616 cargo: use default-features
Fixes the compile-time warning:

warning: Cargo.toml: `default_features` is deprecated in favor of `default-features` and will not work in the 2024 edition
(in the `proxmox-router` dependency)

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-20 12:18:40 +02:00
Wolfgang Bumiller
da72994faf use XATTR_* constants instead of calling functions
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 11:08:58 +02:00
Wolfgang Bumiller
0c9f247cfd bump sys dependency to 0.5.7
for the new xattr constants

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 11:08:58 +02:00
Wolfgang Bumiller
6359e6d4d4 replace c_str! macro with c"literals"
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 11:07:11 +02:00
Fabian Grünbichler
fd3f72820e build: use cargo wrapper when building package
else we don't pick up the options set by the wrapper, which include generation
of debug symbols. until rustc 1.77, this was not needed because compiled
binaries always included a non-stripped libstd. now, without this change, the
binaries built with `cargo build --release` have no debug symbols at all
trigger a warning. fix this and include debug symbols when building a package,
like was originally intended for release package builds.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-20 08:50:41 +02:00
Fabian Grünbichler
a92a745fdc build: fix SUBCRATES for arbitrary working dirs
else this only works if the git working tree is in a dir called
'proxmox-backup'

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-19 17:49:35 +02:00
Fabian Grünbichler
376cd5897e build: adapt workspace member command
to work with cargo 1.77, which changed from

 pbs-api-types 0.1.0 (path+file:///home/fgruenbichler/Sources/proxmox-backup/pbs-api-types)

to

 path+file:///home/fgruenbichler/Sources/proxmox-backup/pbs-api-types#0.1.0

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-19 16:00:39 +02:00
Gabriel Goller
734c4601a5 close #4763: client: add command to forget backup group
Add the command `proxmox-backup-client group forget <group>` so
that we can forget (delete) whole groups with all the containing
snapshots.
To avoid printing full datastore paths (which are in the error messages)
we filter out the most common one (group not found) and rephrase it.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
[WB: rebased & sorted import statements in client's main.rs]
[WB: replace extract_repository_from_value with
     remove_repository_from_value since the parameter is rejected on
     the remote side]
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-19 11:32:28 +02:00
Wolfgang Bumiller
8e924a7bc0 client: add 'remove_repository_from_value' helper
'extract_repository_from_value' takes an immutable reference and
doesn't remove the parsed parameter (whereas in contrast in our PVE
codebase, the 'extract_param' method does remove it).

This adds a variant that explicitly removes it called
'remove_repository_from_value'.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-19 11:31:46 +02:00
Gabriel Goller
00c88a42a2 pxar: use anyhow::Error in PxarBackupStream
Instead of storing the error as a string in the PxarBackupStream, we
store it as an anyhow::Error. As we can't clone an anyhow::Error, we take
it out from the mutex and return it. This won't change anything as
the consumation of the stream will stop if it gets a Some(Err(..)).

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-06-19 10:30:13 +02:00
Gabriel Goller
230527a360 pxar: add UniqueContext helper
To create a pxar archive, we recursively traverse the target folder.
If there is an error further down and we add a context using anyhow,
the context will be duplicated and we get an output like:

> Error: error at "xattr/xattr.txt": error at "xattr/xattr.txt": E2BIG [skip]

This is obviously not optimal, so in recursive contexts we can use the
UniqueContext, which quickly checks the context from the last item in
the error chain and only adds it if it is unique.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-06-19 10:30:12 +02:00
Gabriel Goller
095ddcad48 pxar: remove ArchiveError
The sole purpose of the ArchiveError was to add the file-path to the
error. Using anyhow::Error we can add this information using the context
and don't need this struct anymore.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-06-19 10:30:10 +02:00
Thomas Lamprecht
74d735eeed ui: gc job edit: fix i18n gettext usage
String concatenating a variable with some static text as gettext
parameter cannot really work, and it also does not make sense to do
most of the time, as even if we'd use some overly generic format
string like '{0} (disabled)', it would be not easy to translate
correctly in all languages in such a generic way.

So just use the actual full string, which is already contained in our
translation catalogue anyway…

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-06-18 16:15:27 +02:00
Thomas Lamprecht
5c15fb97b4 docs: drop blanket statement recommending against remote storage
This is basically semantic revert of e5c0d80c ("docs: add note for not
using remote storages") that, while well intended, has a few problems,
e.g.:
- This is the minimal/recommended requirements section, which should
  list the rough basic specs a setup must/should have. Listing
  everything that is not best to do would bloat this list
  significantly and it's just the wrong place for it, i.e., it isn't a
  recommended against list.
- while it's true that a remote storage will basically always have
  _some_ overhead over using the same HW with a (modern) local storage
  (file) system, that does **not** mean that the remote storage has
  insufficient performance characteristics. We know of lots of fast
  Ceph setups, even release benchmarks for them, or storages like
  BlockBridge, that provide high performance while being remote.

So avoid this X-Y-problem style argumentation and focus on what is
actually important, even though I naturally get that there are some
users that use slow NFS attached storages, but breaking style here
won't cure them and I'm sure that they are capable of setting up such
a slow local storage that it won't make a real difference compared to
the NFS one.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-06-17 17:52:03 +02:00
Wolfgang Bumiller
0d47038a0c bump proxmox-sys dep to 0.5.6
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-17 14:06:25 +02:00
Fabian Grünbichler
1d36b502f5 Merge branch '3.2.6'
branched off to avoid a breaking change on master
2024-06-17 10:38:02 +02:00
Fabian Grünbichler
472b52f54c bump version to 3.2.6-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-17 10:18:53 +02:00
Christian Ebner
dbfba9db89 client: pxar: fix fuse mount performance for split archives
Adapt to the decoder/accessor method changes introduced in the pxar
library, which were introduced in order to move the consistency check
for metadata and payload data archives.

The new location of the checks allows to access the pxar archive via
a `Split` variant reader instance, without penalization when just
accessing the metadata, not reading any payload data.

This greatly improves performance when accessing fuse mounted
archives.

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

bumped dependency after pxar version bump

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-17 10:17:42 +02:00
Dietmar Maurer
e1a506a0d0 config: acme: use latest proxmox_sys::fs::ensure_dir_exists
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-06-13 11:58:09 +02:00
Dominik Csapak
e5c0d80ca4 docs: add note for not using remote storages
such as NFS or SMB. They will not provide the expected performance
and it's better to recommend against them.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-06-11 11:41:58 +02:00
Dominik Csapak
a3e79113cf tape: handle PEWZ like regular early warning
as a safeguard, should the disabling not work for some reason.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-06-11 10:33:57 +02:00
Dominik Csapak
b7a6c5da06 tape: disable Programmable Early Warning Zone (PEWZ)
since that leads to errors that we don't currently catch before we
reach the regular early warning on tape.

This can be read/set by the Device Configuration Extension Mode Page.
ignore errors on reading or writing, since it may not be available on
LTO-4

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-06-11 10:33:39 +02:00