Commit Graph

2855 Commits

Author SHA1 Message Date
Maximiliano Sandoval
c8352531e4 serde: docs: escape html tags
Fixes the cargo docs warning:

warning: unclosed HTML tag `u8`
  --> proxmox-serde/src/lib.rs:55:18
   |
55 | /// Serialize Vec<u8> as base64 encoded string.
   |                  ^^^^
   |
   = note: `#[warn(rustdoc::invalid_html_tags)]` on by default
help: try marking as source code
   |
55 | /// Serialize `Vec<u8>` as base64 encoded string.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
2024-08-07 20:58:04 +02:00
Maximiliano Sandoval
2794c137d5 login: docs: fix typo and add escape html tags
Fixes the cargo docs warning:

warning: unclosed HTML tag `username`
  --> proxmox-login/src/api.rs:35:47
   |
35 |     /// realm is simply added to the username <username>@<relam>.
   |                                               ^^^^^^^^^^
   |
   = note: `#[warn(rustdoc::invalid_html_tags)]` on by default

warning: unclosed HTML tag `relam`
  --> proxmox-login/src/api.rs:35:58
   |
35 |     /// realm is simply added to the username <username>@<relam>.
   |                                                          ^^^^^^^

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
2024-08-07 20:58:04 +02:00
Maximiliano Sandoval
f80cb33993 ldap: docs: turn uri into link
Fixes the following cargo doc warning:

warning: this URL is not a hyperlink
   --> proxmox-ldap/src/lib.rs:199:9
    |
199 |     /// https://www.rfc-editor.org/rfc/rfc4512#section-5.1
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://www.rfc-editor.org/rfc/rfc4512#section-5.1>`
    |
    = note: bare URLs are not automatically turned into clickable links
    = note: `#[warn(rustdoc::bare_urls)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
2024-08-07 20:58:04 +02:00
Maximiliano Sandoval
0c889ff2da client: docs: remove redundant link
Fixes the cargo doc warnings:

warning: redundant explicit link target
 --> proxmox-http/src/client/mod.rs:4:19
  |
4 | //! in [`Client`](crate::client::Client).
  |         --------  ^^^^^^^^^^^^^^^^^^^^^ explicit target is redundant
  |         |
  |         because label contains path that resolves to same destination
  |
  = note: when a link's destination is not specified,
          the label is used to resolve intra-doc links
  = note: `#[warn(rustdoc::redundant_explicit_links)]` on by default
help: remove explicit link target
  |
4 | //! in [`Client`].
  |        ~~~~~~~~~~

warning: redundant explicit link target
 --> proxmox-http/src/client/mod.rs:7:22
  |
7 | //! [`sync::Client`](crate::client::sync::Client).
  |      --------------  ^^^^^^^^^^^^^^^^^^^^^^^^^^^ explicit target is redundant
  |      |
  |      because label contains path that resolves to same destination
  |
  = note: when a link's destination is not specified,
          the label is used to resolve intra-doc links
help: remove explicit link target
  |
7 | //! [`sync::Client`].
  |     ~~~~~~~~~~~~~~~~

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
2024-08-07 20:58:04 +02:00
Maximiliano Sandoval
fe7f37e9b3 property_string: clippy: define bound once
Fixes the clippy lint:

warning: bound is defined in more than one place
   --> proxmox-schema/src/property_string.rs:352:14
    |
352 | pub fn parse<T: ApiType>(value: &str) -> Result<T, Error>
    |              ^
353 | where
354 |     T: for<'de> Deserialize<'de>,
    |     ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations
    = note: `#[warn(clippy::multiple_bound_locations)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
2024-08-07 20:58:04 +02:00
Maximiliano Sandoval
77fe0f6954 docs: clippy: add indentation to doc list items
Fixes the clippy warning:

warning: doc list item missing indentation
   --> proxmox-subscription/src/subscription_info.rs:179:9
    |
179 |     ///  (this mode is used to decide whether to refresh the subscription information)
    |         ^
    |
    = help: if this is supposed to be its own paragraph, add a blank line
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
    = note: `#[warn(clippy::doc_lazy_continuation)]` on by default
help: indent this line
    |
179 |     ///   (this mode is used to decide whether to refresh the subscription information)
    |          +

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
2024-08-07 20:58:04 +02:00
Maximiliano Sandoval
7052972212 apt: clippy: don't clone types implementing Copy
Fixes the clippy warnings:

warning: `proxmox-apt` (lib) generated 1 warning
warning: using `clone` on type `Option<[u8; 32]>` which implements the `Copy` trait
   --> proxmox-apt/tests/repositories.rs:117:22
    |
117 |     let old_digest = file.digest.clone().unwrap();
    |                      ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `file.digest`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
    = note: `#[warn(clippy::clone_on_copy)]` on by default

warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait
   --> proxmox-apt/tests/repositories.rs:135:24
    |
135 |     file.digest = Some(old_digest.clone());
    |                        ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `old_digest`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
2024-08-07 20:58:04 +02:00
Wolfgang Bumiller
c3713cffe5 api-macro: fix warnings in tests
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-06 14:23:38 +02:00
Wolfgang Bumiller
a7ab26a9d8 http-error: fix a warning in tests
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-06 14:22:25 +02:00
Wolfgang Bumiller
15c64a5d00 api-macro: bump to 1.1.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-06 14:15:57 +02:00
Wolfgang Bumiller
451d3b0adf section-config: bump to 2.1.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-06 14:15:34 +02:00
Wolfgang Bumiller
839f508f55 api-macro: type-key support for derived enums
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-06 14:14:42 +02:00
Wolfgang Bumiller
4a154b3cb5 section-config: support a type_key property
For when the underlying datatype is supposed to contain the type
property and the schema does not mark it as optional.

The use case here is to support flat `Remote` type where the "type" of
pve/pmg/pbs is a property which is present in the `Remote` struct
while being derived from the section type.

This will implicitly include and strip the type of the json object
after/before de/serializing.

Alternatives would be
- to mark the type as optional and just fill it out later when loading
  the data, but that is technically wrong...
- have a 2nd version of the struct with the type field removed and
  From/Into implemented, but that's even more unwieldy.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-06 14:14:42 +02:00
Wolfgang Bumiller
4d96aa52d2 section-config, api-macro: add SectionConfig enum support
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-06 14:14:42 +02:00
Wolfgang Bumiller
51d78fdd2b api-macro: handle renames in updater derive
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-06 14:14:42 +02:00
Wolfgang Bumiller
4c37db22d2 sys: bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-06 14:14:33 +02:00
Wolfgang Bumiller
1cb2bf85ba sys: bump to 0.6.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-06 13:50:57 +02:00
Fabian Grünbichler
d0dab46539 sys: make fd::cwd crate-internal
it's not used by anything outside of proxmox-sys.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-08-06 13:37:36 +02:00
Fabian Grünbichler
dc0b9dec4a sys: adapt to IO Safety changes in rustc
`OwnedFd`s are now (rustc 1.80+) checked for validity when dropped in a debug
build, to catch usage after closing. Unfortunately those checks don't account
for the special value `AT_FDCWD` (-100) which is not a "real" FD, but a magic
constant used by many libc functions to signify operations starting at the
current working directory.

changing our `cwd` helper to open the CWD for real, instead of just returning
the magic value that pretends to be an FD, works around those limitations with
the least API churn.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-08-06 13:37:34 +02:00
Wolfgang Bumiller
9d921901d3 rest-server: update examples code to daemon split
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-01 10:27:44 +02:00
Wolfgang Bumiller
bedbaae252 router: bump to 2.2.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-31 10:08:25 +02:00
Wolfgang Bumiller
65715bc096 io, serde, schema: doc fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-30 16:16:16 +02:00
Wolfgang Bumiller
ffd45c642f http: replace deprecated io_err_other
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-30 16:11:44 +02:00
Wolfgang Bumiller
482fd62423 io: drop the valgrind support code
valgrind-request is currently not packaged and we haven't used this in
a while...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-30 16:09:09 +02:00
Fabian Grünbichler
a44fda92ef bump proxmox-log to 0.2.1-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-07-29 09:27:18 +02:00
Wolfgang Bumiller
7c403de278 lang: d/control bump
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-26 13:23:53 +02:00
Wolfgang Bumiller
a7ba12d0b8 lang: bump to 1.4.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-26 13:13:29 +02:00
Wolfgang Bumiller
e3a5ff78f4 async, sys: replace deprecated io_err_other
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-26 13:09:33 +02:00
Wolfgang Bumiller
ce0b21805c lang: deprecate io_err_other
For regular error cases, `std::io::Error` can now also box errors and
provides an `Error::other()` function since rust 1.74.

For the case where it was used directly with strings
(io_err_other("string")) -> that's what `io_format_err!()` and
`io_bail!()` are for.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-26 12:14:03 +02:00
Wolfgang Bumiller
ea3c37fd36 sys: drop unused import
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-26 12:14:03 +02:00
Wolfgang Bumiller
034bb9cdda router: cli: add OutputFormat enum api type
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-26 11:46:33 +02:00
Wolfgang Bumiller
dd36fec23d sys: replace CStr::from_bytes_... with c"literals"
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-26 11:46:33 +02:00
Maximiliano Sandoval
ba304a4f83 compression: make Deflate{De, En}coderBuilder public
These structs are returned by the public method
`Deflate{En,De}coder::builder`.

Reported-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-07-26 11:43:01 +02:00
Wolfgang Bumiller
2598699fcb daemon: remove useless comment
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 16:30:14 +02:00
Wolfgang Bumiller
35372b5337 daemon: boxed FnOnce has been usable for a while
While technically an API break, we don't use the public API for this
anywhere and the trait we're changing is explicitly marked as
`#[doc(hidden)]`.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 16:27:32 +02:00
Wolfgang Bumiller
4502bc3b73 acme-api: bump to 0.1.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 14:33:36 +02:00
Wolfgang Bumiller
150f203209 auth-api: bump to 0.4.4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 14:32:28 +02:00
Wolfgang Bumiller
15200b9f64 rest-server: bump to 0.7.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 14:32:01 +02:00
Wolfgang Bumiller
921d2bcc13 daemon: bump to 0.1.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 14:29:06 +02:00
Wolfgang Bumiller
f67c651929 systemd: bump to 0.1.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 14:29:06 +02:00
Wolfgang Bumiller
b54b4d3324 log: bump to 0.2.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 14:29:06 +02:00
Wolfgang Bumiller
d3abd366c4 introduce proxmox-daemon crate
split from rest-server:
- "state" module (shutdown/reload state)
- shutdown futures
- "daemon" module (named 'server' module in proxmox-daemon)
- command socket

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 14:25:50 +02:00
Wolfgang Bumiller
fb1a75d48f systemd: add fd-store support
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 14:25:50 +02:00
Wolfgang Bumiller
2783f062a6 update rest-server to use proxmox-systemd crate
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 14:25:50 +02:00
Wolfgang Bumiller
ab41d326e4 introduce proxmox-systemd crate
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 14:25:50 +02:00
Gabriel Goller
cecd08df58 log: remove unused init_logger argument
The `_application_name` argument is not used anymore. It was previously
used to set the correct journald unit-name, which is now handled
automatically.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-07-24 14:25:50 +02:00
Wolfgang Bumiller
a38b46b27d rest-server: drop proxmox-io dependency
Used only for read/writing a pid_t (an integer) to a socket.
The standard to_ne_bytes()/from_ne_bytes() should be sufficient here,
we already have libc::pid_t which we can use to get the correct type
namespace for accessing ::from_ne_bytes().

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 14:06:40 +02:00
Wolfgang Bumiller
c0e5776edd log: fix filter condition for journal layer
The condition was inverted, it would only send to the journal for
worker tasks.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-24 14:05:51 +02:00
Wolfgang Bumiller
f2130b69c8 router: bump to 2.2.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-22 09:07:22 +02:00
Wolfgang Bumiller
45a1e580c8 access-control: bump to 0.2.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-22 09:05:28 +02:00