]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
4 months agobump version to 2.4.7-1 stable-2
Fabian Grünbichler [Thu, 6 Jun 2024 11:47:05 +0000 (13:47 +0200)]
bump version to 2.4.7-1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 months agobump pxar to 0.10.3
Fabian Grünbichler [Thu, 6 Jun 2024 11:45:08 +0000 (13:45 +0200)]
bump pxar to 0.10.3

for backported format bailing support

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 months agobump version to 2.4.6-2
Thomas Lamprecht [Tue, 16 Apr 2024 11:37:03 +0000 (13:37 +0200)]
bump version to 2.4.6-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoui: add notice for nearing PBS 2.4 End-of-Life
Thomas Lamprecht [Thu, 2 Jun 2022 15:34:45 +0000 (17:34 +0200)]
ui: add notice for nearing PBS 2.4 End-of-Life

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agobump version to 2.4.6-1
Thomas Lamprecht [Thu, 1 Feb 2024 15:32:36 +0000 (16:32 +0100)]
bump version to 2.4.6-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agotape: factor getting encryption fingerprint tuple out
Thomas Lamprecht [Thu, 1 Feb 2024 15:23:42 +0000 (16:23 +0100)]
tape: factor getting encryption fingerprint tuple out

makes it a bit more readable as there's less "noise" in the read_label
function and as the separate new fn allows us to nicely use ? to early
return as it has an option in the return signature avoiding 5 lines of
code while not really getting more terse.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit a7a42de63b95f9589d93b6fa10856484986c7093)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agotape: fix regression in restoring key from medium
Dominik Csapak [Wed, 31 Jan 2024 13:42:33 +0000 (14:42 +0100)]
tape: fix regression in restoring key from medium

Since commit 1343dcaf we automatically try to load the key into the
drive after reading the media-set label, this cannot work for the case
where we actually restore the key from the tape itself.

To address this special case while preserving the automatic key
loading, everything except the setup of the key has been separated
from the 'read_label' method into a new function named
'read_label_without_loading_key'. Consequently, the 'restore-key' API
endpoint can be switched to utilize this new method, thereby avoiding
the issue.

Fixes: 1343dcaf ("tape: move 'set_encryption' calls to the TapeDriver")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: reword and shorten commit message ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit a33d7957412214c41489499f449450b3b5e6601a)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agobump version to 2.4.5-1
Thomas Lamprecht [Wed, 24 Jan 2024 12:33:11 +0000 (13:33 +0100)]
bump version to 2.4.5-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoreport: change output contract of functions
Thomas Lamprecht [Thu, 18 Jan 2024 14:13:32 +0000 (15:13 +0100)]
report: change output contract of functions

let them manage it completely themselves, as we cannot really say if a
code-block fits for the whole output, like it was the case for the
function that returned a limited output of a 'top' process status
command.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit c597473080e573b486377006f51d499033a96c7e)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoreport: add prune.cfg to report
Stefan Lendl [Thu, 4 Jan 2024 11:10:30 +0000 (12:10 +0100)]
report: add prune.cfg to report

prune.cfg stores prune job configurations

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
(cherry picked from commit 6b0d7f3d32372dc412e5d010b011465e3dc3ee7f)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoreport: add extra newline between files of directory output
Thomas Lamprecht [Tue, 28 Nov 2023 11:25:01 +0000 (12:25 +0100)]
report: add extra newline between files of directory output

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 460c3d1619919c07e4e7e105727ae1fbad5a4b00)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agoreport: factor out getting first 30 lines of top output
Thomas Lamprecht [Tue, 28 Nov 2023 11:24:30 +0000 (12:24 +0100)]
report: factor out getting first 30 lines of top output

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 5736fa917c97254409a0edadd801603f4f75722c)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agosystem report: fix warning about checking result
Thomas Lamprecht [Fri, 24 Nov 2023 11:02:27 +0000 (12:02 +0100)]
system report: fix warning about checking result

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 164f96a5a665ff7ddac360dad90ff63dbe30a1dd)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 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>
(cherry picked from commit 122179414cec30934a1e3c35f11fc006b0ee7153)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 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>
(cherry picked from commit c55884d1a7bbd42e49d527a8dc817cb4625c371d)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 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>
(cherry picked from commit 3b5cb8fd335240c4c8448ad3fa6cc5188ea82ef1)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 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>
(cherry picked from commit 49d465c72a7c106e9c0ef5c9e41057c02577a9f1)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 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>
(cherry picked from commit 2f7b3e2ecc8a0ec8b0162154e1231f04965f6519)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 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>
(cherry picked from commit 0b9614d5a426fde27d6bffaea3e5a2cd7de613e8)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 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>
(cherry picked from commit eb32373e3c77ff8b2aa53e7b29d6f7753e1b433e)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 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>
(cherry picked from commit 20875de2ecbd156fe174bc6a07e52beee44c80a1)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 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>
(cherry picked from commit 11c4632bcf53c6e7bb24933f503fd4c3bb46912c)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 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>
(cherry picked from commit 84fb190ee205ea3ae5cd45ab457cb1944c6cdcc7)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agotape: drop unused has_encryption helper
Thomas Lamprecht [Mon, 22 Jan 2024 13:42:28 +0000 (14:42 +0100)]
tape: drop unused has_encryption helper

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 320b72437ce3a48ac75e9639a8f4361dd0f7385d)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agotape: remove unused methods of LtoTapeHandle
Dominik Csapak [Mon, 22 Jan 2024 11:50:35 +0000 (12:50 +0100)]
tape: remove unused methods of LtoTapeHandle

in preparation of making it not public anymore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit 645f81339fe09fb7e4b86393fe9f4274727f2468)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agotape: assert encryption mode when using the PoolWriter
Dominik Csapak [Mon, 22 Jan 2024 11:50:34 +0000 (12:50 +0100)]
tape: assert encryption mode when using the PoolWriter

by introducing an 'assert_encryption_mode' that checks the desired
state, and bails out if it's different, called directly where we
previously set the encryption mode (which is now done automatically)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: add drive_ prefix and fleece in comment ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 3579d724a3f094c4761dc89adabd8402d9113db2)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agotape: move 'set_encryption' calls to the TapeDriver (and implementation)
Dominik Csapak [Mon, 22 Jan 2024 11:50:33 +0000 (12:50 +0100)]
tape: move 'set_encryption' calls to the TapeDriver (and implementation)

namely everytime we know what the key for the tape has to be:
* after we write the MediaSetLabel
* after reading the MediaSetLabel

When handling data on tape, we always have to have the MediaSetLabel, so
we should always trigger one of these. Because of that, we should not be
able to forget to set the encryption mode.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit 1343dcaf011ee81941d9160e9f12e6c36ca69d50)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agotape: fix wrongly unloading encryption key
Dominik Csapak [Mon, 22 Jan 2024 11:50:32 +0000 (12:50 +0100)]
tape: fix wrongly unloading encryption key

For security, we want to automatically unload the encryption key from
the drive when we're done, so there was a Drop handler for SgTape that
handles that. Sadly, our tool we use to set it in the first place, also
invoked the Drop handler, thus unloading the keys again immediately

To fix that, move the Drop handler one logical level higher to the
LtoTapeHandle, which is not used by the 'sg-tape-cmd'.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit 1dc0df339bf9909f2e8fa518bef12b379876620c)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agotape: don't call sg-tape-cmd for unloading encryption keys
Dominik Csapak [Mon, 22 Jan 2024 11:50:31 +0000 (12:50 +0100)]
tape: don't call sg-tape-cmd for unloading encryption keys

since sg-tape-cmd is only necessary if we want to load the key, we don't
have to call it when we don't have one.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit 8ee5a5d30202e319a39e49ddc3280e69b5315036)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agotape: use SgTape in sg-tape-cmd
Dominik Csapak [Mon, 22 Jan 2024 11:50:30 +0000 (12:50 +0100)]
tape: use SgTape in sg-tape-cmd

instead of LtoTapeHandle. This way, we can simply always call the binary
from LtoTapeHandle, and don't have to concern ourselves with the sg_tape
calling.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit f1467d23f34da1e6c296abd6810d4631e2e393f1)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agotape: move key deriving into SgTape
Dominik Csapak [Mon, 22 Jan 2024 11:50:28 +0000 (12:50 +0100)]
tape: move key deriving into SgTape

makes the boundary a bit clearer, introduce 'load_key' to load a single
key from the key config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit 4d17ed496acd3fa9c4fdc8e8750dcf102fc32613)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agotape: provide 'open_lto_drive' methods for LtoTapeHandle and SgTape
Dominik Csapak [Mon, 22 Jan 2024 11:50:27 +0000 (12:50 +0100)]
tape: provide 'open_lto_drive' methods for LtoTapeHandle and SgTape

Prepares for the use in sg-tape-cmd, since we want to use the SgTape
directly instead of LtoTapeHandle.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit b5f8626706a03de74a4fc9f3ee9b74b7b7656e9a)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agotape: improve function naming
Dominik Csapak [Mon, 22 Jan 2024 11:50:26 +0000 (12:50 +0100)]
tape: improve function naming

rename the inner 'set_encryption' in sg_tape to drive_set_encryption,
so that it's a bit clearer where it comes from.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit 8cc8aa510f7a5a5ee119a71f5924a16e86c4455a)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
10 months agopbs2to3: check for proper grub meta-package for bootmode
Stoiko Ivanov [Wed, 29 Nov 2023 14:17:15 +0000 (15:17 +0100)]
pbs2to3: check for proper grub meta-package for bootmode

ported over from pve-manager:
'pve7to8: check for proper grub meta-package for bootmode'
`67c655b9333714f31d5115de80961a2abc4b6506`

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 months agopbs2to3: add check for dkms modules
Stoiko Ivanov [Wed, 29 Nov 2023 14:17:14 +0000 (15:17 +0100)]
pbs2to3: add check for dkms modules

ported over from pve-manager: 'pve7to8: Add check for dkms modules'
`0329876ccf1d78b848897718bb0c2337c6a55fbb`

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
11 months agobump version to 2.4.4-1
Thomas Lamprecht [Fri, 10 Nov 2023 15:05:43 +0000 (16:05 +0100)]
bump version to 2.4.4-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agodocs: faq: move support table to CSV
Thomas Lamprecht [Fri, 10 Nov 2023 14:58:29 +0000 (15:58 +0100)]
docs: faq: move support table to CSV

as the current table format isn't really a recommended way to encode
tables for reStructuredText, and breaks various editor integrations
(and possibly parsing in the future).

From the two supported options, i.e., csv-table and list-table, the
first one seems to be easier to maintain in the long-run, so go for
that.

https://docutils.sourceforge.io/docs/ref/rst/directives.html#csv-table-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 31b121f4b3b95f160322f3e97f395955011bbdd5)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agodocs: faq: add reference to support table
Thomas Lamprecht [Fri, 10 Nov 2023 14:58:10 +0000 (15:58 +0100)]
docs: faq: add reference to support table

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 4650abb46e98ad9b2d751ec7b47ca45c1a0ead99)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 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>
(cherry picked from commit 5d4f9813089eda046d6f20bb6848ed238531be16)
Signed-off-by: Thomas Lamprecht <t.lamprecht@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>
(cherry picked from commit c2fa67b41709f8f63d86023fa7825d412e4612ee)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 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>
(cherry picked from commit 34293047334ed45c66c65356ec533c2353fc8e7c)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 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>
(cherry picked from commit 4206d6fadb7df9d200d69692b76a621a744dc79b)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 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>
(cherry picked from commit be79c2bb6e2db0f39644428e909a53f18ae8b9f3)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 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>
(cherry picked from commit 48fbce07dfe6fa08115d05bdaee89d2dc2332c3c)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 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>
(cherry picked from commit 344db2d6f68946e7e8236c79f9c2b9acc28bf345)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 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>
(cherry picked from commit dae0b67f1fab55782bf77ca6c68c45f5df1bf1b2)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 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>
11 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>
11 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>
11 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>
(cherry picked from commit 9d1ba51de79967f159cf0ad91f57b4d264d6cc19)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 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>
(cherry picked from commit 8fcd709cf27cb60117f1322806177de45fd2bdcc)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 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>
(cherry picked from commit 0d69dcb497c27ea1ee0e5777ef3b10666d9dc52c)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 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>
(cherry picked from commit 5b16dffcf28884621791a68b98ae2339f17ea90c)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 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>
15 months agobump version to 2.4.3-1
Thomas Lamprecht [Wed, 28 Jun 2023 16:55:23 +0000 (18:55 +0200)]
bump version to 2.4.3-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agopbs2to3: do not log warnings in bold
Thomas Lamprecht [Thu, 29 Jun 2023 13:43:17 +0000 (15:43 +0200)]
pbs2to3: do not log warnings in bold

for consistency with both, the summary but also PVE and PMG checker
scripts

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agopbs2to3: add manual page
Thomas Lamprecht [Thu, 29 Jun 2023 05:46:40 +0000 (07:46 +0200)]
pbs2to3: add manual page

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agopbs2to3: install manually to avoid empty shell-completion script
Thomas Lamprecht [Thu, 29 Jun 2023 05:46:21 +0000 (07:46 +0200)]
pbs2to3: install manually to avoid empty shell-completion script

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agopbs2to3: set failure messages to bold
Christian Ebner [Wed, 28 Jun 2023 16:01:01 +0000 (18:01 +0200)]
pbs2to3: set failure messages to bold

... and reset instead of setting color to clear settings

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
15 months agopbs2to3: fix whitespaces
Christian Ebner [Wed, 28 Jun 2023 16:01:00 +0000 (18:01 +0200)]
pbs2to3: fix whitespaces

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
15 months agopbs2to3: fix typo s/neighter/neither/
Christian Ebner [Wed, 28 Jun 2023 16:00:59 +0000 (18:00 +0200)]
pbs2to3: fix typo s/neighter/neither/

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
15 months agocargo: bump proxmox-apt to 0.9.4
Thomas Lamprecht [Wed, 28 Jun 2023 15:34:35 +0000 (17:34 +0200)]
cargo: bump proxmox-apt to 0.9.4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agopbs2to3: add upgrade checker binary
Christian Ebner [Wed, 28 Jun 2023 11:53:28 +0000 (13:53 +0200)]
pbs2to3: add upgrade checker binary

Adds the pbs2to3 upgrade checker with some basic checks.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
16 months agobump version to 2.4.2-2
Thomas Lamprecht [Tue, 6 Jun 2023 11:16:44 +0000 (13:16 +0200)]
bump version to 2.4.2-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 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>
(cherry picked from commit 7075496424feee48b0964801a4fd977c18ed3cc1)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 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>
(cherry picked from commit 73bd988c42859836676c707c3b5257bad40a199f)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 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>
16 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>
16 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>
16 months agomakefile: convert to use simple parenthesis
Thomas Lamprecht [Sun, 21 May 2023 11:57:47 +0000 (13:57 +0200)]
makefile: convert to use simple parenthesis

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agobuildsys: cleanup and expand clean target
Thomas Lamprecht [Sun, 21 May 2023 11:56:43 +0000 (13:56 +0200)]
buildsys: cleanup and expand clean target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agobuild: inject repoid into build environment
Fabian Grünbichler [Wed, 4 Jan 2023 14:13:09 +0000 (15:13 +0100)]
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>
16 months agod/source: override some false-positive lintian tags
Thomas Lamprecht [Sun, 21 May 2023 11:50:27 +0000 (13:50 +0200)]
d/source: override some false-positive lintian tags

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agod/file-restore.postinst: add DEBHELPER stanza
Thomas Lamprecht [Sun, 21 May 2023 11:49:59 +0000 (13:49 +0200)]
d/file-restore.postinst: add DEBHELPER stanza

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agod/control: avoid versioned build-dependcies with a -1 revision
Thomas Lamprecht [Sun, 21 May 2023 11:48:57 +0000 (13:48 +0200)]
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>
16 months agobuildsys: always pre-clean for den and dsc target
Thomas Lamprecht [Sun, 21 May 2023 11:42:19 +0000 (13:42 +0200)]
buildsys: always pre-clean for den and dsc target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agobuildsys: make deb target always build doc package, add deb-nodoc
Thomas Lamprecht [Sun, 21 May 2023 11:35:55 +0000 (13:35 +0200)]
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>
16 months agobuildsys: simplify getting workspace crate list
Thomas Lamprecht [Sun, 21 May 2023 11:32:43 +0000 (13:32 +0200)]
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>
16 months agobuildsys: get metadata only for workspace when resolving sub crates
Thomas Lamprecht [Sun, 21 May 2023 11:17:50 +0000 (13:17 +0200)]
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>
17 months agobump version to 2.4.2-1
Thomas Lamprecht [Wed, 17 May 2023 15:37:38 +0000 (17:37 +0200)]
bump version to 2.4.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agobackup-client: clippy fixes
Thomas Lamprecht [Wed, 17 May 2023 15:36:38 +0000 (17:36 +0200)]
backup-client: clippy fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agofile restore: clippy and format argument fixes
Thomas Lamprecht [Wed, 17 May 2023 15:36:20 +0000 (17:36 +0200)]
file restore: clippy and format argument fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agopbs-datastore: clippy fixes
Thomas Lamprecht [Wed, 17 May 2023 15:35:42 +0000 (17:35 +0200)]
pbs-datastore: clippy fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agopbs-client: clippy fixes
Thomas Lamprecht [Wed, 17 May 2023 15:34:52 +0000 (17:34 +0200)]
pbs-client: clippy fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agopbs-tape: clippy and format string fixes
Thomas Lamprecht [Wed, 17 May 2023 14:47:03 +0000 (16:47 +0200)]
pbs-tape: clippy and format string fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agopbs-config: clippy fixes
Thomas Lamprecht [Wed, 17 May 2023 14:40:41 +0000 (16:40 +0200)]
pbs-config: clippy fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agoclippy fixes
Thomas Lamprecht [Wed, 17 May 2023 14:10:34 +0000 (16:10 +0200)]
clippy fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agodatastore: return error instead of unreachable
Thomas Lamprecht [Wed, 17 May 2023 14:06:25 +0000 (16:06 +0200)]
datastore: return error instead of unreachable

very unexpected and unreachable is probably fine here, but it's not
really winning us anything, so avoid the panic-potential and just
bail out.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agotape: MAM: replace tuple with struct for better readability
Thomas Lamprecht [Wed, 17 May 2023 13:52:24 +0000 (15:52 +0200)]
tape: MAM: replace tuple with struct for better readability

It's needlessly adding mental complexity to always have to translate
usages like info.0 or info.1 in ones head when reading the code.

Transforming this to a struct allows for using descriptive names when
accessing the specific fields and allows for implementing a
constructor per MamFormat, reducing the resulting MAM attribute list
by quite a few lines.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agotape: avoid panic potential in MAM attribute decoder
Thomas Lamprecht [Wed, 17 May 2023 12:57:15 +0000 (14:57 +0200)]
tape: avoid panic potential in MAM attribute decoder

We already saw that quite some tape libraries/loaders/... ain't
always _that_ standard conform, and even if it'd be guaranteed, it
just makes no sense to create a potential for panicking the whole
daemon due to some sub-features hiccup, rather go for actual error
handling...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agotape: update link to IBM SCSI reference LTO 5 - 9
Thomas Lamprecht [Wed, 17 May 2023 12:52:29 +0000 (14:52 +0200)]
tape: update link to IBM SCSI reference LTO 5 - 9

The linked PDF is also captured and archived here:
https://web.archive.org/web/20230517122521/https://www.ibm.com/support/pages/system/files/inline-files/LTO%20SCSI%20Reference_GA32-0928-05%20%28EXTERNAL%29_0.pdf#

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agotape: reduce indentation depth of MAM attribute decoder
Thomas Lamprecht [Wed, 17 May 2023 12:43:01 +0000 (14:43 +0200)]
tape: reduce indentation depth of MAM attribute decoder

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agodatastore: fix compiler warning for unused FromStr import
Thomas Lamprecht [Wed, 17 May 2023 12:33:11 +0000 (14:33 +0200)]
datastore: fix compiler warning for unused FromStr import

Fixes: 161a8864 ("fix #4357: datastore: take into account namespaces ...")
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agoui: main view: rename "Theme" selector to "Color Theme"
Stefan Sterz [Fri, 14 Apr 2023 13:28:10 +0000 (15:28 +0200)]
ui: main view: rename "Theme" selector to "Color Theme"

this is already the case in Proxmox VE so just use the same wording
here too to stay consistent

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
17 months agodocs: fix api viewer dark theme path
Stefan Sterz [Fri, 14 Apr 2023 13:28:09 +0000 (15:28 +0200)]
docs: fix api viewer dark theme path

previously the path to the dark theme's css pointed to the wrong file.
it didn't exist, this one should.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
17 months agofix #4357: datastore: take into account namespaces when marking chunks
Stefan Sterz [Thu, 20 Apr 2023 08:08:53 +0000 (10:08 +0200)]
fix #4357: datastore: take into account namespaces when marking chunks

previously when marking used chunks the namespace wasn't taken into
account and valid snapshots were marked as "strange paths". this lead
to a line in the log of a gc job such as this:

found (and marked) 2 index files outside of expected directory scheme

which some users perceived as an error. parse the namespace too and
only mark the path as strange if parsing the namespace and/or backup
dir fails.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
17 months agoui: tape: fix restoring a single datastore
Dominik Csapak [Tue, 25 Apr 2023 13:59:56 +0000 (15:59 +0200)]
ui: tape: fix restoring a single datastore

if the user selected a single datastore to restore from tape on a
media-set that includes more than one, the ui suggests (and is
intended to) that only that datastore will be restored on the selected
target.

The logic to construct the store mapping parameter did not consider that
case, and simply gave the target as default store, which meant all
datastores were restored onto the target.

To fix that, we have to get the source datastore from the field, and
construct the correct parameter ("source=target").

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
17 months agoui: tape: fix code style/formatting
Dominik Csapak [Tue, 25 Apr 2023 13:59:55 +0000 (15:59 +0200)]
ui: tape: fix code style/formatting

this is a separate statement, it should be on a separate line

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
17 months agoui: dashboard: show tape backups/restores on task summary
Dominik Csapak [Wed, 3 May 2023 12:25:18 +0000 (14:25 +0200)]
ui: dashboard: show tape backups/restores on task summary

for that we have to increase the panel height a bit

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
17 months agoui: dashboard: fix missing prune jobs on task summary
Dominik Csapak [Wed, 3 May 2023 12:25:17 +0000 (14:25 +0200)]
ui: dashboard: fix missing prune jobs on task summary

we want to count types 'prune' and 'prunejobs' for this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>