]> git.proxmox.com Git - proxmox.git/log
proxmox.git
8 weeks agoauth-api: implement `Display` for `Realm{, Ref}`
Christoph Heiss [Fri, 12 Jan 2024 16:15:58 +0000 (17:15 +0100)]
auth-api: implement `Display` for `Realm{, Ref}`

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
8 weeks agoldap: add method for retrieving root DSE attributes
Christoph Heiss [Fri, 12 Jan 2024 16:15:57 +0000 (17:15 +0100)]
ldap: add method for retrieving root DSE attributes

The root DSE holds common attributes about the LDAP server itself.
Needed to e.g. support Active Directory-based LDAP servers to retrieve
the base DN from the server itself, based on an valid bind.

See also RFC 4512, Section 5.1 [0] for more information about this
special object.

[0] https://www.rfc-editor.org/rfc/rfc4512#section-5.1

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
8 weeks agoldap: avoid superfluous allocation when calling .search()
Christoph Heiss [Fri, 12 Jan 2024 16:15:56 +0000 (17:15 +0100)]
ldap: avoid superfluous allocation when calling .search()

The `attrs` parameter of `Ldap::search()` is an `impl AsRef<[impl
AsRef<str>]>` anyway, so replace `vec![..]` with `&[..]`.

Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
8 weeks agofix: use fragmented block size for space calculation
Gabriel Goller [Mon, 22 Jan 2024 14:23:32 +0000 (15:23 +0100)]
fix: use fragmented block size for space calculation

We currently calculate the size of a datastore using `statfs64`, which
returns the number of blocks in the fs and the two block sizes:
fragemented block size(f_frsize) and block size (f_bsize). To calculate
eg the total space in a datastore we use total_blocks * f_bsize, which
is not always correct.

`f_frsize` is the minimum unit of allocation on the filesystem (in
bytes) and in 99% of the cases equal to `f_bsize`, but in some cases
it differs. For example some filesystems allow smaller blocks for small
files, in case f_frsize < f_bsize. In that case, f_frsize * total_blocks
returns (mostly) the correct result (ceph also did some weird stuff, which is
now being fixed though [0][1]). `statvfs` also documents this as the
recommended way ('fsblkcnt_t f_blocks;   /* Size of fs in f_frsize units */')[2].

This patch aligns the the behavior with the libc utilities (also used by
`df`) [3].

Motivation: [4] (Forum post)

[0]: https://tracker.ceph.com/issues/3793
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=92a49fb0f79f3300e6e50ddf56238e70678e4202
[2]: https://www.man7.org/linux/man-pages/man3/statvfs.3.html
[3]: https://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/fsusage.c#n147
[4]: https://forum.proxmox.com/threads/pbs-3-1-2-wrong-datastore-information-sshfs.139875/#post-626959

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2 months agosys: d/copyright: update years
Thomas Lamprecht [Tue, 19 Mar 2024 10:23:43 +0000 (11:23 +0100)]
sys: d/copyright: update years

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agobump proxmox-notify to 0.3.3-1
Wolfgang Bumiller [Tue, 19 Mar 2024 10:10:30 +0000 (11:10 +0100)]
bump proxmox-notify to 0.3.3-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agobump proxmox-auth-api to 0.3.4
Wolfgang Bumiller [Tue, 19 Mar 2024 10:09:10 +0000 (11:09 +0100)]
bump proxmox-auth-api to 0.3.4

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agobump proxmox-schema to 3.1.0-1
Wolfgang Bumiller [Tue, 19 Mar 2024 10:07:08 +0000 (11:07 +0100)]
bump proxmox-schema to 3.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agonotify: adapt to proxmox_schema changes, use const_format
Wolfgang Bumiller [Tue, 19 Mar 2024 09:29:27 +0000 (10:29 +0100)]
notify: adapt to proxmox_schema changes, use const_format

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agonotify: sort and group dependencies
Wolfgang Bumiller [Tue, 19 Mar 2024 09:27:25 +0000 (10:27 +0100)]
notify: sort and group dependencies

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agoproxmox-schema: moved common api types from pbs-api-types
Dietmar Maurer [Fri, 15 Mar 2024 11:27:32 +0000 (12:27 +0100)]
proxmox-schema: moved common api types from pbs-api-types

We want to use those types in all of our products.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agoproxmox-schema: add IP address regex/api-types
Dietmar Maurer [Fri, 15 Mar 2024 11:27:31 +0000 (12:27 +0100)]
proxmox-schema: add IP address regex/api-types

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agoproxmox-auth-api: use const_format to define static strings
Dietmar Maurer [Fri, 15 Mar 2024 11:27:30 +0000 (12:27 +0100)]
proxmox-auth-api: use const_format to define static strings

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agoproxmox-schema: use const_format to define static strings.
Dietmar Maurer [Fri, 15 Mar 2024 11:27:29 +0000 (12:27 +0100)]
proxmox-schema: use const_format to define static strings.

Macro rules are not hygienic, and current rust macro visibility rules
are a nightmare. Using const_format::concatcp!() is a much cleaner
solution.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agobump proxmox-acme to 0.5.1
Wolfgang Bumiller [Thu, 7 Mar 2024 12:27:15 +0000 (13:27 +0100)]
bump proxmox-acme to 0.5.1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agoacme: formatting fixups
Wolfgang Bumiller [Thu, 7 Mar 2024 12:24:42 +0000 (13:24 +0100)]
acme: formatting fixups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agoacme: drop api-types feature from schema dependency
Wolfgang Bumiller [Thu, 7 Mar 2024 12:24:37 +0000 (13:24 +0100)]
acme: drop api-types feature from schema dependency

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agoproxmox-acme: derive PartialEq for API types
Dietmar Maurer [Thu, 7 Mar 2024 11:54:44 +0000 (12:54 +0100)]
proxmox-acme: derive PartialEq for API types

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agoproxmox-acme: add api-types feature
Dietmar Maurer [Thu, 7 Mar 2024 09:45:33 +0000 (10:45 +0100)]
proxmox-acme: add api-types feature

Because AccountData is exposed via our API (currently as type Object).

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agorrd: fixup examples with the renamed types
Wolfgang Bumiller [Wed, 21 Feb 2024 11:28:09 +0000 (12:28 +0100)]
rrd: fixup examples with the renamed types

Some types were recently renamed but the examples not updated
accordingly.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: 2f942833672d "rrd: spell out hard to understand abbreviations in public types"
2 months agobump proxmox-schema to 3.0.1-1
Wolfgang Bumiller [Wed, 21 Feb 2024 11:24:25 +0000 (12:24 +0100)]
bump proxmox-schema to 3.0.1-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agoschema: drop periods after errors
Wolfgang Bumiller [Wed, 21 Feb 2024 11:04:39 +0000 (12:04 +0100)]
schema: drop periods after errors

lower case start + period = wrong

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agoschema: add regression tests for additional_properties in AllOf
Wolfgang Bumiller [Wed, 21 Feb 2024 11:02:00 +0000 (12:02 +0100)]
schema: add regression tests for additional_properties in AllOf

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agoschema: AllOf/OneOf: actually perform additional_properties() check
Wolfgang Bumiller [Wed, 21 Feb 2024 10:41:53 +0000 (11:41 +0100)]
schema: AllOf/OneOf: actually perform additional_properties() check

rather than just always allowing additional properties, only return
true if any of the available schemas allows it

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agorouter: Use safe wrapper for libc::isatty
Maximiliano Sandoval R [Fri, 16 Feb 2024 14:59:01 +0000 (15:59 +0100)]
router: Use safe wrapper for libc::isatty

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
3 months agosys: Use safe wrapper for libc::isatty
Maximiliano Sandoval R [Fri, 16 Feb 2024 14:59:00 +0000 (15:59 +0100)]
sys: Use safe wrapper for libc::isatty

Use the `std::io::IsTerminal` trait introduced in Rust 1.70.

Internally it calls `libc::isatty`, see [1, 2]. Note that it switches
the comparison from `== 1` to `!= 0` which shouldn't make a difference
assuming that libc::isatty upholds the promises made in its man page.

The MSRV was set on the workspace to reflect this change.

[1] https://doc.rust-lang.org/src/std/io/stdio.rs.html#1079
[2] https://doc.rust-lang.org/src/std/sys/unix/io.rs.html#79

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
3 months agobump proxmox-subscription to 0.4.3-1
Wolfgang Bumiller [Fri, 2 Feb 2024 13:24:27 +0000 (14:24 +0100)]
bump proxmox-subscription to 0.4.3-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agobump proxmox-rrd to 0.1.1-1
Wolfgang Bumiller [Fri, 2 Feb 2024 13:22:22 +0000 (14:22 +0100)]
bump proxmox-rrd to 0.1.1-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agobump proxmox-notify to 0.3.2-1
Wolfgang Bumiller [Fri, 2 Feb 2024 13:19:52 +0000 (14:19 +0100)]
bump proxmox-notify to 0.3.2-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agobump proxmox-client to 0.3.1-1
Wolfgang Bumiller [Fri, 2 Feb 2024 13:05:44 +0000 (14:05 +0100)]
bump proxmox-client to 0.3.1-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agobump proxmox-section-config to 2.0.1-1
Wolfgang Bumiller [Fri, 2 Feb 2024 13:03:10 +0000 (14:03 +0100)]
bump proxmox-section-config to 2.0.1-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agobump proxmox-auth-api to 0.3.3
Wolfgang Bumiller [Fri, 2 Feb 2024 13:01:28 +0000 (14:01 +0100)]
bump proxmox-auth-api to 0.3.3

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agobump proxmox-tfa to 4.1.2
Wolfgang Bumiller [Fri, 2 Feb 2024 13:00:27 +0000 (14:00 +0100)]
bump proxmox-tfa to 4.1.2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agobump proxmox-rest-server to 0.5.2-1
Wolfgang Bumiller [Fri, 2 Feb 2024 11:08:15 +0000 (12:08 +0100)]
bump proxmox-rest-server to 0.5.2-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agobump proxmox-router to 2.1.3-1
Wolfgang Bumiller [Fri, 2 Feb 2024 12:55:23 +0000 (13:55 +0100)]
bump proxmox-router to 2.1.3-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agobump proxmox-human-byte to 0.1.3-1
Wolfgang Bumiller [Fri, 2 Feb 2024 12:51:47 +0000 (13:51 +0100)]
bump proxmox-human-byte to 0.1.3-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agobump proxmox-apt to 0.10.8-1
Wolfgang Bumiller [Fri, 2 Feb 2024 12:47:49 +0000 (13:47 +0100)]
bump proxmox-apt to 0.10.8-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agobump proxmox-api-macro to 1.0.8-1
Wolfgang Bumiller [Fri, 2 Feb 2024 12:45:41 +0000 (13:45 +0100)]
bump proxmox-api-macro to 1.0.8-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agobump proxmox-schema to 3.0.0-1
Wolfgang Bumiller [Fri, 2 Feb 2024 11:11:21 +0000 (12:11 +0100)]
bump proxmox-schema to 3.0.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agoschema: implement split_list iterator
Wolfgang Bumiller [Tue, 4 Apr 2023 14:00:59 +0000 (16:00 +0200)]
schema: implement split_list iterator

and reuse splitting code in no_schema's SeqAccess as well

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
3 months agorouter: OneOfSchema support
Wolfgang Bumiller [Fri, 17 Mar 2023 14:44:45 +0000 (15:44 +0100)]
router: OneOfSchema support

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
3 months agoschema: implement oneOf schema support
Wolfgang Bumiller [Thu, 16 Mar 2023 16:11:05 +0000 (17:11 +0100)]
schema: implement oneOf schema support

A 'oneOf' schema is basically exactly what a rust `enum` is.
Exactly one of the possible values must match the data.

This should ultimately be the base to allow using the
`#[api]` macro on a newtype style enum as well as using this
schema as a configuration for our section config parser.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
3 months agorouter: cli: option to specify args explicitly
Wolfgang Bumiller [Tue, 14 Mar 2023 08:02:45 +0000 (09:02 +0100)]
router: cli: option to specify args explicitly

so CLI tools can pre-parse out non-api parameters before
passing the remaining stuff to the router

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
3 months agorest-server: support configuring the privileged connection
Wolfgang Bumiller [Thu, 9 Mar 2023 14:50:55 +0000 (15:50 +0100)]
rest-server: support configuring the privileged connection

Adds a privileged_addr to ApiConfig, and some helpers for
hyper (both server and client)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
3 months agorest-server: support unix sockets in create_daemon
Wolfgang Bumiller [Wed, 8 Mar 2023 12:26:50 +0000 (13:26 +0100)]
rest-server: support unix sockets in create_daemon

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
3 months agobump proxmox-rrd to 0.1.0-1
Wolfgang Bumiller [Thu, 1 Feb 2024 12:46:28 +0000 (13:46 +0100)]
bump proxmox-rrd to 0.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agorrd: spell out hard to understand abbreviations in public types
Lukas Wagner [Wed, 31 Jan 2024 15:26:01 +0000 (16:26 +0100)]
rrd: spell out hard to understand abbreviations in public types

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
3 months agorrd: fix a few typos
Lukas Wagner [Wed, 31 Jan 2024 13:56:51 +0000 (14:56 +0100)]
rrd: fix a few typos

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
3 months agorrd: feature-gate support for the v1 format
Lukas Wagner [Wed, 31 Jan 2024 13:51:54 +0000 (14:51 +0100)]
rrd: feature-gate support for the v1 format

new users of this crate might not really need support for the v1
format.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
3 months agoadd debian packaging for proxmox-rrd
Lukas Wagner [Wed, 31 Jan 2024 12:02:52 +0000 (13:02 +0100)]
add debian packaging for proxmox-rrd

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
3 months agoadd `proxmox-rrd` to workspace
Lukas Wagner [Wed, 31 Jan 2024 11:57:22 +0000 (12:57 +0100)]
add `proxmox-rrd` to workspace

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
3 months agoMerge branch proxmox-rrd
Lukas Wagner [Wed, 31 Jan 2024 11:40:20 +0000 (12:40 +0100)]
Merge branch proxmox-rrd

The proxmox-backup repo was filtered using `git filter-repo` using the
following paths:

proxmox-rrd
proxmox-rrd-api-types
src/rrd

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
3 months agobump proxmox-login to 0.1.1-1
Wolfgang Bumiller [Wed, 24 Jan 2024 11:48:09 +0000 (12:48 +0100)]
bump proxmox-login to 0.1.1-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agoMakefile: enforce the use packaged cargo
Wolfgang Bumiller [Wed, 24 Jan 2024 08:26:02 +0000 (09:26 +0100)]
Makefile: enforce the use packaged cargo

Nightly currently produces a different output format so this command
doesn't work right now when +system is not the default cargo.
Let's hope this is just a temporary hiccup in nightly, given that
there is an explicit `--format-version=1` parameter...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agologin: parse helpers for floats
Wolfgang Bumiller [Wed, 24 Jan 2024 08:01:54 +0000 (09:01 +0100)]
login: parse helpers for floats

Of course PVE also stringifies those in the API, duh...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agoschema: cli: simplify can_default check
Wolfgang Bumiller [Mon, 22 Jan 2024 13:55:05 +0000 (14:55 +0100)]
schema: cli: simplify can_default check

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agohttp: concat! user agent instead of format!
Wolfgang Bumiller [Mon, 15 Jan 2024 10:17:57 +0000 (11:17 +0100)]
http: concat! user agent instead of format!

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agonotify: bump d/control
Wolfgang Bumiller [Wed, 10 Jan 2024 13:15:48 +0000 (14:15 +0100)]
notify: bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agobump proxmox-notify to 0.3.1-1
Wolfgang Bumiller [Wed, 10 Jan 2024 13:04:36 +0000 (14:04 +0100)]
bump proxmox-notify to 0.3.1-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agonotify: matcher: support lists of values for 'exact' match-field mode
Lukas Wagner [Wed, 13 Dec 2023 16:37:42 +0000 (17:37 +0100)]
notify: matcher: support lists of values for 'exact' match-field mode

For example, one can now use:
  match-field exact:type=vzdump,replication
to match on vzdump AND replication events.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 months agonotify: include 'type' metadata field for forwarded mails
Lukas Wagner [Wed, 13 Dec 2023 16:37:41 +0000 (17:37 +0100)]
notify: include 'type' metadata field for forwarded mails

Seems like this was forgotten in the initial version. Without it,
it's not really possible to create matchers for forwarded mails.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 months agonotify: include 'hostname' metadata field for forwarded mails
Lukas Wagner [Wed, 13 Dec 2023 16:37:40 +0000 (17:37 +0100)]
notify: include 'hostname' metadata field for forwarded mails

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 months agonotify: add separate context for unit-tests
Lukas Wagner [Wed, 10 Jan 2024 09:31:22 +0000 (10:31 +0100)]
notify: add separate context for unit-tests

... as using PVEContext for tests is brittle and annoying for some
tests.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 months agonotify: api: allow resetting built-in targets if used by a matcher
Lukas Wagner [Wed, 10 Jan 2024 09:31:21 +0000 (10:31 +0100)]
notify: api: allow resetting built-in targets if used by a matcher

In the 'delete'-handler targets, we check if a
target is still referenced by a matcher - if it is, we return an
error. For built-in targets, this is actually not necessary, since
'deleting' a built-in only resets it to its default settings - it will
continue to exist after that.
The user could easily trigger this if 'mail-to-root', which is
referenced by 'default-matcher' is modified and then reset to its
defaults: An error is shown, the built-in target is not reset.

This commit disables this check if it is a built-in target.

Renamed the helper 'ensure_unused' to 'ensure_safe_to_delete' in the
process.

Also fixed the tests in api::test - they were never executed due to a
faulty #[cfg] directive.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 months agonotify: smtp: add `Auto-Submitted` header to email body
Lukas Wagner [Wed, 10 Jan 2024 09:52:52 +0000 (10:52 +0100)]
notify: smtp: add `Auto-Submitted` header to email body

`Auto-Submitted` is defined in the rfc 5436 [1] and describes how
an automatic response (f.e. ooo replies, etc.) should behave on the
emails. When using `Auto-Submitted: auto-generated` (or any value
other than `none`) automatic replies won't be triggered.

[1]: https://www.rfc-editor.org/rfc/rfc3834.html

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 months agonotify: smtp: forward original message instead nesting
Lukas Wagner [Wed, 10 Jan 2024 09:52:51 +0000 (10:52 +0100)]
notify: smtp: forward original message instead nesting

For mails forwarded by `proxmox-mail-forward` to an SMTP target, the
original message was nested as a 'message/rfc822' message part.
Originally this approach was chosen to avoid having to rewrite
message headers.
Good email-clients, such as Thunderbird can display these inline.
Other, more limited clients will show these messages as an attached
.eml file, which is not really a good user experience.

This patch changes the approach for message forwarding to be more like
forwarding mails in a mail client. We create a new message and
add the original message body as a body. Additionally, we also copy
over all message headers that are relevant to correctly display the
original message body (e.g. Content-Type, Content-Transfer-Encoding)

Tested with a couple of different email messages (varying in
structure, body parts, encoding, etc.) against the following SMTP
relays:
  - gmail
  - outlook
  - our own webmail service

Originally reported in our community forum:
https://forum.proxmox.com/threads/proxmox-mail-forward-sends-mails-as-eml.137710/

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 months agobump proxmox-sys to 0.5.3-1
Wolfgang Bumiller [Mon, 8 Jan 2024 11:48:18 +0000 (12:48 +0100)]
bump proxmox-sys to 0.5.3-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agobump proxmox-time dependency to 1.1.6
Wolfgang Bumiller [Mon, 8 Jan 2024 11:17:47 +0000 (12:17 +0100)]
bump proxmox-time dependency to 1.1.6

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agobump proxmox-time to 1.1.6
Wolfgang Bumiller [Mon, 8 Jan 2024 11:17:16 +0000 (12:17 +0100)]
bump proxmox-time to 1.1.6

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agosys: email: use `epoch_to_rfc2822` from proxmox_time
Lukas Wagner [Mon, 11 Dec 2023 13:29:08 +0000 (14:29 +0100)]
sys: email: use `epoch_to_rfc2822` from proxmox_time

`strftime`'s formatting is locale-dependent. If the system locale was
set to e.g. de_DE.UTF-8, the `Date` header became invalid
(e.g Mo instead of Mon for 'Monday'), tripping up some mail clients
(e.g. KMail).

This commit should fix this by using the new `epoch_to_rfc2822`
function from proxmox_time. Under the hood, this function uses
`strftime_l` with a fixed locale (C).

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 months agotime: posix: add epoch_to_rfc2822
Lukas Wagner [Mon, 11 Dec 2023 13:29:07 +0000 (14:29 +0100)]
time: posix: add epoch_to_rfc2822

This is the format used in the 'Date' header in mails.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 months agotime: posix: add bindings for strftime_l
Lukas Wagner [Mon, 11 Dec 2023 13:29:06 +0000 (14:29 +0100)]
time: posix: add bindings for strftime_l

This variant of strftime can be provided with a locale_t, which
determines the locale used for time formatting.

A struct `Locale` was also introduced as a safe wrapper around
locale_t.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 months agotime: posix: inline vars in string formatting
Lukas Wagner [Mon, 11 Dec 2023 13:29:05 +0000 (14:29 +0100)]
time: posix: inline vars in string formatting

No functional changes.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 months agotime: posix: use strftime from the `libc` crate.
Lukas Wagner [Mon, 11 Dec 2023 13:29:04 +0000 (14:29 +0100)]
time: posix: use strftime from the `libc` crate.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 months agoclient: do a POST instead of PUT in `post_without_body`
Lukas Wagner [Wed, 3 Jan 2024 14:04:59 +0000 (15:04 +0100)]
client: do a POST instead of PUT in `post_without_body`

Probably a copy-paste mistake.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
5 months agobump api-macro to 1.0.7-1
Wolfgang Bumiller [Wed, 6 Dec 2023 15:02:42 +0000 (16:02 +0100)]
bump api-macro to 1.0.7-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump proxmox-tfa to 4.1.1
Wolfgang Bumiller [Wed, 6 Dec 2023 15:01:13 +0000 (16:01 +0100)]
bump proxmox-tfa to 4.1.1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump proxmox-router to 2.1.2-1
Wolfgang Bumiller [Wed, 6 Dec 2023 15:00:10 +0000 (16:00 +0100)]
bump proxmox-router to 2.1.2-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump proxmox-apt to 0.10.7-1
Wolfgang Bumiller [Wed, 6 Dec 2023 14:58:53 +0000 (15:58 +0100)]
bump proxmox-apt to 0.10.7-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agotfa: fix deserialize-default in TfaUser
Wolfgang Bumiller [Wed, 6 Dec 2023 13:54:46 +0000 (14:54 +0100)]
tfa: fix deserialize-default in TfaUser

Note that this was currently not deserialized anywhere, so this was
not an issue, but the api-macro now treats this as an error.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoapi-macro: make skip_serializing_if without default an error
Wolfgang Bumiller [Wed, 6 Dec 2023 13:38:04 +0000 (14:38 +0100)]
api-macro: make skip_serializing_if without default an error

except for Option types, since this causes deserialization issues

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoapi-macro: add VariantAttrib
Wolfgang Bumiller [Wed, 6 Dec 2023 12:53:48 +0000 (13:53 +0100)]
api-macro: add VariantAttrib

separated out of FieldAttrib without the `flatten` attribute, since we
don't support this on enum variants

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoapi-macro: rename SerdeAttrib to FieldAttrib
Wolfgang Bumiller [Wed, 6 Dec 2023 12:52:27 +0000 (13:52 +0100)]
api-macro: rename SerdeAttrib to FieldAttrib

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agorouter: fix warning
Wolfgang Bumiller [Wed, 6 Dec 2023 13:39:44 +0000 (14:39 +0100)]
router: fix warning

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoMerge branch 'proxmox-acme-merge'
Wolfgang Bumiller [Mon, 4 Dec 2023 10:52:39 +0000 (11:52 +0100)]
Merge branch 'proxmox-acme-merge'

5 months agobump proxmox-acme to 0.5.0
Wolfgang Bumiller [Mon, 4 Dec 2023 10:46:38 +0000 (11:46 +0100)]
bump proxmox-acme to 0.5.0

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoadd proxmox-acme to workspace
Wolfgang Bumiller [Mon, 4 Dec 2023 10:45:00 +0000 (11:45 +0100)]
add proxmox-acme to workspace

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoMerge branch 'proxmox-acme'
Wolfgang Bumiller [Mon, 4 Dec 2023 10:43:15 +0000 (11:43 +0100)]
Merge branch 'proxmox-acme'

5 months agodrop rustfmt.toml
Wolfgang Bumiller [Mon, 4 Dec 2023 10:42:54 +0000 (11:42 +0100)]
drop rustfmt.toml

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agodrop -rs suffix
Wolfgang Bumiller [Mon, 4 Dec 2023 10:42:42 +0000 (11:42 +0100)]
drop -rs suffix

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agomove to proxmox-acme
Wolfgang Bumiller [Mon, 4 Dec 2023 10:41:59 +0000 (11:41 +0100)]
move to proxmox-acme

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoexpand helper function by eab credentials
Folke Gleumes [Tue, 14 Nov 2023 14:14:02 +0000 (15:14 +0100)]
expand helper function by eab credentials

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
5 months agoOption<Vec<>> -> Vec<>
Wolfgang Bumiller [Mon, 4 Dec 2023 09:13:46 +0000 (10:13 +0100)]
Option<Vec<>> -> Vec<>

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoproxmox-apt: fix digest api type in APTRepositoryFile
Dietmar Maurer [Mon, 4 Dec 2023 08:39:54 +0000 (09:39 +0100)]
proxmox-apt: fix digest api type in APTRepositoryFile

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 months agoadd meta fields returned by the directory
Folke Gleumes [Tue, 14 Nov 2023 14:14:01 +0000 (15:14 +0100)]
add meta fields returned by the directory

According to the rfc, the meta field contains additional fields that
weren't covered by the Meta struct. Of the additional fields, only
external_account_required will be used in the near future, but others
were added for completeness and the case that they might be used in the
future.

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
5 months agoadd external account binding
Folke Gleumes [Tue, 14 Nov 2023 14:14:00 +0000 (15:14 +0100)]
add external account binding

Functionality was added as a additional setter function, which hopefully
prevents any breakages. Since a placeholder Option an the AccountData
was already present, but has never been used, replacing the field with
an Option of a fully defined type should also be minimally intrusive.

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
5 months agoproxmox-apt: fix serde attributes for API types
Dietmar Maurer [Sat, 2 Dec 2023 13:45:57 +0000 (14:45 +0100)]
proxmox-apt: fix serde attributes for API types

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 months agotree-wide: fix various typos
Thomas Lamprecht [Wed, 29 Nov 2023 17:32:06 +0000 (18:32 +0100)]
tree-wide: fix various typos

found with codespell

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agosys: bump to 0.5.2-1
Wolfgang Bumiller [Wed, 29 Nov 2023 14:26:04 +0000 (15:26 +0100)]
sys: bump to 0.5.2-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agosys: email: move Auto-Submitted header up
Gabriel Goller [Wed, 29 Nov 2023 14:15:11 +0000 (15:15 +0100)]
sys: email: move Auto-Submitted header up

Move the Auto-Submitted header out of the multipart section.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>