]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
9 months agodatastore: list images: reduce indentation depth on error checking
Thomas Lamprecht [Fri, 8 Sep 2023 09:01:28 +0000 (11:01 +0200)]
datastore: list images: reduce indentation depth on error checking

Simply pull out the inner IO error and the affected path first.

Clean up style-wise a bit while touching this anyway, but no semantic
change intended.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 months agoremove unnecessary characters in description
Markus Frank [Mon, 4 Sep 2023 09:53:14 +0000 (11:53 +0200)]
remove unnecessary characters in description

remove ." in description of delete_datastore_disk

Signed-off-by: Markus Frank <m.frank@proxmox.com>
9 months agoui: don't show reset button on zfs creation
Dominik Csapak [Thu, 7 Sep 2023 12:19:32 +0000 (14:19 +0200)]
ui: don't show reset button on zfs creation

the reset button only makes sense for editing existing entries,
not for creating new.

This brings it inline with the ZFS create window from PVE.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
9 months agoCargo.toml: sort dependencies
Fabian Grünbichler [Wed, 6 Sep 2023 09:56:59 +0000 (11:56 +0200)]
Cargo.toml: sort dependencies

both into the correct "category" and alphabetically within.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
9 months agocargo: fixed cargo.toml local paths
Gabriel Goller [Wed, 30 Aug 2023 12:57:28 +0000 (14:57 +0200)]
cargo: fixed cargo.toml local paths

The `proxmox-apt` and `proxmox-openid` crate was moved into
the `proxmox` workspace.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
9 months agoAclListItem: derive Clone and PartialEq
Dietmar Maurer [Sat, 2 Sep 2023 14:24:18 +0000 (16:24 +0200)]
AclListItem: derive Clone and PartialEq

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
9 months agoTaskListItem: derive Clone and PartialEq
Dietmar Maurer [Wed, 30 Aug 2023 11:34:51 +0000 (13:34 +0200)]
TaskListItem: derive Clone and PartialEq

9 months agominor style cleanup
Wolfgang Bumiller [Thu, 24 Aug 2023 08:28:11 +0000 (10:28 +0200)]
minor style cleanup

The match condition has gotten a bit large, and the error case is a
bit more concise with a pattern guard.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agocleanup: drop unnecessary to_owned call
Wolfgang Bumiller [Thu, 24 Aug 2023 08:28:01 +0000 (10:28 +0200)]
cleanup: drop unnecessary to_owned call

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agobump pathpatterns dependency to 0.2
Wolfgang Bumiller [Thu, 24 Aug 2023 08:20:08 +0000 (10:20 +0200)]
bump pathpatterns dependency to 0.2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agofix #4380: check if file is excluded before running `stat()`
Gabriel Goller [Tue, 22 Aug 2023 14:05:17 +0000 (16:05 +0200)]
fix #4380: check if file is excluded before running `stat()`

Passed a closure with the `stat()` function call to `matches()`. This
will traverse through all patterns and try to match using the path only, if a
`file_mode` is needed, it will run the closure. This means that if we exclude
a file with the `MatchType::ANY_FILE_TYPE`, we will skip it without running
`stat()` on it. As we updated the `matches()` function, we also updated all the
invocations of it.
Added `pathpatterns` crate to local overrides in cargo.toml.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
10 months agodocs: update external link to www.proxmox.com
Christian Ebner [Fri, 11 Aug 2023 11:09:05 +0000 (13:09 +0200)]
docs: update external link to www.proxmox.com

During the redesign of www.proxmox.com the menu structure and therefore
some url changed. Update the external link in order to avoid an
unneccessary redirect.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
10 months agoshorten code a tiny bit
Wolfgang Bumiller [Thu, 17 Aug 2023 12:03:52 +0000 (14:03 +0200)]
shorten code a tiny bit

Ends up with a rather long pattern guard but does avoid the return
case duplication...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agofix: #4761: introduce overwrite bitflags for fine grained overwrites
Christian Ebner [Wed, 16 Aug 2023 09:57:46 +0000 (11:57 +0200)]
fix: #4761: introduce overwrite bitflags for fine grained overwrites

Adds OverwriteFlags for granular control of which entry types should
overwrite entries present on the filesystem during a restore.

The original overwrite flag is refactored in order to cover all of the
other cases.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
10 months agofix: #4761: unlink existing entries for hard/symlinks when overwrite
Christian Ebner [Wed, 16 Aug 2023 09:57:45 +0000 (11:57 +0200)]
fix: #4761: unlink existing entries for hard/symlinks when overwrite

Creating symlinks or hardlinks might fail if a directory entry with the
same name is already present on the filesystem during restore.

When the overwrite flag is given, on failure unlink the existing entry
(except directories) and retry hard/symlink creation.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
10 months agopbs2to3: fix boot-mode detection
Stoiko Ivanov [Wed, 9 Aug 2023 10:34:26 +0000 (10:34 +0000)]
pbs2to3: fix boot-mode detection

/sys/firmware/efi is a directory and std::path::Path seems to detect
only regular files with is_file [0].

Reported in our Enterprise support portal.

Quickly tested the fix on a VM.

https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.is_file

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 months agofix: api-types: add support for lto 9 tape density
Stefan Sterz [Thu, 10 Aug 2023 15:37:04 +0000 (17:37 +0200)]
fix: api-types: add support for lto 9 tape density

lto 9 tapes have a new density code which leads to these tapes not
being recognized properly. add the new density code and TapeDensity to
improve lto 9 support. since the documentation states that we support
lto 5 and above this constitutes a bug fix for lto 9 support.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
10 months agofix #4868: bump proxmox-apt dependency, also bump proxmox-ldap dep
Wolfgang Bumiller [Tue, 8 Aug 2023 12:12:20 +0000 (14:12 +0200)]
fix #4868: bump proxmox-apt dependency, also bump proxmox-ldap dep

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoblobs: fix outdated comment about file format
Fabian Grünbichler [Thu, 20 Jul 2023 10:23:56 +0000 (12:23 +0200)]
blobs: fix outdated comment about file format

the wrong info here was rather misleading, especially when encountering errors
just talking about "blobs" when the actual problem is with a chunk.

chunks did originally have their own magic values, but that got removed in

4ee8f53d07bf0becf19a22cf4f4674558a4d128c "remove DataChunk file format - use DataBlob instead"

back in 2019, before the 0.1.1 release(!)

Reported-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
10 months agoblob/chunk parse errors: add context
Fabian Grünbichler [Thu, 20 Jul 2023 10:23:55 +0000 (12:23 +0200)]
blob/chunk parse errors: add context

to make it more obvious that blob is a chunk here and which one is affected.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
10 months agoapi-types: drop unused leftover file
Christoph Heiss [Mon, 7 Aug 2023 07:57:24 +0000 (09:57 +0200)]
api-types: drop unused leftover file

Commit d97ff8ae ("use new auth api crate") moved all auth-related code
into it's own crate inside the `proxmox` repo, including this file. Thus
drop it here, it's not even included in the compile.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 months agocargo: added other shared crates to local path overrides
Gabriel Goller [Mon, 7 Aug 2023 13:38:29 +0000 (15:38 +0200)]
cargo: added other shared crates to local path overrides

Added proxmox-ldap, -metrics, -sortable-metrics and -human-bytes to local
path overrides.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
10 months agocargo: fixed cargo local path overrides
Gabriel Goller [Mon, 7 Aug 2023 13:38:28 +0000 (15:38 +0200)]
cargo: fixed cargo local path overrides

The crates `proxmox-apt` and `proxmox-openid` have been moved to the `proxmox`
workspace. Adjusted the path in the Cargo.toml file.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
10 months agodocs: updated README.rst build guide
Gabriel Goller [Mon, 7 Aug 2023 13:49:24 +0000 (15:49 +0200)]
docs: updated README.rst build guide

 - we use the debian 12 bookworm mirror
 - `make deb-all` doesn't exist anymore, `make deb` builds everything

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
10 months agoRevert "fix #4380: stat() is run when file is executed"
Fabian Grünbichler [Fri, 4 Aug 2023 08:33:15 +0000 (10:33 +0200)]
Revert "fix #4380: stat() is run when file is executed"

this actually affected the matcher's ability to differentiate between directory
and file patterns, and the alternative would require matching patterns twice
for full coverage, so let's try a different approach altogether.

This reverts commit c8ed10095d4cdc01705e5f01f849f8850a0b7395.

10 months agofix #4380: stat() is run when file is executed
Gabriel Goller [Thu, 3 Aug 2023 15:22:38 +0000 (17:22 +0200)]
fix #4380: stat() is run when file is executed

When executing `proxmox-backup-client backup ...
--exclude "test/test.txt"` it still executed stat() on "test.txt",
which won't work when the current user doesn't have access to the
file or the parent folder. Now we check if the file is excluded,
and if it is not, then we execute stat().

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
10 months agobump version to 3.0.2-1
Fabian Grünbichler [Tue, 1 Aug 2023 09:55:46 +0000 (11:55 +0200)]
bump version to 3.0.2-1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
10 months agohandle pve-kernel -> proxmox-kernel rename
Fabian Grünbichler [Tue, 18 Jul 2023 08:33:01 +0000 (10:33 +0200)]
handle pve-kernel -> proxmox-kernel rename

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
10 months agoapi-types: set serde defaults for UserWithTokens
Wolfgang Bumiller [Tue, 1 Aug 2023 07:10:45 +0000 (09:10 +0200)]
api-types: set serde defaults for UserWithTokens

since `totp_locked` is not wrapped in an `Option` we need to
explicitly tell serde about its default

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agobump dependencies to bookworm updates
Wolfgang Bumiller [Mon, 24 Jul 2023 09:12:56 +0000 (11:12 +0200)]
bump dependencies to bookworm updates

These should all be api compatible but still needed a bookworm bump.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 months agobackup: improve skipped download error message
Fabian Grünbichler [Wed, 19 Jul 2023 09:06:31 +0000 (11:06 +0200)]
backup: improve skipped download error message

context always helps when parsing output..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
11 months agofix #4591: pbs-client: backup_writer: improve error reporting
Maximiliano Sandoval [Wed, 7 Jun 2023 14:07:01 +0000 (16:07 +0200)]
fix #4591: pbs-client: backup_writer: improve error reporting

We check if the manifest contains an index for the requested archive, if
it does not we avoid downloading it and report a more helpful error
message.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
11 months agopbs-client: backup-writer: use log::warn instead of eprintln!
Maximiliano Sandoval [Wed, 7 Jun 2023 14:07:00 +0000 (16:07 +0200)]
pbs-client: backup-writer: use log::warn instead of eprintln!

The errors are not fatal so we only throw a warning.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
11 months agodocs: replace concrete device paths with pseudo paths
Philipp Hufnagl [Tue, 11 Jul 2023 07:56:51 +0000 (09:56 +0200)]
docs: replace concrete device paths with pseudo paths

Having commonly used device paths (like /dev/sdb) in an example
command may cause damage if the user simply copies them without
checking. With a pseudo device path (like /dev/sdX), they would simply
get an error

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
11 months agoproxmox-backup-client: restore: add 'ignore-extract-device-errors' flag
Max Carrara [Mon, 17 Jul 2023 08:04:09 +0000 (10:04 +0200)]
proxmox-backup-client: restore: add 'ignore-extract-device-errors' flag

If this flag is provided, any errors that occur during the extraction
of a device node are silently ignored.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
11 months agopbs-client: pxar: add PxarExtractContext
Max Carrara [Mon, 17 Jul 2023 08:04:08 +0000 (10:04 +0200)]
pbs-client: pxar: add PxarExtractContext

This enum's purpose is to provide context to errors that occur during
the extraction of a pxar archive, making it possible to handle
extraction errors in a more granular manner.

For now, it's only implemented in `ExtractorIter::next()`, but may be
used in other places if necessary or desired.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
11 months agopbs-client: pxar: refactor body of `extract_archive` to `ExtractorIter`
Max Carrara [Mon, 17 Jul 2023 08:04:07 +0000 (10:04 +0200)]
pbs-client: pxar: refactor body of `extract_archive` to `ExtractorIter`

This change factors the body of `extract_archive()` into a separate
struct named `ExtractorIter` which implements the `Iterator` trait.

This refactor has two goals:
  * Make it easier to provide and propagate errors and additional
    information via `anyhow::Context`
  * Introduce a means to handle errors that occur during extraction,
    with the possibility to continue extraction if the handler decides
    that the error is not fatal

The latter point benefits from the information provided by the former;
previously, errors could only be handled in certain locations
(e.g. application of metadata), but not on a "per-entry" basis.

Since `extract_archive()` was already using a "desugared" version of
the iterator pattern to begin with, wrapping its body up in an actual
`Iterator` made the most sense, as it didn't require changing the already
existing control flow that much.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
11 months agopbs-client: pxar: preserve error context
Max Carrara [Mon, 17 Jul 2023 08:04:06 +0000 (10:04 +0200)]
pbs-client: pxar: preserve error context

In order to preserve the source(s) of errors, `anyhow::Context` is
used instead of propagating errors via `Result::map_err()` and / or
`anyhow::format_err!()`.

This makes it possible to access e.g. an underlying `io::Error` or
`nix::Errno` etc. that caused an execution path to fail.

Certain usages of `anyhow::bail!()` are also changed / replaced
in order to preserve context.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
11 months agofix pbs2to3 install
Fabian Grünbichler [Fri, 14 Jul 2023 10:10:24 +0000 (12:10 +0200)]
fix pbs2to3 install

was incomplete when forward porting from stable-2.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
11 months agosync over pbs2to3 upgrade check-list script to master
Thomas Lamprecht [Sat, 8 Jul 2023 13:06:38 +0000 (15:06 +0200)]
sync over pbs2to3 upgrade check-list script to master

so that it's available after for post-upgrade checks

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agod/control fixup and zstd simplify zstd version
Wolfgang Bumiller [Wed, 5 Jul 2023 13:24:22 +0000 (15:24 +0200)]
d/control fixup and zstd simplify zstd version

we transitively depend on a specific version anyway

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 months agobump d/control
Wolfgang Bumiller [Wed, 5 Jul 2023 13:00:14 +0000 (15:00 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 months agoreset tfa failure count when unlocking
Wolfgang Bumiller [Wed, 5 Jul 2023 12:58:54 +0000 (14:58 +0200)]
reset tfa failure count when unlocking

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 months agobump proxmox-tfa dep to 4.0.4
Wolfgang Bumiller [Wed, 5 Jul 2023 12:58:39 +0000 (14:58 +0200)]
bump proxmox-tfa dep to 4.0.4

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 months agoencrypted backup: fix log message
Fabian Grünbichler [Mon, 3 Jul 2023 06:53:45 +0000 (08:53 +0200)]
encrypted backup: fix log message

the debug representation of a repository

 'BackupRepository { auth_id: Some(Authid { user: Userid { data: "test@pbs", name_len: 4 }, tokenname: None }), host: Some("127.0.0.1"), port: None, store: "tank" }'

is rather verbose and unreadable, use the plain one

 'test@pbs@127.0.0.1:8007:tank'

intead.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
11 months agodocs: update FAQ release support table, add PBS 2.x EOL date
Thomas Lamprecht [Wed, 28 Jun 2023 16:57:46 +0000 (18:57 +0200)]
docs: update FAQ release support table, add PBS 2.x EOL date

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobump version to 3.0.1-1 v3.0.1
Thomas Lamprecht [Tue, 27 Jun 2023 14:04:33 +0000 (16:04 +0200)]
bump version to 3.0.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agofix spelling of command line/command-line
Noel Ullreich [Tue, 27 Jun 2023 12:40:08 +0000 (14:40 +0200)]
fix spelling of command line/command-line

"Commandline", "command line" & "command-line" were being used
interchangeably, which is not correct use command-line when it is an
adjective (e.g. "command-line interface") and use command line when
it is a noun (e.g. "change the setting from the command line")

Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com>
 [T: fix typos in commit message and reflow ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoconsistenct of USB flash drive spelling
Noel Ullreich [Tue, 27 Jun 2023 12:40:07 +0000 (14:40 +0200)]
consistenct of USB flash drive spelling

To be consistent, replaced all synonyms of USB flash drive (e.g. thumb
drive, drive, stick)

Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com>
11 months agodocs: user management: use pbs realm instead of pve realm in example
Fiona Ebner [Tue, 27 Jun 2023 12:14:27 +0000 (14:14 +0200)]
docs: user management: use pbs realm instead of pve realm in example

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
11 months agoapi: node services: switch to journald and chrony instead of syslog and timesyncd
Thomas Lamprecht [Tue, 27 Jun 2023 11:34:53 +0000 (13:34 +0200)]
api: node services: switch to journald and chrony instead of syslog and timesyncd

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoui: user view: fix refresh for totp locked column
Dominik Csapak [Tue, 27 Jun 2023 11:27:07 +0000 (13:27 +0200)]
ui: user view: fix refresh for totp locked column

by adding the 'totp-locked' column to the model

a diff store can only know if a column has changed if the column is
defined in the model, otherwise it'll only load it the first time
(when the 'load' called on the diff store)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
11 months agoui: add missing unlockTfa handler
Wolfgang Bumiller [Tue, 27 Jun 2023 10:04:51 +0000 (12:04 +0200)]
ui: add missing unlockTfa handler

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
11 months agocargo: bump dependency for proxmox-rest-server and proxmox-apt
Thomas Lamprecht [Tue, 27 Jun 2023 10:47:53 +0000 (12:47 +0200)]
cargo: bump dependency for proxmox-rest-server and proxmox-apt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobump version to 3.0.0-2
Thomas Lamprecht [Mon, 26 Jun 2023 20:13:50 +0000 (22:13 +0200)]
bump version to 3.0.0-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoetc/pbs-enterprise.list: change to bookworm
Thomas Lamprecht [Mon, 26 Jun 2023 20:12:53 +0000 (22:12 +0200)]
etc/pbs-enterprise.list: change to bookworm

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoreadme: update package repos for bookworm
Thomas Lamprecht [Mon, 26 Jun 2023 20:12:26 +0000 (22:12 +0200)]
readme: update package repos for bookworm

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobump version to 3.0.0-1
Thomas Lamprecht [Mon, 26 Jun 2023 18:00:00 +0000 (20:00 +0200)]
bump version to 3.0.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agodocs: update package repos and APT release key for Bookworm
Thomas Lamprecht [Mon, 26 Jun 2023 18:18:44 +0000 (20:18 +0200)]
docs: update package repos and APT release key for Bookworm

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoui: user view: fix eslint error
Thomas Lamprecht [Mon, 26 Jun 2023 17:55:52 +0000 (19:55 +0200)]
ui: user view: fix eslint error

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agodocs: user-management: add section for TFA lockouts
Thomas Lamprecht [Mon, 26 Jun 2023 18:07:39 +0000 (20:07 +0200)]
docs: user-management: add section for TFA lockouts

adapted from pve-docs' commit 96a0d13 ("user management: document TFA
lockout")

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoui: add TFA lock status and unlock button
Wolfgang Bumiller [Fri, 23 Jun 2023 12:44:04 +0000 (14:44 +0200)]
ui: add TFA lock status and unlock button

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 months agoapi: include tfa lock status in user list
Wolfgang Bumiller [Fri, 23 Jun 2023 12:30:36 +0000 (14:30 +0200)]
api: include tfa lock status in user list

Like in PVE.
This means that /access/users is now a 'protected' call to
get access to 'tfa.cfg'.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 months agoenable tfa lockout
Wolfgang Bumiller [Fri, 23 Jun 2023 11:43:41 +0000 (13:43 +0200)]
enable tfa lockout

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 months agomanager: add 'user tfa unlock' command
Wolfgang Bumiller [Fri, 23 Jun 2023 11:56:50 +0000 (13:56 +0200)]
manager: add 'user tfa unlock' command

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 months agoapi: add /access/users/<userid>/unlock-tfa api call
Wolfgang Bumiller [Fri, 23 Jun 2023 11:53:50 +0000 (13:53 +0200)]
api: add /access/users/<userid>/unlock-tfa api call

Same as in PVE: unlocks a user's 2nd factors.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 months agoaccess: ldap check connection on creation and change
Stefan Sterz [Mon, 26 Jun 2023 13:17:46 +0000 (15:17 +0200)]
access: ldap check connection on creation and change

this commit makes the ldap realm endpoints check whether a new or
updated configuration works correctly. it uses the new
`check_connection` function to make sure that a configuration can be
successfully used to connect to and query an ldap directory.

doing so allows us to remove the ldap domain regex. instead of relying
on a regex to make sure that a given distinguished name (dn) could be
correct, we simply let the ldap directory tell us whether it accepts
it. this should also aid with usability as a dn that looks correct
could still be invalid.

this also implicitly removes unauthenticated binds, since the new
`check_connection` function does not support those. it will simply
bail out of the check if a `bind_dn` but no password is configured.
therefore, this is a breaking change.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
11 months agobump d/control
Wolfgang Bumiller [Mon, 26 Jun 2023 13:03:41 +0000 (15:03 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 months agobump proxmox-ldap to 0.2
Wolfgang Bumiller [Mon, 26 Jun 2023 12:52:28 +0000 (14:52 +0200)]
bump proxmox-ldap to 0.2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 months agoapi-types: client: datastore: tools: use proxmox-human-bytes crate
Lukas Wagner [Mon, 8 May 2023 10:01:37 +0000 (12:01 +0200)]
api-types: client: datastore: tools: use proxmox-human-bytes crate

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
11 months agotry using 'pve-eslint' if it exists
Dominik Csapak [Fri, 23 Jun 2023 07:08:47 +0000 (09:08 +0200)]
try using 'pve-eslint' if it exists

but fallback to 'eslint' otherwise

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [T: move into www/manager Makefile directly]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoclippy fixes: deref which would be done by auto-deref
Maximiliano Sandoval [Fri, 16 Jun 2023 08:27:31 +0000 (10:27 +0200)]
clippy fixes: deref which would be done by auto-deref

This unnecessarily complicates the code.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
11 months agoclippy fixes: Box::new(_) of default value
Maximiliano Sandoval [Fri, 16 Jun 2023 08:27:30 +0000 (10:27 +0200)]
clippy fixes: Box::new(_) of default value

From rust-lang:

> Why is this bad?
>
> First, it’s more complex, involving two calls instead of one. Second,
> Box::default() can be faster in certain cases.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
11 months agoclippy fixes: casting to the same type is unnecessary
Maximiliano Sandoval [Fri, 16 Jun 2023 08:27:29 +0000 (10:27 +0200)]
clippy fixes: casting to the same type is unnecessary

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
11 months agoclippy fixes: use of ok_or followed by a function call
Maximiliano Sandoval [Fri, 16 Jun 2023 08:27:28 +0000 (10:27 +0200)]
clippy fixes: use of ok_or followed by a function call

The function will always be called. This is only bad if it allocates or does some non-trivial amount of work.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
11 months agoclippy fixes: the borrowed expression implements the required traits
Maximiliano Sandoval [Fri, 16 Jun 2023 08:27:27 +0000 (10:27 +0200)]
clippy fixes: the borrowed expression implements the required traits

Suggests that the receiver of the expression borrows the expression.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
11 months agod/rules: fix dh_installsystemd invocation
Fabian Grünbichler [Tue, 20 Jun 2023 10:32:59 +0000 (12:32 +0200)]
d/rules: fix dh_installsystemd invocation

the services should definitely not be stopped in preinst!

relevant debdiff with this change:

 Preinst files: lines which differ (wdiff format)
 ------------------------------------------------
 [-# Automatically added by dh_installsystemd/13.11.4-]
 [-if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = upgrade ] && [ -d /run/systemd/system ] ; then-]
 [-      deb-systemd-invoke stop 'proxmox-backup-banner.service' 'proxmox-backup-daily-update.service' 'proxmox-backup-daily-update.timer' 'proxmox-backup-proxy.service' 'proxmox-backup.service' >/dev/null || true-]
 [-fi-]
 [-# End automatically added section-]

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
11 months agofix #4734: manager: add user tfa {list, delete} commands
Maximiliano Sandoval [Fri, 23 Jun 2023 08:28:39 +0000 (10:28 +0200)]
fix #4734: manager: add user tfa {list, delete} commands

Adds the commands

    proxmox-backup-manager user tfa list <userid>
    proxmox-backup-manager user tfa delete <userid> <id>

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
11 months agoapi: Fix schema return annotation of tfa_update_auth
Maximiliano Sandoval [Tue, 20 Jun 2023 13:39:07 +0000 (15:39 +0200)]
api: Fix schema return annotation of tfa_update_auth

In the next commit we expose a command to list the tfa methods of a
user. Without this annotation one would get the following error

    unable to format result: got unexpected data (expected null).

when running the proposed cli command.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
12 months agofile restore: qemu helper: run rustfmt
Maximiliano Sandoval [Fri, 16 Jun 2023 07:35:36 +0000 (09:35 +0200)]
file restore: qemu helper: run rustfmt

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
 [T: fix commit subject ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agofile-restore: factor out detecting debug mode
Thomas Lamprecht [Thu, 15 Jun 2023 16:08:40 +0000 (18:08 +0200)]
file-restore: factor out detecting debug mode

to avoid that the detection logic gets out of sync

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agofile-restore: set loglevel considering PBS_QEMU_DEBUG
Stoiko Ivanov [Thu, 15 Jun 2023 10:42:57 +0000 (12:42 +0200)]
file-restore: set loglevel considering PBS_QEMU_DEBUG

during some tests recently I wondered why a debug log-message was not
printed, despite running with PBS_QEMU_DEBUG.

This patch sets the loglevel for the cli logger to debug if the
variable is present and not-empty (see qemu_helper.rs for the other
usage).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
12 months agofile-restore: set zfs_arc_min to current minimum of 32M
Stoiko Ivanov [Thu, 15 Jun 2023 10:42:56 +0000 (12:42 +0200)]
file-restore: set zfs_arc_min to current minimum of 32M

zfs_arc_min was raised to 32M (for linux) in zfs-commit
121b3cae742a0670d902a51bc61d49dc4a3e4445

while the current logic would still set the min_size to 32M (it's
max(32M, allmem/32), which results to 32M for memory sizes up to
1024M), setting it explicitly to the minimum makes it clear, and will
still be kept should the restore vm have more than 1G of memory at
some point.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
12 months agofile-restore: add zfs. prefix to arc_min/max settings
Stoiko Ivanov [Thu, 15 Jun 2023 10:42:55 +0000 (12:42 +0200)]
file-restore: add zfs. prefix to arc_min/max settings

Currently the values set for zfs_arc_min and zfs_arc_max are ignored
by the kernel:
```
Unknown kernel command line parameters... will be passed to user space
```
module parameters provided on the commandline usually need to be
prefixed with the modulename (e.g. zfs.zfs_arc_min, see [0] for a bit
on related information (the issue itself is not related)).

Paradoxically currently ZFS will print spurious warnings about
settings being ignored when they are actually set - see [1].

Booting the debug image and connecting the shell on the serial console
confirmed that the values did not seem to be set:
`grep '^c_' /proc/spl/kstat/zfs/arcstats` showed half of the memory
for c_max.

[0] https://github.com/openzfs/zfs/issues/698
[1] https://github.com/openzfs/zfs/issues/12504

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
12 months agodrop pam and pam-sys dependencies
Wolfgang Bumiller [Wed, 14 Jun 2023 07:58:56 +0000 (09:58 +0200)]
drop pam and pam-sys dependencies

we don't directly use them anymore

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
12 months agobump proxmox-auth-api dep to 0.3
Wolfgang Bumiller [Wed, 14 Jun 2023 07:58:16 +0000 (09:58 +0200)]
bump proxmox-auth-api dep to 0.3

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
12 months agofix #4638: proxmox-backup-client: status: guard against div by zero
Maximiliano Sandoval [Wed, 7 Jun 2023 08:55:13 +0000 (10:55 +0200)]
fix #4638: proxmox-backup-client: status: guard against div by zero

We throw an error if the value for total is zero.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
12 months agoui: tape: fix restore datastore mapping parameter construction
Dominik Csapak [Tue, 6 Jun 2023 09:20:45 +0000 (11:20 +0200)]
ui: tape: fix restore datastore mapping parameter construction

We recently took into account the selected datastore when restoring
from tape, but the snapshot grids value may not only be a single
datastore, it can also be a list of snapshots, datastores or 'all'.

Handle these cases and extract the source datastore correctly.

This fixes tape restoration when not a whole datastore is selected.

Reported in the forum:
https://forum.proxmox.com/threads/restore-from-lto-parameter-verification-errors-store.128445

Fixes: df881ed0 ("ui: tape: fix restoring a single datastore")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
12 months agobuildsys: switch from '\s' as a whitespace matcher to `[[:space:]]`
Stefan Sterz [Tue, 6 Jun 2023 07:50:18 +0000 (09:50 +0200)]
buildsys: switch from '\s' as a whitespace matcher to `[[:space:]]`

previously the build process was broken for some versions of `awk`
(most notably `mawk`) as they did not understand the shorthand `\s`
notation for matching a whitspace. use the more universal and more
explicit `[[:space:]]` instead.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
12 months agosort and expand gitignore to cover packaging artefacts
Thomas Lamprecht [Sat, 27 May 2023 15:07:39 +0000 (17:07 +0200)]
sort and expand gitignore to cover packaging artefacts

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobuildsys: improve DSC target & add sbuild convenience target
Thomas Lamprecht [Sat, 27 May 2023 15:03:32 +0000 (17:03 +0200)]
buildsys: improve DSC target & add sbuild convenience target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agoupdate build-dependencies for bookworm mass-bump
Thomas Lamprecht [Sat, 27 May 2023 15:01:34 +0000 (17:01 +0200)]
update build-dependencies for bookworm mass-bump

most had no (significant) change, but where bumped to provide some
version space for future stable-2 updates without clashing with
future master

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agodebian: normalize packaging files with wrap-and-sort -tkn
Thomas Lamprecht [Sat, 27 May 2023 14:33:59 +0000 (16:33 +0200)]
debian: normalize packaging files with wrap-and-sort -tkn

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobump version to 2.99.0-1
Thomas Lamprecht [Sun, 21 May 2023 13:13:33 +0000 (15:13 +0200)]
bump version to 2.99.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/control: adapt to libsgutils2 package rename
Thomas Lamprecht [Sun, 21 May 2023 13:31:03 +0000 (15:31 +0200)]
d/control: adapt to libsgutils2 package rename

this feels stupid...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agoupdate zstd to 0.12
Fabian Grünbichler [Wed, 4 Jan 2023 14:17:02 +0000 (15:17 +0100)]
update zstd to 0.12

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
12 months agod/control: define compat level via build-depends and raise to 13
Thomas Lamprecht [Sun, 21 May 2023 13:32:32 +0000 (15:32 +0200)]
d/control: define compat level via build-depends and raise to 13

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobuildsys: derive upload dist automatically
Thomas Lamprecht [Sun, 21 May 2023 13:27:55 +0000 (15:27 +0200)]
buildsys: derive upload dist automatically

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agodebian/lintian-overrides: refresh and add some ok-to-ignore ones
Thomas Lamprecht [Sun, 21 May 2023 13:12:58 +0000 (15:12 +0200)]
debian/lintian-overrides: refresh and add some ok-to-ignore ones

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/rules: expand make variable directly for version mismatch check
Thomas Lamprecht [Sun, 21 May 2023 12:54:27 +0000 (14:54 +0200)]
d/rules: expand make variable directly for version mismatch check

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