Commit Graph

2935 Commits

Author SHA1 Message Date
Wolfgang Bumiller
532d4d3e9a login: bump to 0.1.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-26 14:51:53 +02:00
Wolfgang Bumiller
2b3c356ece api-macro: allow declaring an additional-properties field
Object schemas can now declare a field which causes
'additional_properties' to be set to true and the field being ignored
in the schema.

This allows adding a flattened HashMap<String, Value> to gather the
additional unspecified properties.

    #[api(additional_properties: "rest")]
    struct Something {
        #[serde(flatten)]
        rest: HashMap<String, Value>,
    }

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-26 12:47:58 +02:00
Wolfgang Bumiller
e72528ca70 login: add 'raw' webauthn challenge access
So we can get going on the wasm side where we don't yet have access to
the webauthn-rs crate.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-26 12:40:32 +02:00
Wolfgang Bumiller
c85b534837 readme: update cargo config path
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-20 08:44:19 +02:00
Wolfgang Bumiller
005678cec2 buildsys: add a 'make list-packages' target
To ease development on new machines, this provides an easy way to just
do

    # apt install $(make list-packages)

to get started.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-20 08:43:08 +02:00
Wolfgang Bumiller
d6e86d670b tree-wide: unify workspace inherited attributes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-20 08:42:45 +02:00
Wolfgang Bumiller
6e8ad21227 rrd-api-types: bump to 1.0.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-19 15:17:08 +02:00
Wolfgang Bumiller
9ed8f7f110 rrd-api-types: follor acronym capitalization guidelines
Link: https://rust-lang.github.io/api-guidelines/naming.html
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-19 15:13:26 +02:00
Wolfgang Bumiller
111a883788 rrd-api-types: bump to 1.0.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-19 14:59:08 +02:00
Wolfgang Bumiller
4f787391de rrd-api-types: make mode and timeframe +Eq+PartialEq+Debug
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-19 14:55:51 +02:00
Wolfgang Bumiller
b38568158a sys: bump to 0.6.4-1
This should also fix a build issue on aarch64 caused by a signed-ness
differences of c_char.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-19 09:07:01 +02:00
Wolfgang Bumiller
fb8a706066 rrd-api-types: check in d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-19 09:06:55 +02:00
Wolfgang Bumiller
8f3eecab68 rrd-api-types: bump to 1.0.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-18 16:05:21 +02:00
Wolfgang Bumiller
3cf67472a1 rrd: bump to 0.4.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-18 16:05:21 +02:00
Wolfgang Bumiller
0177b1d975 add proxmox-rrd-api-types crate - moved out of proxmox-rrd
so we can access them from wasm without pulling in proxmox-rrd as it
also pulls in sys...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-18 15:55:43 +02:00
Wolfgang Bumiller
e57a65879e rrd: bump to 0.3.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-18 15:24:16 +02:00
Lukas Wagner
9426af0abf rrd: derive Display and FromStr for api types
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2024-09-18 15:21:58 +02:00
Wolfgang Bumiller
fda2cdb7ed log: bump to 0.2.5-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-16 15:12:11 +02:00
Gabriel Goller
5d33d870ee log: print error if env-var parsing failed, print correct name
Print error if the parsing of the env-var fails on the proxmox-backup-*
daemons as well. Output correct env-var on binaries that use different
variables.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-09-16 15:08:41 +02:00
Gabriel Goller
c9c9ade96e log: fallback to stderr if syslog not available
Don't panic when the syslog is not available - which happens commonly in
containers and sbuild environments (chroot and unshare) - instead
fallback to stderr.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
2024-09-16 15:07:43 +02:00
Wolfgang Bumiller
c6fd5604df access-control: bump to 0.2.3-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:25:49 +02:00
Wolfgang Bumiller
80503e409d buildsys: add targets for raw installation and sysexts
The following targets should be self-explanatory:

    # make install
    $ make DESTDIR=$SOME_PATH install
    # make proxmox-sys-install
    $ make DESTDIR=$SOME_PATH proxmox-sys-install
    # make proxmox-<any other crate name>-install

Additionally, these are used as building blocks to create
systemd-sysext(8) images:

    $ make proxmox-sys-sysext

builds an `extensions/proxmox-sys.raw`

This can be copied/symlinked to `/run/extensions/` and then activated.
As root:

    # ln -s $REPO_DIR/extensions/proxmox-sys.raw /run/extensions/
    # systemd-systext refresh

For the complete workspace, an `extensions/proxmox-workspace.raw` can
be built via

    $ make sysext

This also takes a `CRATES` var to limit the crates which should be
included, and takes an optional `NOCLEAN=1` which prevents cleaning
out the previously installed to "add" new crates on the go:
Assuming there's a symlink like:

    # ln -s $REPO_DIR/extensions/proxmox-workspace.raw /run/extensions/proxmox-workspace.raw

One can modify the installed crates like this:

    $ make CRATES=proxmox-sys sysext
    $ sudo systemd-sysext refresh

Now only the current proxmox-sys crate is overridden.

    $ make NOCLEAN=1 CRATES=proxmox-time sysext
    $ sudo systemd-sysext refresh

Now proxmox-sys as well as proxmox-time are installed.

To undo the changes, either just do, as root:

    # systemd-sysext unmerge

or remove the files which should specifically be dropped from
/run/extensions/ and run as root:

    # systemd-sysext refresh

Another way to temporarily install single crates is to just have the
extensions/ folder *be* the `/run/extensions` folder:

    # rmdir /run/extensions
    # ln -s $REPO_DIR/extensions /run/extensions

Then just build individual extensions:

    $ make proxmox-sys-sysext
    $ sudo systemd-sysext refresh
    $ make proxmox-router-sysext
    $ sudo systemd-sysext refresh

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
3d812952bc auth-api: bump to 0.4.6
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
420285ea8c acme-api: bump to 0.1.6-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
b1ddac7c45 client: bump to 0.5.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
61e4d35dea schema: bump to 3.2.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
dfc4e5f866 api-macro: bump to 1.2.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
ddbada0668 rest-server: bump to 0.8.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
98ed1bb28b router: bump to 3.0.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
d469463904 compression: bump to 0.2.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
3d6b3c4786 router: split streaming reader impl into 'stream' feature
so 'no-default-features' compiles again

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
2a4cf83799 rest-server: utilize flush_window for streams
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
78c29b33ef compression: add flush_window to DeflateEncoder
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
b22de1864a router: add stream helpers to async-decode json-seq
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
04923dd601 client: expose body, add generic request methods and streaming
The get/put/post/put_without_body/... methods now have a default
implementation forwarding to a generic `request` method as all our
implementations do the same already anyway.

Additionally, in order to allow easy access to a "streaming body", the
Body type is now exposed.

In the future, this crate may also require a wrapper to standardize
the handling of `application/json-seq` streams if we end up using
them, but for now, a simple way to expose the body is enough to get
going.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
8021f0a7f6 api-macro: support new streaming api methods
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
17bd32e90e router, rest-server: add StreamSync and StreamAsync API handlers
These are Iterators or Streams which continuously produce output. They
can either be formatted, in which they are serialized like the as
usually, or, if the client caccepts `application/json-seq` via an
`Accept` header, it will be streamed as a sequence directly.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
c31eaf0018 router, rest-server, api-macro: rename Streaming api to Serializing
This does not "stream", but rather skips the intermediate step to
serialize the entire output into a local json string.

We now reserve the "Stream*" prefix for actual *streaming*, that is,
producing an API response which gets streamed continuously as it is
asynchronously produced.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:15:11 +02:00
Wolfgang Bumiller
e8b8060b17 log: bump to 0.2.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 13:58:56 +02:00
Gabriel Goller
5933c2f47b log: write to stderr when using init_cli_logger, export tracing::Level
Previously when using `env_logger` all of our cli-tools logged to
stderr, make tracing do the same. Export `tracing::Level` so that we can
use the `tracing::enabled!` macro.

Tested-by: Christian Ebner <c.ebner@proxmox.com>
Reviewed-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-09-05 13:45:43 +02:00
Wolfgang Bumiller
a46dd1a60a router: bump to 2.2.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-30 13:53:03 +02:00
Wolfgang Bumiller
9a17ff15f7 log: bump to 0.2.3-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-30 13:50:24 +02:00
Gabriel Goller
021bab9304 add tracing init_cli_logger and deprecate old one
Deprecate the proxmox-router init_cli_logger function used in client
binaries such as `proxmox-backup-client`, `proxmox-backup-manager`,
'pxar', etc... Add a new init_cli_logger function that uses tracing
instead of env_logger. It checks if the task is in a workertask and
prints the message either to stdout or to the tasklog (this is
neccessary for commands in proxmox-backup-manager that call api handlers
that start workerthreads from the client).

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-08-30 13:47:55 +02:00
Dominik Csapak
237b317678 router: sort cli properties in usage output
If we don't do this, then properties from a serde flattened struct will
be positioned at the end of the list, rather than properly sorted with
the other properties.

Since the tests also feature non-sorted properties, we have to adapt
them too.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-08-30 13:26:13 +02:00
Wolfgang Bumiller
d72ea40c80 schema: bump to 3.1.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-28 14:51:23 +02:00
Wolfgang Bumiller
5704cb43b9 schema: add Schema::unwrap_any_object_schema
so we have a version we can use in const fns and const{} expressions

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-28 14:50:21 +02:00
Wolfgang Bumiller
00ca04698d schema: seal ObjectSchemaType and assert Send + Sync
While this is technically a breaking API change since the trait is
public, we don't implement it anywhere and it isn't meant to be
implemented from the outside.

Also, encode that these types are all Send + Sync via a super trait
notation.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-28 14:43:42 +02:00
Wolfgang Bumiller
e750bce69b schema: make Schema::any_object a const fn
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-28 14:32:39 +02:00
Wolfgang Bumiller
d166dcff0a schema: rustfmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-28 14:32:21 +02:00
Wolfgang Bumiller
3d044a5acf systemd: bump d/control to add missing dependencies
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-28 14:18:58 +02:00