7193 Commits

Author SHA1 Message Date
Stefan Sterz
5210f3b532 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>
2023-06-26 16:08:24 +02:00
Wolfgang Bumiller
ebe2442d90 bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-26 16:08:22 +02:00
Wolfgang Bumiller
309202b9fa bump proxmox-ldap to 0.2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-26 14:52:33 +02:00
Lukas Wagner
08f8a3e5aa api-types: client: datastore: tools: use proxmox-human-bytes crate
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-06-26 13:56:45 +02:00
Dominik Csapak
5e082e4fb6 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>
2023-06-24 17:49:44 +02:00
Maximiliano Sandoval
12c841b4d9 clippy fixes: deref which would be done by auto-deref
This unnecessarily complicates the code.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2023-06-23 12:01:45 +02:00
Maximiliano Sandoval
0d4b7f0271 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>
2023-06-23 12:01:36 +02:00
Maximiliano Sandoval
f7c8903e22 clippy fixes: casting to the same type is unnecessary
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2023-06-23 12:01:33 +02:00
Maximiliano Sandoval
c78df869e1 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>
2023-06-23 12:01:31 +02:00
Maximiliano Sandoval
cd0daa8b33 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>
2023-06-23 12:01:29 +02:00
Fabian Grünbichler
f3b89f3a70 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>
2023-06-23 11:53:51 +02:00
Maximiliano Sandoval
9c85840fe2 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>
2023-06-23 11:06:06 +02:00
Maximiliano Sandoval
223842887f 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>
2023-06-23 07:52:56 +02:00
Maximiliano Sandoval
b4b230fdff 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>
2023-06-16 10:00:26 +02:00
Thomas Lamprecht
950fba5a47 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>
2023-06-15 18:08:41 +02:00
Stoiko Ivanov
39531dfc80 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>
2023-06-15 13:03:36 +02:00
Stoiko Ivanov
ce3f15aeac 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>
2023-06-15 13:03:36 +02:00
Stoiko Ivanov
18844d6e3c 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>
2023-06-15 13:03:36 +02:00
Wolfgang Bumiller
038b0c48b4 drop pam and pam-sys dependencies
we don't directly use them anymore

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-14 09:58:57 +02:00
Wolfgang Bumiller
177ee20bd9 bump proxmox-auth-api dep to 0.3
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-14 09:58:33 +02:00
Maximiliano Sandoval
dae0b67f1f 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>
2023-06-07 11:21:52 +02:00
Dominik Csapak
73bd988c42 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>
2023-06-06 13:12:43 +02:00
Stefan Sterz
7075496424 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>
2023-06-06 11:34:22 +02:00
Thomas Lamprecht
5e2664f18e sort and expand gitignore to cover packaging artefacts
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-27 17:07:39 +02:00
Thomas Lamprecht
6602e33c9a buildsys: improve DSC target & add sbuild convenience target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-27 17:03:32 +02:00
Thomas Lamprecht
fda888e2be 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>
2023-05-27 17:01:37 +02:00
Thomas Lamprecht
54d9a35951 debian: normalize packaging files with wrap-and-sort -tkn
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-27 16:34:04 +02:00
Thomas Lamprecht
cdbf064a36 bump version to 2.99.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 15:32:45 +02:00
Thomas Lamprecht
ac74570104 d/control: adapt to libsgutils2 package rename
this feels stupid...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 15:32:45 +02:00
Fabian Grünbichler
4341a3f0cc update zstd to 0.12
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-05-21 15:32:45 +02:00
Thomas Lamprecht
ed6eb52acd d/control: define compat level via build-depends and raise to 13
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 15:32:45 +02:00
Thomas Lamprecht
8ccdeb217d buildsys: derive upload dist automatically
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 15:31:45 +02:00
Thomas Lamprecht
db9f68939e debian/lintian-overrides: refresh and add some ok-to-ignore ones
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 15:31:45 +02:00
Thomas Lamprecht
26cbc819a4 d/rules: expand make variable directly for version mismatch check
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 14:55:06 +02:00
Thomas Lamprecht
b3be7929b4 makefile: convert to use simple parenthesis
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 14:55:06 +02:00
Thomas Lamprecht
2152086092 buildsys: cleanup and expand clean target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 14:55:06 +02:00
Fabian Grünbichler
6213ca1e21 build: inject repoid into build environment
to support building outside of the git tree, e.g. via sbuild.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-05-21 14:55:06 +02:00
Thomas Lamprecht
7521ec6492 d/source: override some false-positive lintian tags
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 14:55:06 +02:00
Thomas Lamprecht
9a8b9cbe45 d/file-restore.postinst: add DEBHELPER stanza
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 13:49:59 +02:00
Thomas Lamprecht
c7adb4c2ec d/control: avoid versioned build-dependcies with a -1 revision
no use, just makes backporting harder

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 13:49:01 +02:00
Thomas Lamprecht
3769706081 buildsys: always pre-clean for den and dsc target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 13:42:19 +02:00
Thomas Lamprecht
8f8faa4541 buildsys: make deb target always build doc package, add deb-nodoc
deb should be our common "build all" target, so rather make the
exception a specific target than vice versa.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 13:41:23 +02:00
Thomas Lamprecht
86e4ad8ada buildsys: simplify getting workspace crate list
we got awk already in the mix, most of the time one doesn't need
anything else..

Also split over multiple lines for readability

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 13:32:45 +02:00
Thomas Lamprecht
a0ba21ec43 buildsys: get metadata only for workspace when resolving sub crates
Allows for building a DSC without having the librust-* source code
build-dependencies installed.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-21 13:17:55 +02:00
Thomas Lamprecht
e5b6a0b38d bump version to 2.4.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-17 17:43:17 +02:00
Thomas Lamprecht
e6868e4edf backup-client: clippy fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-17 17:43:17 +02:00
Thomas Lamprecht
3165853468 file restore: clippy and format argument fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-17 17:43:17 +02:00
Thomas Lamprecht
a57413a54c pbs-datastore: clippy fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-17 17:43:17 +02:00
Thomas Lamprecht
3db2022713 pbs-client: clippy fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-17 17:43:17 +02:00
Thomas Lamprecht
82302ae27f pbs-tape: clippy and format string fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-17 17:43:17 +02:00