[pve-devel] [PATCH v3 pve-common 03/12] test: add tests for path_is_absolute and path_is_relative of PVE::Path

2025-01-09 Thread Max Carrara
Add cases for both functions, as they're each other's opposite. Signed-off-by: Max Carrara --- Changes v2 --> v3: * None Changes v1 --> v2: * NEW: Split from patch 02 test/Path/Makefile | 1 + test/Path/path_is_absolute_relativ

[pve-devel] [PATCH v3 pve-common 04/12] test: add tests for path_components of PVE::Path

2025-01-09 Thread Max Carrara
Signed-off-by: Max Carrara --- Changes v2 --> v3: * Adapt code accordingly since path_components doesn't return a list ref in scalar context anymore Changes v1 --> v2: * NEW: Split from patch 02 test/Path/Makefile | 1 + test/Path/path_components_tes

[pve-devel] [PATCH v3 pve-common 12/12] debian: introduce package libproxmox-fs-path-utils-perl

2025-01-09 Thread Max Carrara
other module too. Their functionality goes hand-in-hand. Signed-off-by: Max Carrara --- Changes v2 --> v3: * None Changes v1 --> v2: * None debian/control | 6 debian/libproxmox-fs-path-utils-perl.install | 2 ++ debian/libpve-common-perl.install

[pve-devel] [PATCH v3 pve-common 00/12] Introduce and Package PVE::Path & PVE::Filesystem

2025-01-09 Thread Max Carrara
mox.com/ v2: https://lore.proxmox.com/pve-devel/20241220185207.519912-1-m.carr...@proxmox.com/ Summary of Changes ---------- Max Carrara (12): introduce PVE::Path test: add directory for tests of PVE::Path module test: add tests for path_is_absolute and path_is_relative of PVE::Path

[pve-devel] [PATCH v3 pve-common 09/12] test: add tests for file path operation functions of PVE::Path

2025-01-09 Thread Max Carrara
of suffixes. Signed-off-by: Max Carrara --- Changes v2 --> v3: * Adapt code accordingly since path_file_suffixes and path_file_parts don't return a list ref in scalar context anymore Changes v1 --> v2: * NEW: Split from patch 02 test/Path/Makefile |1 + t

[pve-devel] [PATCH v3 pve-common 10/12] test: add tests for path_normalize of PVE::Path

2025-01-09 Thread Max Carrara
Add these tests solely to ensure that the behaviour of path_normalize stays consistent / stable in case we ever decide to provide our own implementation instead of wrapping File::Spec->canonpath(). Signed-off-by: Max Carrara --- Changes v2 --> v3: * None Changes v1 --> v2: * NEW: S

[pve-devel] [PATCH v3 pve-common 11/12] introduce PVE::Filesystem

2025-01-09 Thread Max Carrara
while PVE::Path doesn't ever alter the filesystem, PVE::Filesystem does, as the name implies. This is done in order to clearly separate concerns. Signed-off-by: Max Carrara --- Changes v2 --> v3: * None Changes v1 --> v2: * None src/Makefile | 1 + src/P

[pve-devel] [PATCH v3 pve-common 08/12] test: add tests for path_starts_with, path_ends_with, path_equals

2025-01-09 Thread Max Carrara
.. of PVE::Path. Each function has its test cases defined separately to avoid running unnecessary tests / repeating equivalent tests for certain things. Signed-off-by: Max Carrara --- Changes v2 --> v3: * None Changes v1 --> v2: * NEW: Split from patch 02 test/Path/Ma

[pve-devel] [PATCH v3 pve-common 06/12] test: add tests for path_push of PVE::Path

2025-01-09 Thread Max Carrara
Signed-off-by: Max Carrara --- Changes v2 --> v3: * None Changes v1 --> v2: * NEW: Split from patch 02 test/Path/Makefile | 1 + test/Path/path_push_tests.pl | 159 +++ 2 files changed, 160 insertions(+) create mode 100755 tes

[pve-devel] [PATCH v3 pve-common 07/12] test: add tests for path_parent of PVE::Path

2025-01-09 Thread Max Carrara
ze, which wraps canonpath). The path_parent function should otherwise work the same as Rust's std::path::Path::parent [1]. The discrepancies as mentioned above are checked for by the tests introduced here. [1]: https://doc.rust-lang.org/std/path/struct.Path.html#method.parent Signed-off-by: Ma

[pve-devel] [PATCH v3 pve-common 05/12] test: add tests for path_join of PVE::Path

2025-01-09 Thread Max Carrara
t and joined a second time (it only has to be *logically*), normalize both the re-joined and the expected path before comparison. Signed-off-by: Max Carrara --- Changes v2 --> v3: * None Changes v1 --> v2: * NEW: Split from patch 02 test/Path/Makefile | 1 + test/Path/path_jo

[pve-devel] [PATCH v3 pve-common 01/12] introduce PVE::Path

2025-01-09 Thread Max Carrara
regards to storage. Signed-off-by: Max Carrara --- Changes v2 --> v3: * Don't return a reference to a list anymore when path_components, path_file_suffixes, path_file_parts are called in scalar context * Mention '/' being added at the start of the components bei

[pve-devel] [PATCH v3 pve-common 02/12] test: add directory for tests of PVE::Path module

2025-01-09 Thread Max Carrara
Add the test/Path directory as well as test/Path/Makefile, containing the scaffolding for tests regarding PVE::Path. Include test/Path as subdirectory in test/Makefile, so test/Path/Makefile runs when the other tests run, too. Signed-off-by: Max Carrara --- Changes v2 --> v3: * None Chan

Re: [pve-devel] [PATCH v2 pve-common 01/12] introduce PVE::Path

2025-01-09 Thread Max Carrara
On Thu Jan 9, 2025 at 12:06 PM CET, Wolfgang Bumiller wrote: > On Thu, Jan 09, 2025 at 10:56:16AM +0100, Max Carrara wrote: > > On Wed Jan 8, 2025 at 3:05 PM CET, Wolfgang Bumiller wrote: > > > On Fri, Dec 20, 2024 at 07:51:56PM +0100, Max Carrara wrote: > > > &g

Re: [pve-devel] [PATCH v2 pve-common 01/12] introduce PVE::Path

2025-01-09 Thread Max Carrara
On Wed Jan 8, 2025 at 3:05 PM CET, Wolfgang Bumiller wrote: > On Fri, Dec 20, 2024 at 07:51:56PM +0100, Max Carrara wrote: > > The PVE::Path module concerns itself with file / directory path > > operations, like getting the parent directory of a path, extracting > > th

Re: [pve-devel] [PATCH v2 pve-common 00/12] Introduce and Package PVE::Path & PVE::Filesystem

2025-01-02 Thread Max Carrara
On Thu Jan 2, 2025 at 2:53 PM CET, Fiona Ebner wrote: > Am 02.01.25 um 14:46 schrieb Fiona Ebner: > > Am 20.12.24 um 19:51 schrieb Max Carrara: > >> Introduce and Package PVE::Path & PVE::Filesystem - v2 > >> ==

[pve-devel] [PATCH v2 pve-common 11/12] introduce PVE::Filesystem

2024-12-20 Thread Max Carrara
while PVE::Path doesn't ever alter the filesystem, PVE::Filesystem does, as the name implies. This is done in order to clearly separate concerns. Signed-off-by: Max Carrara --- Changes v1 --> v2: * None. src/Makefile | 1 + src/PVE/

[pve-devel] [PATCH v2 pve-common 03/12] test: add tests for path_is_absolute and path_is_relative of PVE::Path

2024-12-20 Thread Max Carrara
Add cases for both functions, as they're each other's opposite. Signed-off-by: Max Carrara --- Changes v1 --> v2: * NEW: Split from patch 02 test/Path/Makefile | 1 + test/Path/path_is_absolute_relative_tests.pl | 122 +++ 2 files

[pve-devel] [PATCH v2 pve-common 04/12] test: add tests for path_components of PVE::Path

2024-12-20 Thread Max Carrara
Signed-off-by: Max Carrara --- Changes v1 --> v2: * NEW: Split from patch 02 test/Path/Makefile | 1 + test/Path/path_components_tests.pl | 159 + 2 files changed, 160 insertions(+) create mode 100755 test/Path/path_components_tests.pl d

[pve-devel] [PATCH v2 pve-common 07/12] test: add tests for path_parent of PVE::Path

2024-12-20 Thread Max Carrara
ze, which wraps canonpath). The path_parent function should otherwise work the same as Rust's std::path::Path::parent [1]. The discrepancies as mentioned above are checked for by the tests introduced here. [1]: https://doc.rust-lang.org/std/path/struct.Path.html#method.parent Signed-off-by:

[pve-devel] [PATCH v2 pve-common 10/12] test: add tests for path_normalize of PVE::Path

2024-12-20 Thread Max Carrara
Add these tests solely to ensure that the behaviour of path_normalize stays consistent / stable in case we ever decide to provide our own implementation instead of wrapping File::Spec->canonpath(). Signed-off-by: Max Carrara --- Changes v1 --> v2: * NEW: Split from patch 02 tes

Re: [pve-devel] [PATCH v1 pve-common 0/4] Introduce and Package PVE::Path & PVE::Filesystem

2024-12-20 Thread Max Carrara
On Thu Dec 19, 2024 at 7:31 PM CET, Max Carrara wrote: > Introduce and Package PVE::Path & PVE::Filesystem > = > Superseded by: https://lore.proxmox.com/pve-devel/20241220185207.519912-1-m.carr..

[pve-devel] [PATCH v2 pve-common 06/12] test: add tests for path_push of PVE::Path

2024-12-20 Thread Max Carrara
Signed-off-by: Max Carrara --- Changes v1 --> v2: * NEW: Split from patch 02 test/Path/Makefile | 1 + test/Path/path_push_tests.pl | 159 +++ 2 files changed, 160 insertions(+) create mode 100755 test/Path/path_push_tests.pl diff --git a/t

[pve-devel] [PATCH v2 pve-common 09/12] test: add tests for file path ops functions of PVE::Path

2024-12-20 Thread Max Carrara
of suffixes. Signed-off-by: Max Carrara --- Changes v1 --> v2: * NEW: Split from patch 02 test/Path/Makefile |1 + test/Path/path_file_ops_tests.pl | 1220 ++ 2 files changed, 1221 insertions(+) create mode 100755 test/Path/path_file_ops_test

[pve-devel] [PATCH v2 pve-common 08/12] test: add tests for path_starts_with, path_ends_with, path_equals

2024-12-20 Thread Max Carrara
.. of PVE::Path. Each function has its test cases defined separately to avoid running unnecessary tests / repeating equivalent tests for certain things. Signed-off-by: Max Carrara --- Changes v1 --> v2: * NEW: Split from patch 02 test/Path/Makefile | 1 + test/P

[pve-devel] [PATCH v2 pve-common 01/12] introduce PVE::Path

2024-12-20 Thread Max Carrara
regards to storage. Signed-off-by: Max Carrara --- Changes v1 --> v2: * Improve some wording in the docstring of path_components * Simplify some logic in path_parent and remove an unnecessary sanity check * Actually treat "foo" as "./foo" in path_parent as mention

[pve-devel] [PATCH v2 pve-common 02/12] test: add directory for tests of PVE::Path module

2024-12-20 Thread Max Carrara
Add the test/Path directory as well as test/Path/Makefile, containing the scaffolding for tests regarding PVE::Path. Include test/Path as subdirectory in test/Makefile, so test/Path/Makefile runs when the other tests run, too. Signed-off-by: Max Carrara --- Changes v1 --> v2: * NEW: Sp

[pve-devel] [PATCH v2 pve-common 12/12] debian: introduce package libproxmox-fs-path-utils-perl

2024-12-20 Thread Max Carrara
other module too. Their functionality goes hand-in-hand. Signed-off-by: Max Carrara --- Changes v1 --> v2: * None. debian/control | 6 debian/libproxmox-fs-path-utils-perl.install | 2 ++ debian/libpve-common-perl.install| 29 +++

[pve-devel] [PATCH v2 pve-common 05/12] test: add tests for path_join of PVE::Path

2024-12-20 Thread Max Carrara
t and joined a second time (it only has to be *logically*), normalize both the re-joined and the expected path before comparison. Signed-off-by: Max Carrara --- Changes v1 --> v2: * NEW: Split from patch 02 test/Path/Makefile | 1 + test/Path/path_join_tests.

[pve-devel] [PATCH v2 pve-common 00/12] Introduce and Package PVE::Path & PVE::Filesystem

2024-12-20 Thread Max Carrara
-- [1]: https://lore.proxmox.com/pve-devel/4990a4b4-5027-4db2-9909-d36af8a54...@proxmox.com/ Older Versions -- v1: https://lore.proxmox.com/pve-devel/20241219183143.526267-1-m.carr...@proxmox.com/ Summary of Changes ---------- Max Carrara (12): introduce PVE::Path test: add directo

Re: [pve-devel] [PATCH v1 pve-common 2/4] add tests for PVE::Path

2024-12-20 Thread Max Carrara
On Thu Dec 19, 2024 at 8:08 PM CET, Thomas Lamprecht wrote: > Am 19.12.24 um 19:31 schrieb Max Carrara: > > This commit adds a plethora of parameterized tests for all functions > > of PVE::Path (except aliases). This surmounts to 1050 tests being run > > in total. Some of thes

[pve-devel] [PATCH v1 pve-common 2/4] add tests for PVE::Path

2024-12-19 Thread Max Carrara
. Signed-off-by: Max Carrara --- test/Makefile |5 +- test/Path/Makefile | 20 + test/Path/path_basic_tests.pl | 1331 test/Path/path_comparison_tests.pl | 859 ++ test/Path/path_file_ops_tests.pl | 1220

[pve-devel] [PATCH v1 pve-common 0/4] Introduce and Package PVE::Path & PVE::Filesystem

2024-12-19 Thread Max Carrara
es -- [1]: https://doc.rust-lang.org/std/path/index.html [2]: https://docs.python.org/3/library/pathlib.html [3]: https://xkcd.com/927/ [4]: https://doc.rust-lang.org/std/fs/index.html Summary of Changes -- Max Carrara (4): introduce PVE::Path add tests for PVE::Path introdu

[pve-devel] [PATCH v1 pve-common 1/4] introduce PVE::Path

2024-12-19 Thread Max Carrara
regards to storage. Signed-off-by: Max Carrara --- src/Makefile| 1 + src/PVE/Path.pm | 956 2 files changed, 957 insertions(+) create mode 100644 src/PVE/Path.pm diff --git a/src/Makefile b/src/Makefile index 2d8bdc4..25bc490 100644 --- a/src

[pve-devel] [PATCH v1 pve-common 4/4] debian: introduce package libproxmox-fs-path-utils-perl

2024-12-19 Thread Max Carrara
other module too. Their functionality goes hand-in-hand. Signed-off-by: Max Carrara --- debian/control | 6 debian/libproxmox-fs-path-utils-perl.install | 2 ++ debian/libpve-common-perl.install| 29 3 files changed, 37 inser

[pve-devel] [PATCH v1 pve-common 3/4] introduce PVE::Filesystem

2024-12-19 Thread Max Carrara
while PVE::Path doesn't ever alter the filesystem, PVE::Filesystem does, as the name implies. This is done in order to clearly separate concerns. Signed-off-by: Max Carrara --- src/Makefile | 1 + src/PVE/Filesystem.pm | 78 +++ 2 fi

Re: [pve-devel] [PATCH v2 storage 09/10] common: introduce common module

2024-12-18 Thread Max Carrara
On Tue Dec 17, 2024 at 4:48 PM CET, Fiona Ebner wrote: > From: Max Carrara > > This module's purpose is to provide shared functions, constants, etc. > for storage plugins and storage-related operations. > > It also contains the `get_deprecation_warning` subroutine that ma

Re: [pve-devel] [PATCH v1 pve-common 11/18] pbsclient: let `status` method return a hash instead of an array

2024-11-21 Thread Max Carrara
On Mon Nov 11, 2024 at 8:17 PM CET, Thomas Lamprecht wrote: > Am 02.08.24 um 15:26 schrieb Max Carrara: > > Instead of returning an (arguably awkward) array with four elements, > > can be fine, but FWIW, this is how our storage plugin system expects the > status, but cu

Re: [pve-devel] [PATCH v1 pve-common 10/18] pbsclient: use `File::Spec->catfile` to concatenate file paths

2024-11-21 Thread Max Carrara
On Mon Nov 11, 2024 at 8:16 PM CET, Thomas Lamprecht wrote: > a commit message explaining why/benefits would be good – especially as IIRC > we currently do not use this module at all? Sure, I'll add one! I've opted to using `File::Spec` here because I've been using it a lot for other things (that

Re: [pve-devel] [PATCH v1 pve-common 09/18] pbsclient: create secret dir with `mkdir -p` and mode `700`

2024-11-21 Thread Max Carrara
On Mon Nov 11, 2024 at 8:16 PM CET, Thomas Lamprecht wrote: > Am 02.08.24 um 15:26 schrieb Max Carrara: > > .. instead of using a regular `mkdir` call. > > > > The `File::Path::make_path` subroutine is used for this purpose, which > > recursively creates all direc

Re: [pve-devel] [PATCH v1 pve-common 08/18] pbsclient: document package and its public functions & methods

2024-11-21 Thread Max Carrara
On Mon Nov 11, 2024 at 8:14 PM CET, Thomas Lamprecht wrote: > Am 02.08.24 um 15:26 schrieb Max Carrara: > > This commit adds a brief overview for the `PVE::PBSClient` package and > > documents its public functions and methods. Examples are added where > > deemed appropriate

Re: [pve-devel] Proposal: support for atomic snapshot of all VM disks at once

2024-11-21 Thread Max Carrara
On Wed Nov 20, 2024 at 5:10 PM CET, Ivaylo Markov wrote: > Hello, > > I've been caught up in other things and it's been a while, but as I was > collating and testing my proposed changes, I came across this again and > thought I'd clarify something. > > On

Re: [pve-devel] partially-applied-series: [PATCH v3 pve-common 0/5] Section Config: Documentation & Code Cleanup

2024-11-14 Thread Max Carrara
On Mon Nov 11, 2024 at 2:59 PM CET, Thomas Lamprecht wrote: > Am 31.10.24 um 18:07 schrieb Max Carrara: > > Section Config: Documentation & Code Cleanup - v3 > > = > > > > Notable Changes Since v2 > > --

Re: [pve-devel] [PATCH v2 pve-common 0/4] Section Config: Documentation & Code Cleanup

2024-10-31 Thread Max Carrara
On Tue Jul 2, 2024 at 4:13 PM CEST, Max Carrara wrote: > Section Config: Documentation & Code Cleanup - v2 > = Superseded by v3: https://lore.proxmox.com/pve-devel/20241031170720.338794-1-m.carr...@proxmox.com/ > > Notable

[pve-devel] [PATCH v3 pve-common 5/5] section config: fix spelling of variable

2024-10-31 Thread Max Carrara
s/modifyable/modifiable Signed-off-by: Max Carrara --- Changes v2 --> v3: * new src/PVE/SectionConfig.pm | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm index aa17391..16ad7aa 100644 --- a/src/

[pve-devel] [PATCH v3 pve-common 1/5] section config: document package and its methods with POD

2024-10-31 Thread Max Carrara
[1]: https://github.com/bscan/PerlNavigator Signed-off-by: Max Carrara --- Changes v2 --> v3: * update POD style * place NAME, DESCRIPTION, USAGE sections above `package` definition * remove excess usage of I<> codes * remove needless `=pod` paragraphs (e.g. `=head3` alone suffic

[pve-devel] [PATCH v3 pve-common 3/5] section config: clean up parser logic and semantics

2024-10-31 Thread Max Carrara
: Max Carrara --- Changes v2 --> v3: * none Changes v1 --> v2: * reword commit message * for errors, use reference of array instead of array directly * drop 'x' modifier from $re_kv_pair regex, as it doesn't have any benefit src/PVE/S

[pve-devel] [PATCH v3 pve-common 4/5] section config: make subroutine `delete_from_config` private

2024-10-31 Thread Max Carrara
because it's just an internal helper method and isn't used anywhere outside of the package. Signed-off-by: Max Carrara --- Changes v2 --> v3: * none Changes v1 --> v2: * new src/PVE/SectionConfig.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[pve-devel] [PATCH v3 pve-common 2/5] section config: update code style

2024-10-31 Thread Max Carrara
ogether. Signed-off-by: Max Carrara --- Changes v2 --> v3: * none Changes v1 --> v2: * none src/PVE/SectionConfig.pm | 62 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm

[pve-devel] [PATCH v3 pve-common 0/5] Section Config: Documentation & Code Cleanup

2024-10-31 Thread Max Carrara
nts in the individual patches for a detailed list of changes. Older Versions -- v2: https://lore.proxmox.com/pve-devel/20240702141314.445130-1-m.carr...@proxmox.com/ v1: https://lore.proxmox.com/pve-devel/20240604092850.126083-1-m.carr...@proxmox.com/ Summary of Changes ------ M

Re: [pve-devel] [PATCH widget-toolkit] fix external linking to products by setting cookie SameSite attribute to lax

2024-10-08 Thread Max Carrara
On Mon Oct 7, 2024 at 5:02 PM CEST, Dominik Csapak wrote: > We introduced the 'strict' setting when browsers warned about our > cookies not having any SameSite setting [0] > > While this works in general, it had an unforeseen side effect: > > When linking to a URL of our products, the cookie does n

Re: [pve-devel] Proposal: support for atomic snapshot of all VM disks at once

2024-10-08 Thread Max Carrara
On Fri Oct 4, 2024 at 3:54 PM CEST, Ivaylo Markov wrote: > Greetings, > > I am the maintainer of StorPool’s external storage plugin for PVE[0] > which integrates our storage solution as a backend for VM disks. Our > software has the ability to create atomic (crash-consistent) snapshots > of a gr

Re: [pve-devel] [PATCH v2 pve-common 0/4] Section Config: Documentation & Code Cleanup

2024-09-16 Thread Max Carrara
On Tue Jul 2, 2024 at 4:13 PM CEST, Max Carrara wrote: > Section Config: Documentation & Code Cleanup - v2 > = Note for reviewers: This series will be superseded in the near future, so reviewing this isn't necessary at the momen

Re: [pve-devel] [PATCH proxmox-perl-rs 21/21] add PVE::RS::Firewall::SDN module

2024-08-13 Thread Max Carrara
On Wed Jun 26, 2024 at 2:15 PM CEST, Stefan Hanreich wrote: > Used for obtaining the IPSets that get autogenerated by the nftables > firewall. The returned configuration has the same format as the > pve-firewall uses internally, making it compatible with the existing > pve-firewall code. > > Signed

Re: [pve-devel] [PATCH pve-firewall 19/21] add support for loading sdn firewall configuration

2024-08-13 Thread Max Carrara
On Wed Jun 26, 2024 at 2:15 PM CEST, Stefan Hanreich wrote: > Signed-off-by: Stefan Hanreich > --- > src/PVE/Firewall.pm | 43 +-- > 1 file changed, 41 insertions(+), 2 deletions(-) > > diff --git a/src/PVE/Firewall.pm b/src/PVE/Firewall.pm > index 09544ba.

Re: [pve-devel] [PATCH proxmox-ve-rs 10/21] sdn: add ipam module

2024-08-13 Thread Max Carrara
On Wed Jun 26, 2024 at 2:15 PM CEST, Stefan Hanreich wrote: > This module includes structs for representing the JSON schema from the > PVE ipam. Those can be used to parse the current IPAM state. > > We also include a general Ipam struct, and provide a method for > converting the PVE IPAM to the ge

Re: [pve-devel] [PATCH proxmox-ve-rs 05/21] iprange: add methods for converting an ip range to cidrs

2024-08-13 Thread Max Carrara
On Wed Jun 26, 2024 at 2:15 PM CEST, Stefan Hanreich wrote: > This is mainly used in proxmox-perl-rs, so the generated ipsets can be > used in pve-firewall where only CIDRs are supported. > > Signed-off-by: Stefan Hanreich > --- > .../src/firewall/types/address.rs | 818 ++

Re: [pve-devel] [PATCH proxmox-ve-rs 02/21] firewall: add ip range types

2024-08-13 Thread Max Carrara
On Wed Jun 26, 2024 at 2:15 PM CEST, Stefan Hanreich wrote: > Currently we are using tuples to represent IP ranges which is > suboptimal. Validation logic and invariant checking needs to happen at > every site using the IP range rather than having a unified struct for > enforcing those invariants.

Re: [pve-devel] [PATCH proxmox-ve-rs 01/21] debian: add files for packaging

2024-08-13 Thread Max Carrara
On Wed Jun 26, 2024 at 2:15 PM CEST, Stefan Hanreich wrote: > Since we now have a standalone repository for Proxmox VE related > crates, add the required files for packaging the crates contained in > this repository. > > Signed-off-by: Stefan Hanreich > --- > .cargo/config.toml

Re: [pve-devel] [RFC firewall/proxmox{-ve-rs, -firewall, -perl-rs} 00/21] autogenerate ipsets for sdn objects

2024-08-13 Thread Max Carrara
m error types. As Gabriel mentioned, maybe the `thiserror` crate would come in handy eventually, but that's honestly your decision. There are a couple more comments inline, but they're rather minor, IMO. Slightly off-topic, but because you already mentioned off-list that you're work

[pve-devel] [PATCH v1 pve-common 18/18] deb: split PBSClient.pm into new package libproxmox-backup-client-perl

2024-08-02 Thread Max Carrara
.. and also add corresponding 'debian/*.install' files for 'libpve-common-perl' and the new package. Signed-off-by: Max Carrara --- Makefile | 1 + debian/control | 12 + debian/libproxmox-backup-clie

[pve-devel] [PATCH v1 pve-common 16/18] pbsclient: don't return anything in `forget_snapshot`

2024-08-02 Thread Max Carrara
ng is returned to make it more clear what the code does. Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index 4adb04c..aeceed3 100644 --- a/src/PVE/PBSClient.pm +++ b/sr

[pve-devel] [PATCH v1 pve-common 15/18] pbsclient: don't return anything in PXAR methods

2024-08-02 Thread Max Carrara
don't return anything in order to prevent returning something implicitly in the future (if e.g. `run_raw_client_cmd` is made to return something). Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PVE/PBSClient.pm

[pve-devel] [PATCH v1 pve-common 12/18] pbsclient: throw exception if username of client has no realm

2024-08-02 Thread Max Carrara
.. in order to catch that error earlier, rather than having `proxmox-backup-client` err and complain that the "repository value doesn't match the regex pattern". Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PVE/PBS

[pve-devel] [PATCH v1 pve-common 17/18] make: support building multiple packages from the same source

2024-08-02 Thread Max Carrara
This also makes sure that `lintian` actually lints any new packages. Signed-off-by: Max Carrara --- Makefile | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 637cd49..c2969aa 100644 --- a/Makefile +++ b/Makefile @@ -1,20

[pve-devel] [PATCH v1 pve-common 10/18] pbsclient: use `File::Spec->catfile` to concatenate file paths

2024-08-02 Thread Max Carrara
Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index 2084bb5..69b4e40 100644 --- a/src/PVE/PBSClient.pm +++ b/src/PVE/PBSClient.pm @@ -5,6 +5,7 @@ use

[pve-devel] [PATCH v1 pve-common 09/18] pbsclient: create secret dir with `mkdir -p` and mode `700`

2024-08-02 Thread Max Carrara
ctory permissions are left untouched if the directory existed already. Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index e0468d3..2084bb5 100644 --- a/src/PVE/PBSClie

[pve-devel] [PATCH v1 pve-common 08/18] pbsclient: document package and its public functions & methods

2024-08-02 Thread Max Carrara
This commit adds a brief overview for the `PVE::PBSClient` package and documents its public functions and methods. Examples are added where deemed appropriate. Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 526 +-- 1 file changed, 511 insertions

[pve-devel] [PATCH v1 pve-common 14/18] pbsclient: prohibit implicit return

2024-08-02 Thread Max Carrara
) was never depended on either, so prevent future code from doing so. Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index a701542..4ffdd04 100644 --- a/src/PVE/PBSClient.pm +++ b/src/PVE/PBSClie

[pve-devel] [PATCH v1 pve-common 06/18] pbsclient: use spaces around list braces and parens around ternaries

2024-08-02 Thread Max Carrara
Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index d707971..d3daf41 100644 --- a/src/PVE/PBSClient.pm +++ b/src/PVE/PBSClient.pm @@ -216,7 +216,7 @@ my sub

[pve-devel] [PATCH v1 pve-common 13/18] pbsclient: make method `password_file_name` public

2024-08-02 Thread Max Carrara
.. in order to allow users to only store a password if the password file doesn't exist yet, for example. Also adds corresponding documentation. Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sr

[pve-devel] [PATCH v1 pve-common 11/18] pbsclient: let `status` method return a hash instead of an array

2024-08-02 Thread Max Carrara
n our code base at the moment, so I assume it is safe to change it. Checked with ripgrep. Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 32 ++-- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm ind

[pve-devel] [PATCH v1 pve-common 05/18] pbsclient: use cond. statements instead of chained 'or' operators

2024-08-02 Thread Max Carrara
.. like in the `delete_encryption_key` subroutine below, as it's more readable at a glance. Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index ab1fa62..d707971 100644

[pve-devel] [PATCH v1 pve-common 04/18] pbsclient: pull variable out of long post-if definedness check

2024-08-02 Thread Max Carrara
Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index 525b37f..ab1fa62 100644 --- a/src/PVE/PBSClient.pm +++ b/src/PVE/PBSClient.pm @@ -288,7 +288,9 @@ sub backup_fs_tree

[pve-devel] [PATCH v1 pve-common 02/18] pbsclient: use parentheses when calling most inbuilts

2024-08-02 Thread Max Carrara
.. except for really common cases like `die`, `warn`, `keys`. Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 46 ++-- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index a1536e6..3e98dd1

[pve-devel] [PATCH v1 pve-common 07/18] pbsclient: s/foreach/for

2024-08-02 Thread Max Carrara
Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index d3daf41..231406a 100644 --- a/src/PVE/PBSClient.pm +++ b/src/PVE/PBSClient.pm @@ -348,7 +348,7 @@ sub prune_group

[pve-devel] [PATCH v1 pve-common 03/18] pbsclient: use post-if definedness checks instead of '//=' operator

2024-08-02 Thread Max Carrara
Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index 3e98dd1..525b37f 100644 --- a/src/PVE/PBSClient.pm +++ b/src/PVE/PBSClient.pm @@ -208,7 +208,7 @@ my sub run_client_cmd

[pve-devel] [PATCH v1 pve-common 01/18] pbsclient: rename 'sdir' parameter of constructor to 'secret_dir'

2024-08-02 Thread Max Carrara
.. so that it's less ambiguous for what the parameter stands for at a glance. Signed-off-by: Max Carrara --- src/PVE/PBSClient.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index e63af03..a1536e6 100644 --- a/sr

[pve-devel] [PATCH v1 pve-common 00/18] Introduction of libproxmox-backup-client-perl

2024-08-02 Thread Max Carrara
y comparing both `.deb` files via `dpkg -c` and running `dpkg -S /usr/share/perl5/PVE/PBSClient.pm` on my dev VM. References -- [1]: https://git.proxmox.com/?p=pve-storage.git;a=blob;f=src/PVE/Storage/PBSPlugin.pm;h=0808bccd79a75a6ace1c7194b30e894f5db54659;hb=refs/heads/master#l7

Re: [pve-devel] [RFC storage 10/23] plugin: introduce new_backup_provider() method

2024-07-26 Thread Max Carrara
On Fri Jul 26, 2024 at 11:52 AM CEST, Fiona Ebner wrote: > Am 25.07.24 um 17:32 schrieb Max Carrara: > > On Thu Jul 25, 2024 at 3:11 PM CEST, Fiona Ebner wrote: > >> Am 25.07.24 um 11:48 schrieb Max Carrara: > >>> The same goes for backup provider plugins - IMO n

Re: [pve-devel] [RFC storage 10/23] plugin: introduce new_backup_provider() method

2024-07-25 Thread Max Carrara
On Thu Jul 25, 2024 at 3:11 PM CEST, Fiona Ebner wrote: > Am 25.07.24 um 11:48 schrieb Max Carrara: > > On Tue Jul 23, 2024 at 11:56 AM CEST, Fiona Ebner wrote: > >> Signed-off-by: Fiona Ebner > > > > Some overall thoughts: > > > > 1. I'm re

Re: [pve-devel] [RFC storage 10/23] plugin: introduce new_backup_provider() method

2024-07-25 Thread Max Carrara
On Tue Jul 23, 2024 at 11:56 AM CEST, Fiona Ebner wrote: > The new_backup_provider() method can be used by storage plugins for > external backup providers. If the method returns a provider, Proxmox > VE will use callbacks to that provider for backups and restore instead > of using its usual backup/

[pve-devel] [PATCH v3 pve-manager 5/5] fix #5366: api: ceph: change version format in OSD metadata endpoint

2024-07-24 Thread Max Carrara
.. in order to include Ceph's build commit. Instead of e.g. 18.2.2 (reef) the string will now contain: 18.2.2 (build: e9fe820e7) reef This format is used in the OSD detail view; the build commit will therefore also be shown there. Signed-off-by: Max Carrara Fixes:

[pve-devel] [PATCH v3 pve-manager 4/5] ui: ceph: osd: increase width of version column

2024-07-24 Thread Max Carrara
.. so that the Ceph build commit as well as differing build commits are shown properly. Signed-off-by: Max Carrara --- Changes v2 --> v3: * increase the width even further to account for new changes Changes v1 --> v2: * NEW www/manager6/ceph/OSD.js | 1 + 1 file changed, 1 ins

[pve-devel] [PATCH v3 pve-manager 3/5] fix #5366: ui: ceph: osd: rework version field rendering

2024-07-24 Thread Max Carrara
the icon displayed for running an OSD with an outdated build is now the same as for running an outdated version. The conditional display of cluster health-related icons remains the same otherwise. Signed-off-by: Max Carrara Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=5366 --- Changes v2 -->

[pve-devel] [PATCH v3 pve-manager 2/5] fix #5366: api: ceph: add host build commit to Ceph OSD index data

2024-07-24 Thread Max Carrara
This is required in order to avoid making multiple API calls in the following commit. Signed-off-by: Max Carrara Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=5366 Tested-by: Lukas Wagner Reviewed-by: Lukas Wagner --- Changes v2 --> v3: * reword commit title * add 'Fixes&

[pve-devel] [PATCH v3 pve-manager 0/5] Fix #5366: Ceph Build Commit in UI

2024-07-24 Thread Max Carrara
References -- [1]: https://lists.proxmox.com/pipermail/pve-devel/2024-July/064789.html Summary of Changes -- Max Carrara (5): fix #5366: ui: ceph: services: parse and display build commit fix #5366: api: ceph: add host build commit to Ceph OSD index data fix #5366: ui

[pve-devel] [PATCH v3 pve-manager 1/5] fix #5366: ui: ceph: services: parse and display build commit

2024-07-24 Thread Max Carrara
used to determine how to render a service's current build commit and which accompanying icon to choose. Signed-off-by: Max Carrara Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=5366 --- Changes v2 --> v3: * add new `renderCephBuildCommit` helper function (thanks Thomas!)

Re: [pve-devel] [PATCH v2 pve-manager 06/10] ui: ceph: services: parse and display build commit

2024-07-22 Thread Max Carrara
On Mon Jul 22, 2024 at 5:38 PM CEST, Thomas Lamprecht wrote: > Am 01/07/2024 um 16:10 schrieb Max Carrara: > > This commit adds `PVE.Utils.parseCephBuildCommit`, which can be used > > to get the full hash "eccf199d..." in parentheses from a string like > > the fol

Re: [pve-devel] [pbs-devel] [PATCH manager v2 07/12] api: add routes for webhook notification endpoints

2024-07-22 Thread Max Carrara
On Mon Jul 22, 2024 at 9:37 AM CEST, Lukas Wagner wrote: > > > On 2024-07-17 17:36, Max Carrara wrote: > > On Fri Jul 12, 2024 at 1:27 PM CEST, Lukas Wagner wrote: > >> These just call the API implementation via the perl-rs bindings. > >> > >> Signed-off

Re: [pve-devel] [pbs-devel] [PATCH proxmox v2 01/12] notify: implement webhook targets

2024-07-22 Thread Max Carrara
On Mon Jul 22, 2024 at 9:30 AM CEST, Lukas Wagner wrote: > > > On 2024-07-17 17:35, Max Carrara wrote: > >> +let handlebars = setup_handlebars(); > >> +let body_template = > >> self.base_64_decode(self.config.body.as_deref().unwrap_or_defaul

Re: [pve-devel] [PATCH v2 pve-manager 00/10] Ceph Build Commit in UI

2024-07-21 Thread Max Carrara
warning that the currently running > version was outdated. > > Overall, from what I have tested, it works great! > > Tested-by: Igor Thaller Thanks a lot, appreciate it! > ____________ > Von: pve-devel im Auftrag von Max > Carrara > Gesend

Re: [pve-devel] [RFC pve-storage 01/36] plugin: base: remove old fixme comments

2024-07-18 Thread Max Carrara
On Wed Jul 17, 2024 at 6:02 PM CEST, Thomas Lamprecht wrote: > Am 17/07/2024 um 11:39 schrieb Max Carrara: > > These have been around since 2012 - suffice to say they're not needed > > anymore. > > That's really not a good argument though? Just because nobody che

Re: [pve-devel] [pbs-devel] [PATCH manager v2 07/12] api: add routes for webhook notification endpoints

2024-07-17 Thread Max Carrara
On Fri Jul 12, 2024 at 1:27 PM CEST, Lukas Wagner wrote: > These just call the API implementation via the perl-rs bindings. > > Signed-off-by: Lukas Wagner > --- > PVE/API2/Cluster/Notifications.pm | 263 +- > 1 file changed, 262 insertions(+), 1 deletion(-) > > diff -

Re: [pve-devel] [pbs-devel] [PATCH proxmox-perl-rs v2 04/12] common: notify: add bindings for get_targets

2024-07-17 Thread Max Carrara
And missed `cargo fmt` here too ;) On Fri Jul 12, 2024 at 1:27 PM CEST, Lukas Wagner wrote: > This allows us to drop the impl of that function on the perl side. > > Signed-off-by: Lukas Wagner > --- > common/src/notify.rs | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/common/s

Re: [pve-devel] [PATCH proxmox-perl-rs v2 03/12] common: notify: add bindings for webhook API routes

2024-07-17 Thread Max Carrara
Missed a `cargo fmt` here as well ;) On Fri Jul 12, 2024 at 1:27 PM CEST, Lukas Wagner wrote: > Signed-off-by: Lukas Wagner > --- > common/src/notify.rs | 63 > 1 file changed, 63 insertions(+) > > diff --git a/common/src/notify.rs b/common/src/notify

Re: [pve-devel] [PATCH proxmox v2 02/12] notify: add api for webhook targets

2024-07-17 Thread Max Carrara
On Fri Jul 12, 2024 at 1:27 PM CEST, Lukas Wagner wrote: > All in all pretty similar to other endpoint APIs. > One thing worth noting is how secrets are handled. We never ever > return the values of previously stored secrets in get_endpoint(s) > calls, but only a list of the names of all secrets. T

Re: [pve-devel] [RFC many v2 00/12] notifications: add support for webhook endpoints

2024-07-17 Thread Max Carrara
On Fri Jul 12, 2024 at 1:27 PM CEST, Lukas Wagner wrote: > Sending as an RFC because I don't want this merged yet; that being > said, the feature should be mostly finished at this point, I'd > appreciate any reviews and feedback. > > This series adds support for webhook notification targets to PVE

Re: [pve-devel] [pbs-devel] [PATCH proxmox v2 01/12] notify: implement webhook targets

2024-07-17 Thread Max Carrara
On Fri Jul 12, 2024 at 1:27 PM CEST, Lukas Wagner wrote: > This target type allows users to perform HTTP requests to arbitrary > third party (notification) services, for instance > ntfy.sh/Discord/Slack. > > The configuration for these endpoints allows one to freely configure > the URL, HTTP Method

[pve-devel] [RFC pve-storage 36/36] plugin: zfspool: refactor method `zfs_request` into helper subroutine

2024-07-17 Thread Max Carrara
. The new helper sub is also documented and given a prototype. The original method is changed to wrap the new helper and also emit a deprecation warning when used. The sites where the original method is called are updated to use the helper subroutine instead. Signed-off-by: Max Carrara --- src/PVE

  1   2   3   4   >