Commit Graph

95 Commits

Author SHA1 Message Date
Dietmar Maurer
cfc155a06b acme-api: reusable ACME api implementation.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-16 12:35:14 +02:00
Dietmar Maurer
49b97b6a5f bump proxmox-schema to 3.1.1-1
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-16 09:35:50 +02:00
Dietmar Maurer
3c19dd757a rename proxmox-system-config-api to proxmox-system-management-api
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-15 13:23:42 +02:00
Dietmar Maurer
751b578d6e rename proxmox-dns-api to proxmox-system-config-api
Because we want to bundle system configuration APIs in one crate,
i.e. Time, DNS, Network. We may separate them in future using
cargo features.
2024-05-07 13:32:26 +02:00
Dietmar Maurer
64e8a72a0b fix typo in proxmox-product-config workspace dependency
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-03 09:28:33 +02:00
Dietmar Maurer
c2f85d418a dns-api: new crate which implements the DNS api
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-05-02 13:04:43 +02:00
Dietmar Maurer
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
Wolfgang Bumiller
d653ac343b bump proxmox-schema to 3.1.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-03-19 11:08:28 +01:00
Dietmar Maurer
0c5e2640d0 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>
2024-03-18 10:19:46 +01:00
Maximiliano Sandoval R
430df21720 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>
2024-02-16 16:55:58 +01:00
Wolfgang Bumiller
890d9e58f7 bump proxmox-rest-server to 0.5.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-02-02 13:58:05 +01:00
Wolfgang Bumiller
f67ea142bc bump proxmox-router to 2.1.3-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-02-02 13:56:34 +01:00
Wolfgang Bumiller
ca6ca904ad bump proxmox-api-macro to 1.0.8-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-02-02 13:56:01 +01:00
Wolfgang Bumiller
245524d0d8 bump proxmox-schema to 3.0.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-02-02 13:53:12 +01:00
Lukas Wagner
5cbc8a4b66 add proxmox-rrd to workspace
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2024-02-01 10:30:57 +01:00
Wolfgang Bumiller
8fdf696eed bump proxmox-time dependency to 1.1.6
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-01-08 12:18:12 +01:00
Wolfgang Bumiller
e703725049 add proxmox-acme to workspace
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-12-04 11:45:00 +01:00
Wolfgang Bumiller
4a8cadc7e0 bump proxmox-rest-server to 0.5.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-11-27 14:39:22 +01:00
Thomas Lamprecht
af660f1fee sys: bump version to 0.5.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-17 10:42:38 +01:00
Lukas Wagner
53627a1952 notify: add 'smtp' endpoint
This commit adds a new endpoint type, namely 'smtp'. This endpoint
uses the `lettre` crate to directly send emails to SMTP relays.

The `lettre` crate was chosen since it is by far the most popular SMTP
implementation for Rust that looks like it is well maintained.
Also, it includes async support (for when we want to extend
proxmox-notify to be async).

For this new endpoint type, a new section-config type was introduced
(smtp). It has the same fields as the type for `sendmail`, with the
addition of some new options (smtp server, authentication, tls mode,
etc.).

Some of the behavior that is shared between sendmail and smtp
endpoints has been moved to a new `endpoints::common::mail` module.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-11-17 08:31:36 +01:00
Lukas Wagner
5f7ac875f6 notify: add mechanisms for email message forwarding
As preparation for the integration of `proxmox-mail-foward` into the
notification system, this commit makes a few changes that allow us to
forward raw email messages (as passed from postfix).

For mail-based notification targets, the email will be forwarded
as-is, including all headers. The only thing that changes is the
message envelope.
For other notification targets, the mail is parsed using the
`mail-parser` crate, which allows us to extract a subject and a body.
As a body we use the plain-text version of the mail. If an email is
HTML-only, the `mail-parser` crate will automatically attempt to
transform the HTML into readable plain text.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-11-17 08:31:36 +01:00
Wolfgang Bumiller
1a6f1efe63 workspace: set resolver to 2 to silence a warning
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-10-16 08:53:35 +02:00
Fabian Grünbichler
04e2d0e5c3 bump proxmox-api-macro to 1.0.6-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-10-03 09:37:01 +02:00
Fabian Grünbichler
c83627b1a6 bump proxmox-sortable-macro to 0.1.3-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-10-03 09:37:01 +02:00
Fabian Grünbichler
4fd7359677 bump proxmox-router to 2.1.1-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-10-02 09:25:10 +02:00
Wolfgang Bumiller
b232b580a0 update to syn 2
This mostly affected attribute parsing (due to the syn::Meta changes).
Also creating `DelimSpan`s for custom-built `syn::Attribute`s is a
bit... ugly.
Upshot: turns out we can drop some helpers in util.rs with the new
`syn::Meta` changes.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-09-29 13:52:21 +02:00
Wolfgang Bumiller
eb1abe45b6 router: bump env_logger to 0.10 and move to workspace
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-09-28 09:59:48 +02:00
Wolfgang Bumiller
34a79cdd0c bump proxmox-api-macro to 1.0.5-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-08-03 08:25:13 +02:00
Wolfgang Bumiller
25024fa687 import proxmox-client crate
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-08-01 15:49:43 +02:00
Lukas Wagner
779c45eaad http-error: add new http-error crate
Break out proxmox-router's HttpError into it's own crate so that it can
be used without pulling in proxmox-router.

This commit also implements `Serialize` for `HttpError` so that it can
be returned from perlmod bindings, allowing Perl code to access the
status code as well as the message.

Also add some smoke-tests to make sure that the `http_bail` and
`http_err` macros actually produce valid code.

Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-07-28 10:47:03 +02:00
Wolfgang Bumiller
7ea502b351 bump proxmox-section-config to 2.0.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-24 11:03:15 +02:00
Wolfgang Bumiller
93fc5b503a bump proxmox-router to 2.0.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-24 10:53:44 +02:00
Wolfgang Bumiller
ac6a52dfd1 bump proxmox-schema to 2.0.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-24 10:42:14 +02:00
Lukas Wagner
4865711339 notify: add template rendering
This commit adds template rendering to the `proxmox-notify` crate, based
on the `handlebars` crate.

Title and body of a notification are rendered using any `properties`
passed along with the notification. There are also a few helpers,
allowing to render tables from `serde_json::Value`.

'Value' renderers. These can also be used in table cells using the
'renderer' property in a table schema:
  - {{human-bytes val}}
    Render bytes with human-readable units (base 2)
  - {{duration val}}
    Render a duration (based on seconds)
  - {{timestamp val}}
    Render a unix-epoch (based on seconds)

There are also a few 'block-level' helpers.
  - {{table val}}
    Render a table from given val (containing a schema for the columns,
    as well as the table data)
  - {{object val}}
    Render a value as a pretty-printed json
  - {{heading_1 val}}
    Render a top-level heading
  - {{heading_2 val}}
    Render a not-so-top-level heading
  - {{verbatim val}} or {{/verbatim}}<content>{{#verbatim}}
    Do not reflow text. NOP for plain text, but for HTML output the text
    will be contained in a <pre> with a regular font.
  - {{verbatim-monospaced val}} or
      {{/verbatim-monospaced}}<content>{{#verbatim-monospaced}}
    Do not reflow text. NOP for plain text, but for HTML output the text
    will be contained in a <pre> with a monospaced font.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-07-24 10:25:48 +02:00
Lukas Wagner
2726e68afe notify: preparation for the first endpoint plugin
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-07-24 10:25:27 +02:00
Lukas Wagner
b8040a23cb add proxmox-notify crate
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-07-24 10:25:25 +02:00
Wolfgang Bumiller
50136f1817 bump proxmox-tfa to 4.0.4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-05 10:46:12 +02:00
Lukas Wagner
c3545d6644 add proxmox-human-byte crate
The module previously lived in `pbs-api-types`, however turned out to
be useful in other places as well (POM, proxmox-notify), so it is moved
here as its own micro-crate.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-06-26 13:24:48 +02:00
Wolfgang Bumiller
8f08039e7e auth-api: drop pam crate
it's too limited

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-14 08:51:43 +02:00
Wolfgang Bumiller
077a83f401 add proxmox-apt and proxmox-openid to workspace
and fixup d/copyright

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-24 09:24:27 +02:00
Wolfgang Bumiller
c531c314c6 bump proxmox-rest-server to 0.4.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-23 13:02:51 +02:00
Wolfgang Bumiller
af2d4c6c86 bump proxmox-http to 0.9.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-23 13:02:51 +02:00
Wolfgang Bumiller
4f2a7d971b bump proxmox-compression to 0.2.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-23 13:02:51 +02:00
Wolfgang Bumiller
dd87a120bd bump proxmox-sys to 0.5.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-23 13:02:51 +02:00
Wolfgang Bumiller
818ac8e708 update zstd 0.6 -> 0.12 for bookworm
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-23 13:02:51 +02:00
Wolfgang Bumiller
76ac1a3903 bump proxmox-tfa to 4.0.0-1, auth-api to 0.1.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-10 10:43:21 +02:00
Dietmar Maurer
be169e25ae add new proxmox-login to workspace members 2023-05-05 09:29:50 +02:00
Wolfgang Bumiller
82e212e33a bump schema dependency to 1.3.7 for auth-api
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:44:35 +01:00
Wolfgang Bumiller
bca9c6dbaf bump proxmox-tfa to 3.0.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:44:35 +01:00
Wolfgang Bumiller
5349ae208b add proxmox-auth-api crate
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:44:35 +01:00