Commit Graph

3072 Commits

Author SHA1 Message Date
Wolfgang Bumiller
7e25958623 tfa: bump to 5.0.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:43:41 +01:00
Wolfgang Bumiller
40f0a0bdd3 subscription: bump to 0.5.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:42:10 +01:00
Wolfgang Bumiller
c84376e2c8 apt: bump to 0.11.7-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:40:14 +01:00
Wolfgang Bumiller
5382b8ce13 apt-api-types: bump to 1.0.3-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:38:33 +01:00
Wolfgang Bumiller
ca92328569 api-macro: bump to 1.3.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:36:57 +01:00
Wolfgang Bumiller
59d1ca87e5 rrd: bump to 0.4.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:36:56 +01:00
Wolfgang Bumiller
106aa95ced rest-server: bump to 0.8.6-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:35:43 +01:00
Wolfgang Bumiller
698b6782cd router: bump to 3.0.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:35:43 +01:00
Wolfgang Bumiller
69298c8d20 acme: bump to 0.5.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:28:06 +01:00
Wolfgang Bumiller
ed74a6a8a2 simple-config: bump to 0.1.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:26:42 +01:00
Wolfgang Bumiller
2782c72747 config-digest: bump to 0.1.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:25:33 +01:00
Wolfgang Bumiller
94b9f8db60 notify: bump to 0.5.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:25:31 +01:00
Wolfgang Bumiller
f2fefb7ffd section-config: bump to 2.1.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:20:00 +01:00
Wolfgang Bumiller
c7f4afb3fc human-byte: bump to 0.1.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:20:00 +01:00
Wolfgang Bumiller
e4f5179ae6 schema: bump to 4.0.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 12:07:49 +01:00
Wolfgang Bumiller
2e2edcf833 schema: add Schema::unwrap_*_schema_cloned
This way we can copy and modify a schema.

Eg. via the following ways:

    const FOO_SCHEMA: Schema = SOME_SCHEMA
        .unwrap_integer_schema_cloned()
        .description("Foo")
        .schema();

Note that for example there is currently no builder to set a
`default_key` for an `ObjectSchema` back to None, so one could do:

    const FOO_SCHEMA: Schema = const {
        let mut schema = SOME_SCHEMA.unwrap_object_schema_cloned();
        schema.default_key = None;
        schema.schema()
    };

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 11:56:57 +01:00
Wolfgang Bumiller
c040054827 schema: add 'description' builder methods to schema types
To cover the use case where we want to change only the description of
an existing type.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 11:07:08 +01:00
Wolfgang Bumiller
72c95c35bb schema: make schema types #[non_exhaustive]
This way extending them is not a breaking change anymore.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 10:56:58 +01:00
Wolfgang Bumiller
c794c42919 schema: drop deprecated code
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 10:56:58 +01:00
Wolfgang Bumiller
8d9cf97611 schema: doc: replace use of deprecated methods
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 10:56:58 +01:00
Wolfgang Bumiller
dc232f8bd4 schema: support PVE's "keyAlias" legacy property strings
Because the UI kept producing them...
And still does...

This is NOT meant to be used by anything other than generated legacy
code for PDM (pve-api-types) and only affects the serde based
deserializer. The "old" `schema.parse_property_string() -> Value`
method does not utilize this for now.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 10:56:58 +01:00
Wolfgang Bumiller
4378d44bcb notify: use builder for ObjectSchema
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-15 10:56:58 +01:00
Wolfgang Bumiller
3c34ef5573 section-config: use builder pattern for ObjectSchema
To prepare for a breaking change in proxmox-schema.
Since new fields in the schema constitute a breaking change, using the
builder methods will let this compile later as well.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-14 11:48:52 +01:00
Wolfgang Bumiller
c99a31c66f router: test: sort object schema properties
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-14 10:34:29 +01:00
Dominik Csapak
be57fb0122 schema: updater: add blanked implementation for PropertyString
so that we can have a property:

```
foo: Option<PropertyString<Bar>>,
```

within a struct that derives `Updater`

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2025-01-14 10:19:54 +01:00
Wolfgang Bumiller
8c5fa1c562 schema: fix pointer/length confusion in str_slice_to_range
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-13 15:22:40 +01:00
Wolfgang Bumiller
62e105a34e api-macro: bump to 1.3.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-09 14:21:53 +01:00
Wolfgang Bumiller
dce9102163 api-macro: add json_schema!() macro
This allows using the json schema notation to generate `Schema`
expressions.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-09 14:19:42 +01:00
Wolfgang Bumiller
619c290cf8 client: bump to 0.5.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-09 14:16:03 +01:00
Dietmar Maurer
b31ab119bb client: improve api error message (avoid duplicate status code)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2025-01-09 12:02:28 +01:00
Wolfgang Bumiller
ddc154e5cd notify: add missing tracing::error macro import
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-07 10:20:37 +01:00
Thomas Lamprecht
b74391cada daemon: bump version to 0.1.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-30 15:34:16 +01:00
Thomas Lamprecht
1db49cb269 daemon: try to remove existing unix socket in bind directly
We tried this unconditionally on start-up in the PDM for the priv. API
daemon, but we actually only want to clean-up on fresh bind, not on
restoring the FD on daemon reload. Otherwise the unprivileged daemon
cannot connect to the privileged one anymore after the latter got
reloaded.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-30 15:30:10 +01:00
Thomas Lamprecht
7648aabf42 daemon: output debug log when restoring FD passed through env
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-30 15:29:34 +01:00
Thomas Lamprecht
cc4ee60452 apt: bump version to 0.11.6-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-19 12:46:05 +01:00
Thomas Lamprecht
aba50ebc38 apt: bump version to 0.11.6-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-19 12:42:45 +01:00
Thomas Lamprecht
942186e2b7 apt: pdm uses separator for test repo
For consistency with it's other repositories, we might migrate other
products also to this schema with a future major release (and nginx
rewrite config for backward compatibility)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-19 12:40:26 +01:00
Gabriel Goller
df6b705f56 notify: migrate from log to tracing
Migrated from `log` to `tracing`. Imported `tracing` only as it has a
smaller footprint (and less dependencies) than `proxmox_log`.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
2024-12-05 13:22:24 +01:00
Thomas Lamprecht
212249e009 sys: bump version to 0.6.5-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-05 08:32:47 +01:00
Thomas Lamprecht
87dd908530 client: run cargo fmt
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-05 08:32:47 +01:00
Shannon Sterz
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
Shannon Sterz
115adf42bd acme-api: use inner mutability for ACME_ACME_CONFIG
in edition 2024 references to mutable static will be disallowed [1]. the
recommended way around this is to use types with inner mutability. so
use a `OnceLock` for `ACME_ACME_CONFIG` as the directoryfor ACME
configuration purposes shouldn't 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:53:51 +01:00
Maximiliano Sandoval
b256ee391c apt: repositories: remove unnecessary if-let in iterator
Fixes the manual_flatten clippy lint:

```
warning: unnecessary `if let` since only the `Some` variant of the iterator element is used
  --> proxmox-apt/src/repositories/mod.rs:40:5
   |
40 |       for digest in digests.values() {
   |       ^             ---------------- help: try: `digests.values().copied().flatten()`
   |  _____|
   | |
41 | |         if let Some(digest) = digest {
42 | |             common_raw.extend_from_slice(&digest[..]);
43 | |         }
44 | |     }
   | |_____^
   |
help: ...and remove the `if let` statement in the for loop
  --> proxmox-apt/src/repositories/mod.rs:41:9
   |
41 | /         if let Some(digest) = digest {
42 | |             common_raw.extend_from_slice(&digest[..]);
43 | |         }
   | |_________^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
   = note: `#[warn(clippy::manual_flatten)]` on by default
```

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
FG: use `into_values().flatten()` instead of `values().copied().flatten()
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-12-03 13:50:23 +01:00
Maximiliano Sandoval
34c66e1542 sys: systemd: remove empty line after outer attribute
Fixes the clippy lint:

```
warning: empty line after outer attribute
 --> proxmox-sys/src/systemd.rs:7:1
  |
7 | / #[allow(clippy::manual_range_contains)]
8 | |
  | |_
9 |   fn parse_hex_digit(d: u8) -> Result<u8, Error> {
  |   ---------------------------------------------- the attribute applies to this function
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr
  = note: `#[warn(clippy::empty_line_after_outer_attr)]` on by default
  = help: if the empty line is unintentional remove it
```

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-12-03 13:44:05 +01:00
Maximiliano Sandoval
c8d49a7d38 docs: remove empty lines in docs
Fixes the clippy lints:

```
warning: empty line after doc comment
  --> proxmox-lang/src/lib.rs:33:1
   |
33 | / /// ```
34 | |
   | |_
35 |   #[macro_export]
36 |   macro_rules! try_block {
   |   ---------------------- the comment documents this macro
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
   = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default
   = help: if the empty line is unintentional remove it

warning: empty line after doc comment
   --> proxmox-router/src/cli/mod.rs:308:5
    |
308 | /     /// Can be used multiple times.
309 | |
    | |_
310 |       /// Finish the command line interface.
311 |       pub fn build(self) -> CommandLineInterface {
    |       ------------------------------------------ the comment documents this method
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
    = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default
    = help: if the empty line is unintentional remove it
help: if the documentation should include the empty line include it in the comment
    |
309 |     ///
    |
```

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-12-03 13:44:05 +01:00
Maximiliano Sandoval
3f62a4dacf remove unnecessary return statement
Fixes the clippy lint:

```
warning: unneeded `return` statement
  --> proxmox-time/src/week_days.rs:31:14
   |
31 |         _ => return Err(parse_error(text, "weekday")),
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
   = note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
   |
31 |         _ => Err(parse_error(text, "weekday")),
   |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-12-03 13:44:05 +01:00
Maximiliano Sandoval
3492a0cee5 elide lifetimes where possible
This is possible on newer rustc.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-12-03 13:44:05 +01:00
Maximiliano Sandoval
4cb3579786 router: parsing: docs: fix 'instead' typo
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-12-03 13:44:05 +01:00
Maximiliano Sandoval
10b15fb2ad router: parsing: docs: fix Records::from link
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-12-03 13:44:05 +01:00
Maximiliano Sandoval
1b5e8ee0dd apt: repositories: use if-let instead of match for Option
Fixes the single_match clippy lint:

```
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
  --> proxmox-apt/src/repositories/mod.rs:41:9
   |
41 | /         match digest {
42 | |             Some(digest) => common_raw.extend_from_slice(&digest[..]),
43 | |             None => (),
44 | |         }
   | |_________^ help: try: `if let Some(digest) = digest { common_raw.extend_from_slice(&digest[..]) }`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
   = note: `#[warn(clippy::single_match)]` on by default
```

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-12-03 13:44:05 +01:00