7022 Commits

Author SHA1 Message Date
Thomas Lamprecht
018d29f727 docs: fix location of webauthn configuration
This was it's own panel for some time but moved into a more general
"Other" panel together with some other settings that are normally
only changed once, on initial setup (better names welcome...).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-08 13:16:07 +02:00
Fabian Grünbichler
40a57cfab0 pull: impl Display for SkipReason
instead of manually doing it in SkipInfo's Display implementation.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-04-24 15:56:26 +02:00
Stefan Hanreich
73b53e4af5 ui: sync job: add transfer-last parameter
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2023-04-24 15:19:07 +02:00
Stefan Hanreich
71db16151d sync job: pull: improve log output
Adding an opening line for every group makes parsing the log easier.

We can also remove the 're-sync [...] done' line, because the next
line should be a progress line anyway.

The new output for the sync job/pull logs looks as follows:

- skipped already synced (happens in most jobs, except for first run)
- re-sync of last synced snapshot (if it still exists on source)
- skipped because of transfer-last (if set and skips something)
- sync of new snapshots (if they exist)

Suggested-By: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2023-04-24 15:18:58 +02:00
Stefan Hanreich
9b67352abc partial fix #3701: sync job: pull: add transfer-last parameter
Specifying the transfer-last parameter limits the amount of backups
that get synced via the pull command/sync job. The parameter specifies
how many of the N latest backups should get pulled/synced. All other
backups will get skipped.

This is particularly useful in situations where the sync target has
less disk space than the source. Syncing all backups from the source
is not possible if there is not enough disk space on the target.
Additionally this can be used for limiting the amount of data
transferred, reducing load on the network.

The newest backup will always get re-synced, regardless of the setting
of the transfer-last parameter.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2023-04-24 15:18:51 +02:00
Dominik Csapak
73d471e90f ui: tape: prevent mislabeling tapes in changers
when labeling a tape in a changer, we pre-fill the label field with
the one from the barcode (if it exists). Letting the user change
the label here does not make much sense, since we assume that they are
the same (e.g. for move operations etc.)

So instead simply display the label to protect users from accidentally
changing it. If a user really needs to have a different label than the
suggested one, it's still possible on the cli.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-04-24 10:02:20 +02:00
Dominik Csapak
b1acea4f4d tape: typo fixes
replacable to replaceable
 the field 'field_replacable_unit_code' is not currently used anywhere
descriptior to descriptor
Resuqest to Request
and flags2 to flags3 (the number indicates the numbering of the field
 and it's the third field, not the second)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-04-24 09:53:58 +02:00
Dietmar Maurer
5d9e5fb475 tape: implement 6 byte fallback for MODE SENSE/SELECT
there are tape drives (esp. virtual ones) that don't implement the
10-byte variants of MODE SENSE/SELECT. Since the pages we set/request
are never bigger than 255 bytes anyway, we can implement a fallback
with the 6 byte variant here.

Implementing this as a fallback to make sure that existing working
drives keep the existing implementation.

Tested with Starwind VTL.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2023-04-24 09:40:23 +02:00
Fabian Grünbichler
e2f3f2d7da update to syslog 6
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-04-20 16:05:46 +02:00
Dominik Csapak
a7900d6e0b tape: continue without MAM media_usage page
sometimes we cannot parse these pages (e.g. vendor quirks that implement
the field differently)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-04-20 09:18:19 +02:00
Dominik Csapak
6fa3ab297f tape: use correct MAM attribute definitions
080Ch: it's binary not ascii, and the length is not specified
    (hp says 23-n bytes)
0820h and 0821h are also binary and not ascii

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-04-20 09:14:14 +02:00
Fabian Grünbichler
42018aeae5 chunk store: handle insertion edge cases
these were previously called out in a comment, but should now be handled (as
much as they can be).

the performance impact shouldn't be too bad, since we only look at the magic 8
bytes at the start of the existing chunk (we already did a stat on it, so that
might even be prefetched already by storage), and only if there is a size
mismatch and encryption is enabled.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
 [ T: fold in "just to be sure" touch_chunk calls ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-04-06 09:36:51 +02:00
Stefan Sterz
dcae9925e1 docs: make logo path and index link absolute
the relative path failed as some pages are more deeply nested, such as
the man page for `proxmox-tape`. this meant that on these pages the
logo wouldn't be displayed correctly and the link lead to a non-
existent file.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2023-04-06 08:47:27 +02:00
Stefan Sterz
fbd954e923 docs: dark theme, dim borders and minor fixups
this commit adjust several border colors that weren't styled before
and appeared too brightly. also add styles to the "hide search
matches" link that had poor contrasts before.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2023-04-06 08:47:27 +02:00
Stefan Sterz
c1ce8e563b docs: make dark mode variables more consistent
this commit roles some color values into variables, cleans up unused
variables and makes variable naming a bit more consistent.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2023-04-06 08:47:27 +02:00
Dominik Csapak
1b5cd72d79 api types: fix non-capturing group syntax
a non capturing group is '(?:)' not '(:?)' so fix that.
None of these regexes are used where would use capturing groups.
DATASTORE_MAP_REGEX and TAPE_RESTORE_SNAPSHOT_REGEX are only used
as api types and BLOCKDEVICE_NAME_REGEX is only used once outside of the
api and there we also don't look at the capturing groups.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-04-06 07:28:58 +02:00
Dominik Csapak
d9df37867f docs: dark mode: adapt background for bottom links in mobile view
the background there was white, so override them to the initial value
(the same as the remaining page).

this was missing in my last patch

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-04-06 07:27:38 +02:00
Thomas Lamprecht
bd8e8991d3 Revert "cli: manager, tape, debug: setup auth context to make local connect work"
This reverts commit 6bac67195e0f57edf80b34558ea791da68d4d1a5 and
commit 783e88c2df600675ccc98b4a99bfbe1c4d18f55e as they were both
superseded by 569324cb ("provide separate helpers for pub/priv auth
keyring access").
2023-03-29 17:17:40 +02:00
Wolfgang Bumiller
569324cb95 provide separate helpers for pub/priv auth keyring access
This used to be the case before the switch to the auth api
crate and is required for some helpers where we don't want
to have to setup the complete auth context.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-29 14:37:45 +02:00
Thomas Lamprecht
6477df8f89 api-types: anchor datastore-map regex
Fixes: 4c4e5c2b ("api2/tape/restore: enable restore mapping of datastores")
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-29 11:58:59 +02:00
Lukas Wagner
072b0e9cf9 api-types: ldap: properly anchor DN regex
Otherwise, a substring match is enough to fulfill the constraint.

Fixes: c001aca0 ("api-types: ldap: add verification regex for LDAP DNs")
Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-03-29 11:29:10 +02:00
Thomas Lamprecht
3da94f2e74 bump version to 2.4.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-28 19:29:01 +02:00
Thomas Lamprecht
783e88c2df cli: manager, tape, debug: avoid setting up auth context for printdoc
as otherwise build fails in a clean environment, where no API auth
key is available.

This whole printdoc command injection is quite ugly and causes
headache in general though, we'd be better off if we could do away
with that..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-28 19:07:08 +02:00
Thomas Lamprecht
15b5e60568 ui: user edit: rework interaction of realm and view model
avoid accessing private members directly but rather try to use the
public API, this then allows us do drop declaring a reference on the
realm combobox, which was not directly used and thus a bit subtle.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-28 18:46:43 +02:00
Thomas Lamprecht
cc45a16322 ui: user edit: fix filtering out pam realm on user-add
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-28 18:21:02 +02:00
Thomas Lamprecht
6bac67195e cli: manager, tape, debug: setup auth context to make local connect work
The manager, tape and debug admin and debug CLI tools all are meant
to run locally on the PBS directly and often directly by the root
user.

So for convenience they will create a valid API ticket for `root@pam`
to connect via localhost to the API proxy, either transparently if
the UID is 0 (= root) or interactively by asking the password of the
root user.

In d97ff8ae ("use new auth api crate") the API key handling was
reworked, but while the call sites that get the auth keys for signing
a ticket where adapted to use the new auth_keyring helper, the
reworked API keeps the key in shared OnceCell which needs to be
actually setup once per executable to the respective correct key,
i.e., public for the proxy, which only checks signatures, but never
creates them, and private for all those that want to sign tickets;
and that was only added for the prrivileged and public daemon, but
not above mentioned CLI tools.

So all calls into the tools that actually required to create a ticket
for connecting to the local API panicked.

Fix this by adding a call to setup_auth_context in the main entry
point of each of those CLI tools, so that they have the private key
available to be used if the tools is executed by root.

Fixes: d97ff8ae ("use new auth api crate")
Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-28 17:20:23 +02:00
Lukas Wagner
c001aca040 api-types: ldap: add verification regex for LDAP DNs
Regex was taken from the LDAP implementation in PVE.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-03-28 16:37:14 +02:00
Dominik Csapak
5f97b9ce16 ui: dark mode: add dark mode colors to the datastore usage charts
For the `Datastore -> Summary` overview for all configured datastores.

Fix is adapted from the PVE's ceph's status details or performance
runningCharts, which are both similar (but not really the same)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ T: expand commit message to note that this is adapted from PVE ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-28 15:24:41 +02:00
Fabian Grünbichler
db10278b95 docs: exand PBS to Proxmox Backup (Server)
where applicable.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-03-28 14:18:48 +02:00
Thomas Lamprecht
dd71b70b5d d/rules: version check: exit early and fine-tune error message
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-28 13:56:32 +02:00
Stefan Sterz
7d2b0d6afd fix #4521: api/tasks: replace upid as filename for task log downloads
previously the upid would just be used without a file extension when
downloading a task log. this lead to rather strange filenames that
appeared unfamiliar to users as the upid is not very prevalent in the
gui. set a proper file name based on the node name, worker type and a
time stamp instead. also add the ".log" file extension to indicate
that these files contain logs.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2023-03-28 13:54:12 +02:00
Wolfgang Bumiller
e185407891 d/rules: verify version between Cargo.toml and debian/changelog
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-28 09:41:35 +02:00
Thomas Lamprecht
743f83bc5a d/copyright: update years
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-27 20:09:22 +02:00
Thomas Lamprecht
56a358e47f bump version to 2.4.0-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-27 19:54:13 +02:00
Dominik Csapak
61a51b240d docs: implement auto dark mode
the colors are inspired/copied from the pmg/pve docs dark mode, but
i tried to apply them such that theme is faithful to the original
docs style regarding contrast etc.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-03-27 19:42:28 +02:00
Fabian Grünbichler
3df46e018b drop exclusive lock for verify-after-complete
the backup is finished at that point, the only lock clash that is possible when
dropping the exclusive and attempting to obtain a shared lock would be

- the snapshot is pruned/removed
- the backup is in a pre-upgrade process, and the post-upgrade process opens a reader

the first case is OK, if the other invocation wins the race and removes the
snapshot verification is pointless anyway.

the second case means the snapshot is not verified directly after completion
(this fact would be logged in the backup task log), but usable immediately for
pulling/restoring/..

this should decrease the chances of triggering the issues described in #4523

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-03-27 15:05:40 +02:00
Wolfgang Bumiller
20ecaad13b cargo fmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-27 15:03:05 +02:00
Lukas Wagner
a1a9fdd8b8 report: add date -R to general system info section
Sometimes it can be quite useful to know when exactly a system report
was generated. Adds the following output:

 # date -R
 Thu, 23 Feb 2023 16:21:12 +0100

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-03-27 14:40:41 +02:00
Lukas Wagner
9273dc188f manager: use view_task_result function for realm sync
Previously, the same approach as in `proxmox-backup-debug` was used.
With the changes from this commit, realm syncing uses the same method for
waiting for task output as other parts of `proxmox-backup-manager`.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-03-27 14:23:11 +02:00
Lukas Wagner
3f44c29c1a docs: ldap: break long lines/remove trailing whitespace
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-03-27 14:22:43 +02:00
Aaron Lauterer
48f37f48d4 docs: reword WORM tape documentation
Mainly splitting long sentences into smaller ones. Some rewording
happened in the process.

The changes should still transport the same information.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
2023-03-27 14:08:57 +02:00
Wolfgang Bumiller
5f0965edba realm sync: replace formatted .context() calls
with .map_err/.ok_or_else - since the formatting should not
happen in the non-error case

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-27 11:51:34 +02:00
Wolfgang Bumiller
750704400a realm sync: replace and_then chain with '?' in lookup closure
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-27 11:47:26 +02:00
Wolfgang Bumiller
0010d56a00 realm sync: take schema per reference
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-27 11:47:26 +02:00
Lukas Wagner
cf4ff8a783 realm sync: show warnings if attributes do not meet their constraints
Previously, if the value of a synced property did not validate properly
(e.g only 1 character in length instead of the required 2), the whole
sync job failed without any useful error message.

In this commit, the values are validated manually by their
respective StringSchema. If the validation fails, the value is
ignored and a warning is displayed in the task log.

In addition to that, some error messages have been improved.
Also, user sync is now more fault-tolerant in general, showing
warnings if something goes wrong while creating/updating a
single user, instead of aborting the whole sync job.

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
2023-03-27 11:47:13 +02:00
Fabian Grünbichler
1e5cd060a0 pxar creation: use log crate for error reporting
gives a higher (runtime) control via PBS_LOG, so that users can decide
themselves which messages, sources and levels are interesting for a particular
use case.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-03-27 11:16:09 +02:00
Fabian Grünbichler
8419f1cfca fix #4578: use log crate for pxar create logging
since proxmox-backup-client is used in cron jobs and similar automated
fashions, PBS_LOG= should control the output..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-03-27 11:16:06 +02:00
Thomas Lamprecht
6b815bc022 proxy: limit theme value in length and disallow '/'
while with rust strings we cannot inject \0, it feels a bit safer to
enforce some basic restrictions, with length and not containing any
slash seems sensible enough.

Admins should not put sensible data as theme-XYZ.css files in
/usr/share (which is normally readable by all system users anyway)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-14 17:54:16 +01:00
Stefan Sterz
ee0eaeae63 proxy: switch to "auto" as the default theme
use the "auto" theme per default. it uses a media query to detect the
users preferred theme.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2023-03-14 17:50:55 +01:00
Stefan Sterz
66bcf56cda docs: add dark mode support to the api viewer
adds dark mode support to the api viewer that is activated depending
on the users theme preference. similar to the main gui's "auto"
theme.

this requires a bump of the widget toolkit so the dark theme css file
is present

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
 [ T: fixup commit subject, got garbled on send ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-09 08:18:43 +01:00