Commit Graph

7385 Commits

Author SHA1 Message Date
Thomas Lamprecht
470550897a bump version to 3.1.4-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-02-01 16:30:31 +01:00
Thomas Lamprecht
a7a42de63b 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>
2024-02-01 16:25:22 +01:00
Dominik Csapak
a33d795741 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>
2024-02-01 16:25:22 +01:00
Wolfgang Bumiller
1565ff951e tape: silence some warnings
Nightly rustc now warns about unused private fields in the case of a
non-pub newtype struct, so use an underscore-prefixed dummy field name
to get rid of the warning.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-02-01 13:56:28 +01:00
Lukas Wagner
9230e40e35 remove proxmox-rrd crate
The crate was split out and moved to the `proxmox` workspace.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2024-02-01 13:56:28 +01:00
Lukas Wagner
f0c26122e0 rrd_cache: use proxmox-rrd from proxmox workspace
and use renamed structs from proxmox-rrd

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
[w.bumiller@proxmox.com: squash "and use renamed structs from proxmox-rrd" as build fix]
[w.bumiller@proxmox.com: bump d/control]
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-02-01 13:56:03 +01:00
Fabian Grünbichler
d4a4d0cf52 run cargo fmt
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-01-30 11:25:54 +01:00
Gabriel Goller
bd1db341aa fix: cargo local path
Fixed the local path of `proxmox-acme` in the Cargo.toml file.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-01-30 11:23:44 +01:00
Dietmar Maurer
b99c4a7325 acme PluginConfig: add missing serde attributes
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-01-24 13:16:31 +01:00
Thomas Lamprecht
6ab13287b6 bump version to 3.1.3-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-01-22 16:11:46 +01:00
Thomas Lamprecht
e69b132d75 docs: tape: drop redefinition of systemd.time manpage link
included in the always sourced epilog nowadays.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-01-22 16:11:46 +01:00
Thomas Lamprecht
012c51df4e docs: tape: fix wrong underline length in LTO-9 section
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-01-22 16:11:46 +01:00
Thomas Lamprecht
ef1923caf9 docs: remotes: fix missing newline between list and admonition-note
Fixes: f93cbdae ("docs: document new include/exclude paramenter")
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-01-22 16:11:46 +01:00
Thomas Lamprecht
12c5bf5d59 d/lintian-overrides: ignore pbs2to3 using dpkg database directly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-01-22 15:45:40 +01:00
Thomas Lamprecht
320b72437c tape: drop unused has_encryption helper
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-01-22 14:43:54 +01:00
Dominik Csapak
645f81339f tape: remove unused methods of LtoTapeHandle
in preparation of making it not public anymore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-01-22 14:43:54 +01:00
Dominik Csapak
3579d724a3 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>
2024-01-22 14:43:20 +01:00
Dominik Csapak
1343dcaf01 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>
2024-01-22 13:11:17 +01:00
Dominik Csapak
1dc0df339b 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>
2024-01-22 13:11:17 +01:00
Dominik Csapak
8ee5a5d302 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>
2024-01-22 13:11:17 +01:00
Dominik Csapak
f1467d23f3 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>
2024-01-22 13:11:17 +01:00
Dominik Csapak
4d17ed496a 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>
2024-01-22 13:07:13 +01:00
Dominik Csapak
b5f8626706 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>
2024-01-22 13:07:13 +01:00
Dominik Csapak
8cc8aa510f 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>
2024-01-22 13:07:13 +01:00
Wolfgang Bumiller
a9708ec84f client: drop unused code
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-01-19 10:56:46 +01:00
Wolfgang Bumiller
274f7d05f4 cleanup more unnecesary allocations
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-01-19 10:51:17 +01:00
Wolfgang Bumiller
cb1e787e8e cleanup unnecessary allocation
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-01-19 10:49:02 +01:00
Gabriel Goller
19d02ed43b 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>
2024-01-18 16:37:07 +01:00
Thomas Lamprecht
fa86b05d45 run cargo fmt
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-01-18 16:36:02 +01:00
Dietmar Maurer
349c50579c 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>
2024-01-18 16:33:35 +01:00
Thomas Lamprecht
c597473080 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>
2024-01-18 15:36:32 +01:00
Dietmar Maurer
be8f4742ec CertificateInfo: make filename non-optional
It is used as idProperty in the GUI.
2024-01-16 14:14:13 +01:00
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