31 Commits

Author SHA1 Message Date
0dcc45957c proxmox-product-config: fix code documentation on permissions
This patch fixes the documentation of some functions being
inconsistent with the actual code. While such inconsistencies are
never good, when it comes to permissions, they might have even worse
consequences.

To be precise, this patch fixes the following:
- replace_config() actually uses permissions 0640 (docs stated 0660)
- although the possibility of setting a privileged user (usually root,
but possibly different) has been added in the past, the docs still
stated "root" or "superuser". However, some functions also explicitly
use "root", which made it even more confusing. It is now clear which
functions use the API user, which use the privileged user, and which
explicitly use root.
- fixed some small style inconsistencies (e.g. priv-user instead
of priv_user)

Signed-off-by: Laurențiu Leahu-Vlăducu <l.leahu-vladucu@proxmox.com>
Link: https://lore.proxmox.com/20250507153639.46774-1-l.leahu-vladucu@proxmox.com
2025-08-05 18:42:50 +02:00
b899e71e6f product-config: fix docstring for priv user getter
Noticed during unrelated code review.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250731084031.168898-1-c.ebner@proxmox.com
2025-07-31 12:12:16 +02:00
d42d5038bc product-config: bump version to 1.0.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-05-21 15:08:02 +02:00
f522950cdd product-config: update to newer nix, proxmox-sys crates from workspace
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-05-21 15:06:20 +02:00
8eae5a8330 product-config: use inner mutability for PRODUCT_CONFIG
with edition 2024 `static mut` references will be disallowed [1]. the
recommended way to work around this is to use inner mutability, so use a
`OnceLock` for the `PRODUCT_CONFIG` as that should not change throughout
the run time of an application.

[1]:
https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-12-04 09:54:12 +01:00
f4868ff519 tree-wide: check in d/control meta changes for newer debcargo
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-26 14:44:33 +01:00
d6e86d670b tree-wide: unify workspace inherited attributes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-20 08:42:45 +02:00
9ae3df424e product-config: bump to 0.2.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-14 12:00:02 +02:00
c33cc9e350 product-config: remove unused dependencies
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-08-14 11:38:48 +02:00
254a37ae07 fix typos in code documentation
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-07-22 08:49:42 +02:00
68125e67fc product-config: bump to 0.2.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-11 15:11:39 +02:00
0652d81977 tree-wide: enable doc_cfg and doc_auto_cfg for docs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-02 11:59:53 +02:00
e2cd917394 product-config: bump to 0.2.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-19 12:07:37 +02:00
b25edb67de sys: use anyhow Error type for create_dir, and improve error messages
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-06-13 11:51:44 +02:00
c12bbf6241 product-config: add open_secret_lockfile
We need this for things like shadow.json.lock.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-13 11:14:36 +02:00
1a0b39710c product-config: bump to 0.1.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-05 11:27:16 +02:00
cb971b402f product-config: new create_secret_dir function
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-06-04 12:53:41 +02:00
6c30be2280 product-config: code cleanup
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-06-04 12:53:18 +02:00
2270f7bf94 product_config: introduce priviledged user.
Normally root, but can be the same as the api_user if the product
does not use priviledge separation.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-06-04 11:14:07 +02:00
0033f67e37 product-config: export get_api_user
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-06-04 11:02:23 +02:00
3de2812254 product-config: add debian control file
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-06-03 09:14:14 +02:00
e913330e09 product-config: simplify by removing the configuration directory
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-31 11:29:59 +02:00
4768ad2200 product-config: remove digest implementation (move to proxmox-config-digest crate)
And use the new proxmox-config-digest crate instead.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-29 18:41:28 +02:00
06d25870ed product-config: remove functions to check permissions, which are now in proxmox-sys.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-29 10:22:05 +02:00
237f6218b0 product-config: factor out methods to create different file creation options
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-29 07:47:17 +02:00
7cd240bbad product-config: use Path instead of str everywhere
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-29 06:52:04 +02:00
96a3656dd2 product-config: add feature "impl"
So the we can use the ConfigDigest with our UI crates.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-06 13:40:32 +02:00
53ee3f92ea product-config: add method to detect config digest modifications.
Using an object method with strong typing is considered cleaner.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-06 13:01:36 +02:00
03b4aed510 product-config: add debian packaging
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-03 09:29:46 +02:00
e64575b6a7 product-config: add rust API type for configuration digest
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-02 12:28:11 +02:00
9fc48d96d2 new crate for commonly used functions to read and write configuration files
Factor out functions to read and write configuration files with
product specific permissions.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-02 11:17:27 +02:00