Commit Graph

7353 Commits

Author SHA1 Message Date
Dietmar Maurer
06009635f6 CertificateInfo: make fields public
This is used in a public API, so fields needs to be public.
2024-01-16 10:56:09 +01:00
Dietmar Maurer
c073c883c4 fix serde attributes for CertificateInfo
skip_serializing_if fingerprint is none...
2024-01-15 13:07:24 +01:00
Dominik Csapak
3657fa1ff3 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>
2024-01-12 10:26:55 +01:00
Dominik Csapak
ee347f69ae 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>
2024-01-12 10:26:43 +01:00
Dominik Csapak
3bf382f411 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>
2024-01-12 10:25:41 +01:00
Dominik Csapak
47b8c553b3 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>
2024-01-12 10:24:21 +01:00
Dominik Csapak
ee8b0a7fc9 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>
2024-01-12 10:22:39 +01:00
Wolfgang Bumiller
a9bb437681 bump proxmox-sys/time to dependency
so Date header formatting uses the C locale

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-01-10 10:46:03 +01:00
Christian Ebner
de6b0ea35a 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>
2024-01-10 10:41:36 +01:00
Wolfgang Bumiller
2dd9f98fde cleanup manual unwrap_or_default()
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-01-10 10:13:45 +01:00
Wolfgang Bumiller
3a45719ecf 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>
2024-01-10 10:13:45 +01:00
Wolfgang Bumiller
64dec8d6f0 api-types: doc improvements
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-01-10 10:13:45 +01:00
Wolfgang Bumiller
126cf33c76 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>
2024-01-10 10:13:45 +01:00
Wolfgang Bumiller
4f0dd33704 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>
2024-01-10 10:13:45 +01:00
Wolfgang Bumiller
bc9509ad14 fixup import grouping
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-01-10 10:13:45 +01:00
Philipp Hufnagl
086cd7db33 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>
2024-01-10 10:13:45 +01:00
Philipp Hufnagl
f93cbdaea7 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>
2024-01-10 10:13:45 +01:00
Philipp Hufnagl
4e45d84fb3 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>
2024-01-10 10:13:45 +01:00
Philipp Hufnagl
59c9273698 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>
2024-01-10 10:13:45 +01:00
Stefan Lendl
6b0d7f3d32 report: add prune.cfg to report
prune.cfg stores prune job configurations

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
2024-01-09 10:05:26 +01:00
Dominik Csapak
d3b934d405 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>
2023-12-22 09:14:37 +01:00
Gabriel Goller
fee9454998 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>
2023-12-20 13:25:00 +01:00
Fiona Ebner
50abd38a70 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>
2023-12-14 13:52:07 +01:00
Dominik Csapak
c7321e2ea3 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>
2023-12-14 10:23:49 +01:00
Dominik Csapak
f622695532 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>
2023-12-13 12:25:33 +01:00
Dominik Csapak
3cca5d7fc4 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>
2023-12-13 12:24:06 +01:00
Dominik Csapak
5f9bdaecf3 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>
2023-12-13 12:23:36 +01:00
Dominik Csapak
667ec4a3c2 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>
2023-12-13 12:14:33 +01:00
Dominik Csapak
66402cdc1b 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>
2023-12-12 14:36:19 +01:00
Dominik Csapak
d555c3839b 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>
2023-12-12 14:36:08 +01:00
Dietmar Maurer
9c1c0780c2 tape: derive Debug for ElementType (fix previous commit)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2023-12-12 14:21:24 +01:00
Dominik Csapak
24bfaa646e 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>
2023-12-12 13:59:25 +01:00
Dominik Csapak
47da06beed 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>
2023-12-12 13:33:00 +01:00
Dominik Csapak
0b1a30aa39 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>
2023-12-12 13:32:30 +01:00
Dominik Csapak
70706fc9f6 tape: derive PartialEq and PartialOrd for TapeDensity
so that we can compare more easily

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-12-12 13:24:58 +01:00
Dominik Csapak
ee6c5560a8 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>
2023-12-12 13:24:43 +01:00
Gabriel Goller
cbb478fa19 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>
2023-12-11 13:09:13 +01:00
Gabriel Goller
0cac699e0c 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>
2023-12-11 13:08:51 +01:00
Wolfgang Bumiller
1e3ed74be5 api-types: add a missing serde(default)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-12-06 15:53:57 +01:00
Wolfgang Bumiller
53fc0e97e4 bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-12-06 13:22:17 +01:00
Wolfgang Bumiller
67cb8f4351 fixup comment and condition readability
(not macro specific)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-12-06 12:58:10 +01:00
Folke Gleumes
54ddd689ab 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>
2023-12-06 12:45:40 +01:00
Folke Gleumes
6aeb96e708 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>
2023-12-06 12:45:38 +01:00
Wolfgang Bumiller
92fcc4c3cd update to proxmox-acme 0.5
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-12-06 12:45:35 +01:00
Wolfgang Bumiller
7fb5bd39e2 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>
2023-12-01 09:52:08 +01:00
Wolfgang Bumiller
7dddf742b8 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>
2023-12-01 09:47:55 +01:00
Thomas Lamprecht
d7e95d62e4 bump version to 3.1.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-30 11:56:54 +01:00
Fabian Grünbichler
4cc4ea64fd 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>
2023-11-30 11:53:22 +01:00
Fabian Grünbichler
b14e5dcb59 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>
2023-11-30 11:52:39 +01:00
Thomas Lamprecht
1181bd5de8 bump version to 3.1.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-30 11:05:08 +01:00