]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
4 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>
4 months agoclient: drop unused code
Wolfgang Bumiller [Fri, 19 Jan 2024 09:56:46 +0000 (10:56 +0100)]
client: drop unused code

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agocleanup more unnecesary allocations
Wolfgang Bumiller [Fri, 19 Jan 2024 09:51:17 +0000 (10:51 +0100)]
cleanup more unnecesary allocations

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agocleanup unnecessary allocation
Wolfgang Bumiller [Fri, 19 Jan 2024 09:49:02 +0000 (10:49 +0100)]
cleanup unnecessary allocation

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agoclose #4819: ui: allow usernames shorter than 4 characters
Gabriel Goller [Wed, 17 Jan 2024 14:29:08 +0000 (15:29 +0100)]
close #4819: ui: allow usernames shorter than 4 characters

This already works in pve and is also possible in pbs when using the
`proxmox-backup-manager user create` command.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
4 months agorun cargo fmt
Thomas Lamprecht [Thu, 18 Jan 2024 15:35:59 +0000 (16:35 +0100)]
run cargo fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoapi: custom certificate upload: make key optional
Dietmar Maurer [Thu, 18 Jan 2024 13:15:33 +0000 (14:15 +0100)]
api: custom certificate upload: make key optional

Use the existing key, if it's not specified, just like we do in the
PVE API.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 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>
4 months agoCertificateInfo: make filename non-optional
Dietmar Maurer [Tue, 16 Jan 2024 13:14:13 +0000 (14:14 +0100)]
CertificateInfo: make filename non-optional

It is used as idProperty in the GUI.

4 months agoCertificateInfo: make fields public
Dietmar Maurer [Tue, 16 Jan 2024 09:56:09 +0000 (10:56 +0100)]
CertificateInfo: make fields public

This is used in a public API, so fields needs to be public.

4 months agofix serde attributes for CertificateInfo
Dietmar Maurer [Mon, 15 Jan 2024 12:07:24 +0000 (13:07 +0100)]
fix serde attributes for CertificateInfo

skip_serializing_if fingerprint is none...

4 months agoui: tape: add remove media button
Dominik Csapak [Thu, 11 Jan 2024 10:40:36 +0000 (11:40 +0100)]
ui: tape: add remove media button

this only removes media from the inventory, it does not touch the data

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agoui: tape inventory: use uuid as id
Dominik Csapak [Thu, 11 Jan 2024 10:40:35 +0000 (11:40 +0100)]
ui: tape inventory: use uuid as id

and add it as a hidden column. This now displays all tapes even if there
are some with identical label-texts.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agoapi: tape: don't allow duplicate media label-texts
Dominik Csapak [Thu, 11 Jan 2024 10:40:34 +0000 (11:40 +0100)]
api: tape: don't allow duplicate media label-texts

quite a few parts of our code assumes that the label-text is unique in
the inventory, which leads to rather unexpected behaviour when having
more than one tape with the same label-text, e.g. a
`proxmox-tape media destroy <LABEL>`
destroys the first one in the config
(same with moving to vault, etc.)

since having multiple tapes with the same human readable name is always
confusing, simply disallow that here

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agoapi: tape: optinally accept uuid for destroy/move media
Dominik Csapak [Thu, 11 Jan 2024 10:40:33 +0000 (11:40 +0100)]
api: tape: optinally accept uuid for destroy/move media

so we can uniquely identify the tapes with duplicate labels.
The change is intended to be backwards compatible.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agotape: handle duplicate label-texts in inventory
Dominik Csapak [Thu, 11 Jan 2024 10:40:32 +0000 (11:40 +0100)]
tape: handle duplicate label-texts in inventory

find_media_by_label_text assumes that the label-texts are unique, but
currently this is not necessarily the case. To properly handle that,
change the signature to return a result, and in case there are duplicate
ones, return an error.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agobump proxmox-sys/time to dependency
Wolfgang Bumiller [Wed, 10 Jan 2024 09:44:27 +0000 (10:44 +0100)]
bump proxmox-sys/time to dependency

so Date header formatting uses the C locale

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agodatastore: add additional context for get_owner parsing error
Christian Ebner [Tue, 9 Jan 2024 17:13:05 +0000 (18:13 +0100)]
datastore: add additional context for get_owner parsing error

By this it becomes clear that the error stems from a parsing error when
getting the backup group owner.

See also: https://forum.proxmox.com/threads/139482/

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 months agocleanup manual unwrap_or_default()
Wolfgang Bumiller [Thu, 4 Jan 2024 12:23:57 +0000 (13:23 +0100)]
cleanup manual unwrap_or_default()

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agomove api-types tests to api-types and drop vec![] macro
Wolfgang Bumiller [Thu, 4 Jan 2024 11:10:12 +0000 (12:10 +0100)]
move api-types tests to api-types and drop vec![] macro

we don't need to allocate here

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agoapi-types: doc improvements
Wolfgang Bumiller [Thu, 4 Jan 2024 10:06:01 +0000 (11:06 +0100)]
api-types: doc improvements

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agoapi-types: impl Display for FilterType
Wolfgang Bumiller [Thu, 4 Jan 2024 10:05:51 +0000 (11:05 +0100)]
api-types: impl Display for FilterType

as the previous commit: simply keep the previous Display impl and call
it from out of the new GroupFilter impl

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agoapi-types: factor out FilterType parsing
Wolfgang Bumiller [Thu, 4 Jan 2024 09:20:16 +0000 (10:20 +0100)]
api-types: factor out FilterType parsing

simply keep the previous FromStr implementation and call it the new
GroupFilter impl

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agofixup import grouping
Wolfgang Bumiller [Thu, 4 Jan 2024 09:17:02 +0000 (10:17 +0100)]
fixup import grouping

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agotests: check if include/exclude behavior works correctly
Philipp Hufnagl [Tue, 2 Jan 2024 11:06:55 +0000 (12:06 +0100)]
tests: check if include/exclude behavior works correctly

This checks if including and excluding works as expected. That the
filter are added out of order is on purpose since it sould make no
difference.

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
4 months agodocs: document new include/exclude paramenter
Philipp Hufnagl [Tue, 2 Jan 2024 11:06:54 +0000 (12:06 +0100)]
docs: document new include/exclude paramenter

Adding the newly introduced optional include/exclude parameter to the
PBS documentation.

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
4 months agoui: Show if Filter includes or excludes
Philipp Hufnagl [Tue, 2 Jan 2024 11:06:53 +0000 (12:06 +0100)]
ui: Show if Filter includes or excludes

To make the UI compatible, the Group Filter dialogue has been extended
by a second list, so it now features a list for all include filter and
one for all exclude filters.

Internally, all include as well as exclude filter are managed into one
list. The 2 list view is just for a cleaner representation in the UI.

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
4 months agofix #4315: jobs: modify GroupFilter so include/exclude is tracked
Philipp Hufnagl [Tue, 2 Jan 2024 11:06:52 +0000 (12:06 +0100)]
fix #4315: jobs: modify GroupFilter so include/exclude is tracked

After some discussion I canged the include/exclude behavior to first run
all include filter and after that all exclude filter (rather then
allowing to alternate inbetween). This is done by splitting them into 2
lists, running include first.

A lot of discussion happened how edge cases should be handled and we
came to following conclusion:

no include filter + no exclude filter => include all
some include filter + no exclude filter => filter as always
no include filter +  some exclude filter => include all then exclude

Since a GroupFilter now also features an behavior, the Struct has been
renamed To GroupType (since simply type is a keyword). The new
GroupFilter now has a behaviour as a flag 'is_exclude'.

I considered calling it 'is_include' but a reader later then might not
know what the opposite of 'include' is (do not include?  deactivate?). I
also considered making a new enum 'behaviour' but since there are only 2
values I considered it over engeneered.

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
4 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>
5 months agotape: work around buggy changer implementations
Dominik Csapak [Wed, 13 Dec 2023 09:00:26 +0000 (10:00 +0100)]
tape: work around buggy changer implementations

allocation length for read element status is a 3 byte field, but it
seems some changers only look at the bottom two bytes. Since we used
0x010000 for it, those changers did not return any data and the calls
failed.

To work around it, request one byte less (0xFFFF) which should still be
enough for the data, but should now work with those buggy
implementations.

Reported by a user in the forum: https://forum.proxmox.com/threads/137391/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agodebian: add gdisk package
Gabriel Goller [Thu, 30 Nov 2023 16:07:28 +0000 (17:07 +0100)]
debian: add gdisk package

The gdisk package contains the `sgdisk` command, which gets used when
initializing a disk with gpt.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
5 months agofix #5117: ui: node info: avoid invalid array access for certain foreign kernels
Fiona Ebner [Thu, 14 Dec 2023 10:40:24 +0000 (11:40 +0100)]
fix #5117: ui: node info: avoid invalid array access for certain foreign kernels

with custom build date format, which would prevent the panel from loading.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
5 months agotape: move 'eject-before-unload' to a plain changer config option
Dominik Csapak [Thu, 14 Dec 2023 09:05:19 +0000 (10:05 +0100)]
tape: move 'eject-before-unload' to a plain changer config option

instead of having it in a property string. For now this should be fine,
and if we need many more such options, we can still move them into a
property string if we want.

Also update the cli command in the docs on how to set it now.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agodocs: tape: add lto 9 considerations
Dominik Csapak [Tue, 12 Dec 2023 14:34:25 +0000 (15:34 +0100)]
docs: tape: add lto 9 considerations

LTO-9 requires a bit of special handling while formatting/first use, so
document that, so nobody is suprised by this behaviour.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agodocs: tape: document advanced changer options
Dominik Csapak [Tue, 12 Dec 2023 14:34:24 +0000 (15:34 +0100)]
docs: tape: document advanced changer options

there is currently only one, but describe what it does and how to set
options in general.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agodocs: tape: replace 'export-media' with 'export-media-set'
Dominik Csapak [Tue, 12 Dec 2023 14:34:23 +0000 (15:34 +0100)]
docs: tape: replace 'export-media' with 'export-media-set'

there is no 'export-media' option, only 'export-media-set'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agotape: fix 'eject-before-unload' api type
Dominik Csapak [Wed, 13 Dec 2023 10:11:12 +0000 (11:11 +0100)]
tape: fix 'eject-before-unload' api type

by converting the bool into an option, otherwise having the options not
set at all will fail the unload while deserializing with
'eject-before-unload is not optional'

Also if we can automatically decide this in the future, we can now
detect if the option was explicitely set or not.

Fixes: 66402cdc ("fix #4904: tape changer: add option to eject before unload")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agofix #4904: tape changer: add option to eject before unload
Dominik Csapak [Thu, 7 Dec 2023 12:51:02 +0000 (13:51 +0100)]
fix #4904: tape changer: add option to eject before unload

some tape libraries need the tape being ejected from the drive before
doing an unload. Since we cannot easily detect if that's the case,
introduce an 'eject_before_unload' option.

Instead of just adding a bool flag to the config, add a new 'options'
property string where we can put such niche options similar to how we
handle the datastore tuning options.

Extend the LtoTapeHandle with 'medium_present' which just uses a
TEST UNIT READY command to check for present medium, so we don't
try to eject an already ejected tape.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agotape: changer: save whole LtoTapeDrive config in MtxMediaChanger
Dominik Csapak [Thu, 7 Dec 2023 12:51:01 +0000 (13:51 +0100)]
tape: changer: save whole LtoTapeDrive config in MtxMediaChanger

we'll need more info from there in the future, so derive clone for it
and save the whole config instead of adding an additional field.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agotape: derive Debug for ElementType (fix previous commit)
Dietmar Maurer [Tue, 12 Dec 2023 13:20:42 +0000 (14:20 +0100)]
tape: derive Debug for ElementType (fix previous commit)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 months agotape: improve error on decode element status page
Dominik Csapak [Wed, 6 Dec 2023 08:17:54 +0000 (09:17 +0100)]
tape: improve error on decode element status page

instead of wrapping the function body in a 'try_block', simply move the
map_err to the only call site, where we can even add more context than
in the function itself.

aside from better error output, no functional change intended

this could help in debugging cases like this issue reported in the forum:
https://forum.proxmox.com/threads/137391/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agoapi: tape: add lto9 initialization message to task log
Dominik Csapak [Tue, 12 Dec 2023 11:32:48 +0000 (12:32 +0100)]
api: tape: add lto9 initialization message to task log

so that it's clear that this operation can take a while

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agotape: adapt format_media for LTO9+
Dominik Csapak [Tue, 12 Dec 2023 11:32:47 +0000 (12:32 +0100)]
tape: adapt format_media for LTO9+

starting with LTO9, a FORMAT(04h) command also reinitializates the tape,
which can take up to tw hours. Since we don't actually want to do that
every time we format, use 'erase_media' when we want a fast erase.
(On a slow erase, we let it run and wait until the drive is ready
again).

The users have to pre-initializate the tapes before using it for them to
work properly though.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agotape: derive PartialEq and PartialOrd for TapeDensity
Dominik Csapak [Tue, 12 Dec 2023 11:32:46 +0000 (12:32 +0100)]
tape: derive PartialEq and PartialOrd for TapeDensity

so that we can compare more easily

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agotape: add optional timeout to wait_until_ready
Dominik Csapak [Tue, 12 Dec 2023 11:32:45 +0000 (12:32 +0100)]
tape: add optional timeout to wait_until_ready

instead of hardcodign the default timeout as only option. This will come
in handy when we need to wait for LTO9+ initialization that can take up
to two hours.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agostatus: use Option on avail/used datastore attrs
Gabriel Goller [Mon, 11 Dec 2023 08:59:02 +0000 (09:59 +0100)]
status: use Option on avail/used datastore attrs

Instead of returning -1 if we can't get the attributes, we use an
Option which will not be serialized on `None`.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
5 months agoui: datastore summary handle non-existent values
Gabriel Goller [Mon, 11 Dec 2023 08:59:01 +0000 (09:59 +0100)]
ui: datastore summary handle non-existent values

Correctly display missing 'avail' and 'used' attributes in the
datatstore summary. This simply sets it to 0, so that we don't get any
errors in the console.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
5 months agoapi-types: add a missing serde(default)
Wolfgang Bumiller [Wed, 6 Dec 2023 14:53:57 +0000 (15:53 +0100)]
api-types: add a missing serde(default)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump d/control
Wolfgang Bumiller [Wed, 6 Dec 2023 12:22:17 +0000 (13:22 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agofixup comment and condition readability
Wolfgang Bumiller [Wed, 6 Dec 2023 11:58:09 +0000 (12:58 +0100)]
fixup comment and condition readability

(not macro specific)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agocli: acme: add possibility to set eab via the cli
Folke Gleumes [Tue, 14 Nov 2023 14:14:04 +0000 (15:14 +0100)]
cli: acme: add possibility to set eab via the cli

If the ca demands external account binding credentials, the user will be
asked for them. If a custom directory is used, the user will be asked if
eab should be used.

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
5 months agoacme: api: add eab options to api
Folke Gleumes [Tue, 14 Nov 2023 14:14:03 +0000 (15:14 +0100)]
acme: api: add eab options to api

Optionally allow for setting external account binding credentials at the
account registration endpoint.

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
5 months agoupdate to proxmox-acme 0.5
Wolfgang Bumiller [Wed, 6 Dec 2023 11:45:35 +0000 (12:45 +0100)]
update to proxmox-acme 0.5

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agotools/disks: skip lsblk for partition check
Wolfgang Bumiller [Wed, 29 Nov 2023 16:20:30 +0000 (17:20 +0100)]
tools/disks: skip lsblk for partition check

We already have a 'Disk' which has a udev 'Device' which we can query
directly.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoadd partition entry value getters to Disk
Wolfgang Bumiller [Wed, 29 Nov 2023 16:19:10 +0000 (17:19 +0100)]
add partition entry value getters to Disk

The ID_PART_ENTRY_* values describe what kind of partition this is and
thus can be used to implement the `.is_partition()` method which we
use in the next patch to avoid calling out to `lsblk`.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agobump version to 3.1.2-1 v3.1.2
Thomas Lamprecht [Thu, 30 Nov 2023 10:56:54 +0000 (11:56 +0100)]
bump version to 3.1.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agosync: fix source store+namespace printing
Fabian Grünbichler [Thu, 30 Nov 2023 10:50:39 +0000 (11:50 +0100)]
sync: fix source store+namespace printing

previously this would always refer to the "top" namespace of the source,
instead of properly iterating over the namespace tree. adapt the trait
accordingly, since this was the only call site.

this fixes a cosmetic issue only.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 months agosync: fix recursive remote sync
Fabian Grünbichler [Thu, 30 Nov 2023 10:42:53 +0000 (11:42 +0100)]
sync: fix recursive remote sync

the snapshot pulling code always selected the "top" namespace of the
source, instead of the passed in namespace parameter.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agobump version to 3.1.1-1
Thomas Lamprecht [Thu, 30 Nov 2023 10:05:08 +0000 (11:05 +0100)]
bump version to 3.1.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoui: fix deleting datastore without 'keep-job-configs'
Dominik Csapak [Thu, 30 Nov 2023 08:49:03 +0000 (09:49 +0100)]
ui: fix deleting datastore without 'keep-job-configs'

without any default value in the viewModel, the resulting url would be:

`<id>?destroy-data=<value>&keep-job-configs=`

which is missing the actual value, so add the default

Fixes: e9979a1a ("ui: add 'keep configs' checkbox to datastore removal window")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
6 months agotree-wide: fix various typos
Thomas Lamprecht [Wed, 29 Nov 2023 17:32:06 +0000 (18:32 +0100)]
tree-wide: fix various typos

found with codespell

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobump version to 3.1.0-1
Thomas Lamprecht [Wed, 29 Nov 2023 16:55:27 +0000 (17:55 +0100)]
bump version to 3.1.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoui: dashboard: increase panel height a bit
Thomas Lamprecht [Wed, 29 Nov 2023 16:52:18 +0000 (17:52 +0100)]
ui: dashboard: increase panel height a bit

to make the system load/status summary one look less cramped, as that
got recently the boot-mode information line added.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoserver: sync email notification: adapt template for local sync jobs
Lukas Wagner [Wed, 29 Nov 2023 16:35:12 +0000 (17:35 +0100)]
server: sync email notification: adapt template for local sync jobs

Add a guard clause that checks `job.remote`, otherwise the template
fails to render to to handlebars being configured in strict mode.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agodocs: note that the webui has a show connection information button
Dominik Csapak [Wed, 29 Nov 2023 15:49:52 +0000 (16:49 +0100)]
docs: note that the webui has a show connection information button

so that users know where they can easily copy that information

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agoui: add fingerprint also to the 'show connection information' window
Dominik Csapak [Wed, 29 Nov 2023 15:49:51 +0000 (16:49 +0100)]
ui: add fingerprint also to the 'show connection information' window

by globally calling the 'status' api once and saving the fingerprint
into the global Proxmox variable.

since not all users might have that permission, ignore errors for that,
and don't show the fingerprint in this case

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agoui: add 'show connection information' button for datastores
Dominik Csapak [Wed, 29 Nov 2023 15:49:50 +0000 (16:49 +0100)]
ui: add 'show connection information' button for datastores

this has a similar functionality as the 'show fingerprint' button,
but for repository strings that are needed e.g. for the cli

included with and without the current user for convenience

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: squash in window title rename and iconCls fix for light-mode ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoui: datastore content: add menu separator above forget entry
Thomas Lamprecht [Wed, 29 Nov 2023 16:05:38 +0000 (17:05 +0100)]
ui: datastore content: add menu separator above forget entry

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agofix an unused import warning
Wolfgang Bumiller [Wed, 29 Nov 2023 14:34:43 +0000 (15:34 +0100)]
fix an unused import warning

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agofix variables not needing mut warnings
Wolfgang Bumiller [Wed, 29 Nov 2023 14:34:37 +0000 (15:34 +0100)]
fix variables not needing mut warnings

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoui: dashboard: nicely display kernel version
Gabriel Goller [Wed, 29 Nov 2023 13:29:01 +0000 (14:29 +0100)]
ui: dashboard: nicely display kernel version

Extract and display the build version and kernel
release nicely.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agonode: status: declutter kernel-version
Gabriel Goller [Wed, 29 Nov 2023 13:29:00 +0000 (14:29 +0100)]
node: status: declutter kernel-version

Return a struct with all the components of the kernel version like it
has been done in pve. Also return the legacy `kversion` to keep
backwards compat.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agoui: dashboard: show the bootmode
Gabriel Goller [Wed, 29 Nov 2023 13:28:59 +0000 (14:28 +0100)]
ui: dashboard: show the bootmode

Shows the bootmode of the instance. Options are Legacy BIOS,
EFI, or EFI(Secure Boot).

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agonode: status: added bootmode
Gabriel Goller [Wed, 29 Nov 2023 13:28:58 +0000 (14:28 +0100)]
node: status: added bootmode

Added field that shows the bootmode of the node. The bootmode is either
Legacy Bios, EFI, or EFI (Secure Boot). To detect the mode we use the
exact same method as in pve: We check if the `/sys/firmware/efi` folder
exists, then check if the `SecureBoot-xx...` file in the `efivars`
directory has the SecureBoot flag enabled.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agobump proxmox-sys dependency to 0.5.2
Wolfgang Bumiller [Wed, 29 Nov 2023 14:27:40 +0000 (15:27 +0100)]
bump proxmox-sys dependency to 0.5.2

for boot mode info

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agotree-wide: run cargo fmt
Thomas Lamprecht [Wed, 29 Nov 2023 14:22:43 +0000 (15:22 +0100)]
tree-wide: run cargo fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 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>
6 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>
6 months agoui: disable rate-limit for local sync jobs
Hannes Laimer [Wed, 29 Nov 2023 09:56:58 +0000 (10:56 +0100)]
ui: disable rate-limit for local sync jobs

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agomanager cli: disk wipe: ask over stdout and drop now useless loop
Thomas Lamprecht [Wed, 29 Nov 2023 13:51:26 +0000 (14:51 +0100)]
manager cli: disk wipe: ask over stdout and drop now useless loop

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agocli: add interactive confirmation for block device wipe
Markus Frank [Wed, 29 Nov 2023 13:20:18 +0000 (14:20 +0100)]
cli: add interactive confirmation for block device wipe

If stdin is a TTY, an interactive prompt is added to confirm the deletion
of a block device, ensuring user verification before proceeding.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
6 months agodocs: remove pointless table title
Alexander Zeidler [Tue, 28 Nov 2023 13:35:09 +0000 (14:35 +0100)]
docs: remove pointless table title

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
6 months agodocs: add further secure boot information, as in pve-docs
Alexander Zeidler [Tue, 28 Nov 2023 13:35:08 +0000 (14:35 +0100)]
docs: add further secure boot information, as in pve-docs

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
6 months agoremove unused code
Wolfgang Bumiller [Wed, 29 Nov 2023 09:20:24 +0000 (10:20 +0100)]
remove unused code

this was moved to proxmox_router long ago

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoui: add 'keep configs' checkbox to datastore removal window
Hannes Laimer [Wed, 29 Nov 2023 08:59:41 +0000 (09:59 +0100)]
ui: add 'keep configs' checkbox to datastore removal window

... since the API already accepts a boolean for that.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
[ DC: actually send the option to the api ]
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agoRevert "ui: sync job edit: fix showing value for target store upon edit of local...
Thomas Lamprecht [Wed, 29 Nov 2023 07:57:28 +0000 (08:57 +0100)]
Revert "ui: sync job edit: fix showing value for target store upon edit of local sync job"

This reverts commit 3940f48c4702136ba2907ed8fc57401a3d930418 as it's
bogus and was already fixed on master, so that's why testing this
change made it look like it was working now compared to the previous
version.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoui: sync job edit: fix showing value for target store upon edit of local sync job
Fiona Ebner [Tue, 28 Nov 2023 16:04:15 +0000 (17:04 +0100)]
ui: sync job edit: fix showing value for target store upon edit of local sync job

when editing a local sync job, the field would be empty because of
this and not be set to the previously configured remote-store.

The binding is already used for the local datastore, not sure why it
should even be applied to the target where it might not even be valid.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
6 months agofix #3690: ui: enable wipe-disk feature in system disk view
Markus Frank [Tue, 28 Nov 2023 13:23:22 +0000 (14:23 +0100)]
fix #3690: ui: enable wipe-disk feature in system disk view

Set `supportsWipeDisk` to true to enables the wipe button in the web
UI.

The entry for override_task_descriptions is copied from pve-manager.

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>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
6 months agofix #3690: manager cli: add wipe commands to disk group
Markus Frank [Tue, 28 Nov 2023 13:23:21 +0000 (14:23 +0100)]
fix #3690: manager cli: add wipe commands to disk group

A new cli subcommand which calls the api wipe_disk function to wipe a
disk/partition with a specified dev name.

Examples:
proxmox-backup-manager disk wipe sda2
proxmox-backup-manager disk wipe sda
proxmox-backup-manager disk wipe nvme0n1p1

The complete_partition_name from tools/disks/mod.rs is used for
command completion.

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>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
6 months agofix #3690: api: add endpoint for wipe block devices
Markus Frank [Tue, 28 Nov 2023 13:23:20 +0000 (14:23 +0100)]
fix #3690: api: add endpoint for wipe block devices

An api function similar to PVE wipedisk function that takes a
disk/partition dev name as argument to wipe it in a new WorkerTask
thread.

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>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
6 months agofix #3690: tools: add helper functions for wiping block devices
Markus Frank [Tue, 28 Nov 2023 13:23:19 +0000 (14:23 +0100)]
fix #3690: tools: add helper functions for wiping block devices

The wipe_blockdev & change_parttype functions are similar to
PVE::Diskmanage's wipe_blockdev & change_parttype functions.

The partition_by_name & complete_partition_name functions are
modified disk_by_name & complete_disk_name functions for partitions.

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>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
6 months agoapi types: add regex, format & schema for partition names
Markus Frank [Tue, 28 Nov 2023 13:23:18 +0000 (14:23 +0100)]
api types: add regex, format & schema for partition names

The new regex is similar to BLOCKDEVICE_NAME_REGEX but also allows
numbers at the end of the device name (also allows partitions names).
For nvme partitions it also allows the letter p and a number.

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>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
6 months agoui: fix changing remote to local sync job
Hannes Laimer [Tue, 28 Nov 2023 14:16:54 +0000 (15:16 +0100)]
ui: fix changing remote to local sync job

Reported-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agopull: fix permission checks for local syncs
Hannes Laimer [Tue, 28 Nov 2023 14:16:53 +0000 (15:16 +0100)]
pull: fix permission checks for local syncs

Reported-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agoui: update online help info
Thomas Lamprecht [Tue, 28 Nov 2023 16:34:56 +0000 (17:34 +0100)]
ui: update online help info

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoui: datastore content: add context menu to groups and snapshots
Dominik Csapak [Tue, 28 Nov 2023 09:44:00 +0000 (10:44 +0100)]
ui: datastore content: add context menu to groups and snapshots

and show the relevant actions. They will be forwarded to the controller,
so we can reuse that code without big refactoring them into another
class/place.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agodocs: fix formatting
Alexander Zeidler [Tue, 28 Nov 2023 11:11:47 +0000 (12:11 +0100)]
docs: fix formatting

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
6 months agodocs: s/apt-get/apt due to interactive use
Alexander Zeidler [Tue, 28 Nov 2023 11:11:46 +0000 (12:11 +0100)]
docs: s/apt-get/apt due to interactive use

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
6 months agoui: fix local sync job edit
Hannes Laimer [Tue, 28 Nov 2023 13:01:24 +0000 (14:01 +0100)]
ui: fix local sync job edit

... since the store field was cleared when the window opened.

Reported-by: Lukas Wagner <l.wagner@proxmox.com>
Fixes: 9039d6709e375f37bb8a21680f6fefb18ee87ab3
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
6 months agobump version to 3.0.5-1
Thomas Lamprecht [Tue, 28 Nov 2023 11:42:06 +0000 (12:42 +0100)]
bump version to 3.0.5-1

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