]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
6 months agodocs: faq: add entries for how to do minor and major upgrades
Thomas Lamprecht [Fri, 10 Nov 2023 14:57:32 +0000 (15:57 +0100)]
docs: faq: add entries for how to do minor and major upgrades

Adapted from Proxmox VE's FAQ

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agofix #4977: ui: tape: restore: rework snapshot selection logic
Dominik Csapak [Fri, 29 Sep 2023 13:39:24 +0000 (15:39 +0200)]
fix #4977: ui: tape: restore: rework snapshot selection logic

previously, the snapshot grid returned one of three possible types of
values:
* a list of snapshots
* a list of datastores (if only whole datastores were selected)
* the string 'all' (when all snapshots were selected)

this led to some confusing and wrong code, especially the part:
```
  if (source === 'all') {
      source = values.store;
  }
```

which basically set the selected *target* store as a source.  (meaning
it tried restoring a datastore with the selected target name,
regardless if it existed or not)

This fell through in testing, since we most often only restored to the
same datastore anyway were the target and source name were the same.

Rework the return value to return the empty array in case all
snapshots are selected, since selecting none is not a valid anyway.

This means we always get an array back, which makes the code a bit
cleaner overall.

At the same time, we now differentiate correctly the 'all selected'
case, by setting the selected target as a default target.

So instead of previously having `target=target` as datastore
parameter, we now have `target` which is the correct behavior when we
want to restore the whole media set anyway.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Mira Limbeck <m.limbeck@proxmox.com>
6 months agoui: tape: restore: improve variable names
Dominik Csapak [Fri, 29 Sep 2023 13:39:23 +0000 (15:39 +0200)]
ui: tape: restore: improve variable names

some of the variable names did not really tell the full story, so
extend them a bit. This makes the intention much clearer.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Mira Limbeck <m.limbeck@proxmox.com>
6 months agoui: tape: mark incomplete media-sets as such
Dominik Csapak [Fri, 29 Sep 2023 08:52:05 +0000 (10:52 +0200)]
ui: tape: mark incomplete media-sets as such

by counting the returned tapes and compare it to the sequence number.
If the tape count is lower than the highest sequence number plus one,
there must be a tape missing.

Mark it in the text and add the proxmox-warning-row class.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agodebug: Show chunk size while inspecting
Maximiliano Sandoval R [Tue, 7 Nov 2023 13:17:22 +0000 (14:17 +0100)]
debug: Show chunk size while inspecting

Signed-off-by: Maximiliano Sandoval R <m.sandoval@proxmox.com>
6 months agodebug: Show if chunks are compressed during inspect
Maximiliano Sandoval R [Tue, 7 Nov 2023 13:17:21 +0000 (14:17 +0100)]
debug: Show if chunks are compressed during inspect

Signed-off-by: Maximiliano Sandoval R <m.sandoval@proxmox.com>
6 months agodocs: set latex table style to modern default
Thomas Lamprecht [Wed, 8 Nov 2023 11:33:46 +0000 (12:33 +0100)]
docs: set latex table style to modern default

The option was introduced for sphinx 5.0, but back then still using an
empty set as default value, but since (for us still future) 6.0 the
default will be ['booktabs', 'colorrows'], which looks better so use
it now already.

https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-latex_table_style

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agodocs: storage tuning: fix indentation for code-block in list
Thomas Lamprecht [Wed, 8 Nov 2023 11:32:22 +0000 (12:32 +0100)]
docs: storage tuning: fix indentation for code-block in list

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agodocs: cope with removal of language=None in Sphinx 5.0.0
Thomas Lamprecht [Wed, 8 Nov 2023 11:12:12 +0000 (12:12 +0100)]
docs: cope with removal of language=None in Sphinx 5.0.0

avoid a few ugly errors that we get here since basing of the Debian
Bookworm release, which is the first to ship a sphinx version newer
than 5.0, which removed support for allowing None as language [0]

[0]: https://www.sphinx-doc.org/en/master/changes.html#release-5-0-0-released-may-30-2022

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agodocs: introduction: fix mailing list variable name
Thomas Lamprecht [Tue, 7 Nov 2023 15:53:19 +0000 (16:53 +0100)]
docs: introduction: fix mailing list variable name

Fixes: db10278b ("docs: exand PBS to Proxmox Backup (Server)")
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agodocs: cert management: fix heading syntax
Thomas Lamprecht [Tue, 7 Nov 2023 15:52:58 +0000 (16:52 +0100)]
docs: cert management: fix heading syntax

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoui: add Remove button for DirectoryList
Markus Frank [Tue, 10 Oct 2023 11:37:48 +0000 (13:37 +0200)]
ui: add Remove button for DirectoryList

With this patch it is possible to remove systemd mount units via the webui.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agocli: add option to remove systemd mount unit
Markus Frank [Tue, 10 Oct 2023 11:37:47 +0000 (13:37 +0200)]
cli: add option to remove systemd mount unit

add commandline option for api function:
DELETE /api2/json/nodes/{node}/disks/directory/{name}

$ proxmox-backup-manager disk fs delete <datastoreid>

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
7 months agoui: system config: fix leading whitespace in translation
Thomas Lamprecht [Sun, 29 Oct 2023 12:18:53 +0000 (13:18 +0100)]
ui: system config: fix leading whitespace in translation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agosystem report: record stderr output too
Thomas Lamprecht [Thu, 26 Oct 2023 16:00:44 +0000 (18:00 +0200)]
system report: record stderr output too

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agosystem report: factor out getting command output into helper fn
Thomas Lamprecht [Thu, 26 Oct 2023 15:19:48 +0000 (17:19 +0200)]
system report: factor out getting command output into helper fn

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agosystem report: add proxmox-boot-tool status output
Thomas Lamprecht [Thu, 26 Oct 2023 15:15:06 +0000 (17:15 +0200)]
system report: add proxmox-boot-tool status output

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agosystem report: add basic uptime, usage and process info
Thomas Lamprecht [Thu, 26 Oct 2023 12:44:31 +0000 (14:44 +0200)]
system report: add basic uptime, usage and process info

Command is copied over from Proxmox VE

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agosystem report: add all apt repo files
Thomas Lamprecht [Thu, 26 Oct 2023 12:41:12 +0000 (14:41 +0200)]
system report: add all apt repo files

note, we do not filter by *.list or *.source, so one might get also
files that apt won't read, like .dpkg-dist files, but also those with
typos, and thus possibly helpful when debugging things.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agosystem report: support outputting all files in a directory
Thomas Lamprecht [Thu, 26 Oct 2023 12:40:50 +0000 (14:40 +0200)]
system report: support outputting all files in a directory

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agosystem report: group files by categories
Thomas Lamprecht [Thu, 26 Oct 2023 10:37:08 +0000 (12:37 +0200)]
system report: group files by categories

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agosystem report: switch to markdown-like output
Thomas Lamprecht [Thu, 26 Oct 2023 10:33:48 +0000 (12:33 +0200)]
system report: switch to markdown-like output

allows one to render this via any of the thousands markdown viewers to
get a better formatting.

We can switch our web ui widget to (optionally) render this as html
when a user is viewing it from the UI too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agosystem report: output ldap and oidc realm list
Thomas Lamprecht [Thu, 26 Oct 2023 10:31:44 +0000 (12:31 +0200)]
system report: output ldap and oidc realm list

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agosystem report: add more information to lsblk
Thomas Lamprecht [Thu, 26 Oct 2023 09:32:27 +0000 (11:32 +0200)]
system report: add more information to lsblk

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agofix #4779: client: add missing "Connection" header for HTTP2 upgrade
Max Carrara [Thu, 19 Oct 2023 08:57:24 +0000 (10:57 +0200)]
fix #4779: client: add missing "Connection" header for HTTP2 upgrade

This commit adds the missing "Connection: upgrade" HTTP header [1]
when requesting an upgrade to HTTP 2.
Doing so is mandated in the HTTP Semantics RFC [2], and without this,
(reverse) proxies that strictly follow the standard could potentially
break.

[1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade
[2]: RFC 9110, 7.8. Upgrade: “[...] sender of Upgrade MUST also send
     an "Upgrade" connection option in the Connection header [...]”

Reported-By: McTwist <rajb89@hotmail.com>
Signed-off-by: Max Carrara <m.carrara@proxmox.com>
 [ TL: added RFC reference and use case to commit message ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agodatastore: catalog: added lifetime to find function
Gabriel Goller [Mon, 18 Sep 2023 13:41:09 +0000 (15:41 +0200)]
datastore: catalog: added lifetime to find function

Added lifetime to `find` function. We need this lifetime
because of the `impl MatchList` and 'anonymous lifetimes in
`impl Trait` are unstable'.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
7 months agobump pathpatterns to 0.3
Wolfgang Bumiller [Thu, 19 Oct 2023 09:12:35 +0000 (11:12 +0200)]
bump pathpatterns to 0.3

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agoclient: forget snapshots: function signature returns no value
Thomas Lamprecht [Wed, 18 Oct 2023 09:04:35 +0000 (11:04 +0200)]
client: forget snapshots: function signature returns no value

Switch from serde_json::Value to an empty tuple, to not suggest this
actually returns a value from the API other than a possible error.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agofix #4971: client: Improve output on successful snapshot deletion
Philipp Hufnagl [Mon, 16 Oct 2023 11:40:15 +0000 (13:40 +0200)]
fix #4971: client: Improve output on successful snapshot deletion

When a snapshot gets deleted (forgotten), the proxmox backup client
currently returns returns
"Result: {
  "data": null
}"

This feedback may confuse users therefore this patch removes the output.

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
7 months agoTrafficControlCurrentRate: derive Clone and PartalEq (for GUI)
Dietmar Maurer [Sun, 15 Oct 2023 09:09:42 +0000 (11:09 +0200)]
TrafficControlCurrentRate: derive Clone and PartalEq (for GUI)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 months agomove TrafficControlCurrentRate to pbs-api-types
Dietmar Maurer [Sun, 15 Oct 2023 09:07:30 +0000 (11:07 +0200)]
move TrafficControlCurrentRate to pbs-api-types

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 months agoTrafficControlRule: derive Clone and PartialEq (for GUI)
Dietmar Maurer [Sun, 15 Oct 2023 07:25:26 +0000 (09:25 +0200)]
TrafficControlRule: derive Clone and PartialEq (for GUI)

7 months agoui: update generated OnlineHelpInfo map
Thomas Lamprecht [Fri, 13 Oct 2023 15:22:19 +0000 (17:22 +0200)]
ui: update generated OnlineHelpInfo map

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoui: renamed pmx-faded to pmx-opacity-75
Thomas Lamprecht [Fri, 13 Oct 2023 15:16:54 +0000 (17:16 +0200)]
ui: renamed pmx-faded to pmx-opacity-75

"Nomen est omen" and go for three quarter while at it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agofix #4260: ui: fallback to note of last snapshot for backup group comment
Philipp Hufnagl [Fri, 13 Oct 2023 14:37:55 +0000 (16:37 +0200)]
fix #4260: ui: fallback to note of last snapshot for backup group comment

When there is no comment for a backup group, the comment of the last
(most recent) snapshot in this group will be shown as dimmed text, as
long as the back group is collapsed.

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
7 months agoInterface: add missing serde skip_serializing_if to bond_xmit_hash_policy
Dietmar Maurer [Thu, 12 Oct 2023 10:39:18 +0000 (12:39 +0200)]
Interface: add missing serde skip_serializing_if to bond_xmit_hash_policy

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 months agoInterface: fix deserialize (add default)
Dietmar Maurer [Wed, 11 Oct 2023 09:38:01 +0000 (11:38 +0200)]
Interface: fix deserialize (add default)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 months agoInterface: derive Clone + PartialEq (for GUI)
Dietmar Maurer [Wed, 11 Oct 2023 09:37:15 +0000 (11:37 +0200)]
Interface: derive Clone + PartialEq (for GUI)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 months agomove MetricServerInfo definition to pbs-api-types
Dietmar Maurer [Mon, 9 Oct 2023 06:17:46 +0000 (08:17 +0200)]
move MetricServerInfo definition to pbs-api-types

And derive Clone, Eq and Ord so that we can sort the list in the GUI.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
8 months agoui: tape restore: fix default namespace mapping
Dominik Csapak [Mon, 2 Oct 2023 07:52:29 +0000 (09:52 +0200)]
ui: tape restore: fix default namespace mapping

the ui shows the default 'root' namespace as target, but this only
worked when no namespace was selected. as soon as one source datastore
had a target namespace selected, the others datastores would be
skipped as there was no namespace mapping for them. To fix that, we
simply send a default namespace mapping for each source datastore
without a target (no target means 'root')

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Mira Limbeck <m.limbeck@proxmox.com>
8 months agoAdd build outputs to .gitignore
Stefan Lendl [Tue, 3 Oct 2023 10:17:31 +0000 (12:17 +0200)]
Add build outputs to .gitignore

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
8 months agobuild: remove references to proxmox-backup-debug package
Fabian Grünbichler [Tue, 3 Oct 2023 09:18:25 +0000 (11:18 +0200)]
build: remove references to proxmox-backup-debug package

this only existed for a week ~2 years ago[0], making those two variables empty.

0: removed in 67d00d5c0e81246dd43f2ee972504cb3a00ade8f

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 months agobump version to 3.0.4-1
Fabian Grünbichler [Mon, 2 Oct 2023 08:20:41 +0000 (10:20 +0200)]
bump version to 3.0.4-1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 months agoupdate to env_logger 0.10
Fabian Grünbichler [Mon, 2 Oct 2023 08:18:14 +0000 (10:18 +0200)]
update to env_logger 0.10

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 months agopbs-api-types: move node status types from src/api2/types/mod.rs
Dietmar Maurer [Wed, 27 Sep 2023 16:11:58 +0000 (18:11 +0200)]
pbs-api-types: move node status types from src/api2/types/mod.rs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
8 months agod/changelog: fix typos
Thomas Lamprecht [Wed, 27 Sep 2023 16:34:59 +0000 (18:34 +0200)]
d/changelog: fix typos

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agobump version to 3.0.3-1
Thomas Lamprecht [Wed, 27 Sep 2023 16:20:02 +0000 (18:20 +0200)]
bump version to 3.0.3-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoclient: task polling: rework code to be slightly more readable
Thomas Lamprecht [Wed, 27 Sep 2023 16:14:57 +0000 (18:14 +0200)]
client: task polling: rework code to be slightly more readable

the match-arms let one follow the different branches easier than the
relatively crowded if-condition it replaces.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoclient: do exit with failure code when task finished with warnings
Gabriel Goller [Wed, 27 Sep 2023 15:32:27 +0000 (17:32 +0200)]
client: do exit with failure code when task finished with warnings

Warnings in the task log/state normally means that the task actually
did its main job, but there was some detected (potential) issue that
the users should be made aware of. Exiting with an error code in that
case would be a bit odd.

While just exiting with success might not be the best solution either,
it's definitively more correct than a failure-exit-code, so go for
that for now as a stop-gap.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
 [ TL: rebased on current master (v3 was already applied) and rewrite
   commit message accordingly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agofix #4895: scheduled jobs: ignore task-log not found error
Gabriel Goller [Wed, 20 Sep 2023 14:11:24 +0000 (16:11 +0200)]
fix #4895: scheduled jobs: ignore task-log not found error

Use the job start-time as end-time when it's stuck in the
`JobState::Starting` state, no active working is running and the task
log of the last run doesn't exists.

A user experienced a power loss, which left a GC job in the `Started`
state, but the task log did not exist. This breaks the schedule and no
following GC runs. Now, the error is simply ignored and a new gc job
is started on the next occurrence.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
8 months agofix #4823: datastore: ignore vanished files when walking directory
Gabriel Goller [Fri, 8 Sep 2023 12:56:10 +0000 (14:56 +0200)]
fix #4823: datastore: ignore vanished files when walking directory

When walking through a datastore on a GC run, it can
happen that the snapshot is deleted, and then walked over.
For example:
- read dir entry for group
- walk entries (snapshots)
- snapshot X is removed/pruned
- walking reaches snapshot X, but ENOENT
Previously we bailed here, now we just ignore it.
Backups that are just created (and a atomic rename from
tmpdir happens, which might triggers a ENOENT error) are
not a problem here, the GC handles them separately.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
8 months agofix #4343: updated `view_task_result` to bail on task failure
Gabriel Goller [Fri, 8 Sep 2023 13:32:19 +0000 (15:32 +0200)]
fix #4343: updated `view_task_result` to bail on task failure

Now we make an additional request on `api2/json/.../tasks/{upid}/status` to
get the `exitstatus` of the task. This allows us to `bail` and thus
get a non-zero exit code in the cli.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
8 months agoclose #3777: Add source information to backup logs
Gabriel Goller [Fri, 8 Sep 2023 14:01:14 +0000 (16:01 +0200)]
close #3777: Add source information to backup logs

This will show the ip-address of the client creating
the backup in the logs. For example it will output:
"starting new backup on datastore 'test1' from ::ffff:192.168.1.192:
"host/test/2023-08-21T07:28:10Z"".

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
8 months agogc: improve lost+found comment
Fabian Grünbichler [Tue, 12 Sep 2023 09:29:11 +0000 (11:29 +0200)]
gc: improve lost+found comment

this sounded like we need to skip lost+found to avoid pruning too many chunks,
while the opposite is true - it's safe to skip lost+found on EPERM without
pruning too many chunks, but this is not the case for all EPERM situations..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 months agogc: fix ignoring if `lost+found` can't be accessed
Hannes Laimer [Tue, 12 Sep 2023 09:18:49 +0000 (11:18 +0200)]
gc: fix ignoring if `lost+found` can't be accessed

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Fixes: e2516f61a860eae59395a3a990d9abe4c445ce8c
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 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>
8 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>
8 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>
8 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>
8 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>