Commit Graph

1813 Commits

Author SHA1 Message Date
Fabian Grünbichler
5391f5313b subscription: make key optional and support multiple keys
this is a breaking change requiring updates in proxmox-perl-rs and
proxmox-backup.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-21 13:29:15 +02:00
Wolfgang Bumiller
2e929cc386 bump proxmox-http dep to 0.6.4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-21 13:01:14 +02:00
Wolfgang Bumiller
d228ef6e20 http: bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-21 12:58:41 +02:00
Wolfgang Bumiller
dc57115703 bump proxmox-http to 0.6.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-21 12:58:11 +02:00
Mira Limbeck
a8a838754d http: fix proxy authorization header to include type
and encode the username:password string as base64 [0]. This fixes the
error 407 issue when using proxy authentication [1].

[0] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization
[1] https://forum.proxmox.com/threads/checking-the-subscription-behind-a-proxy-fails.112063/

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2022-07-21 12:54:59 +02:00
Wolfgang Bumiller
760c49be6e subscription: check in d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-21 12:54:59 +02:00
Wolfgang Bumiller
6794989b2a proxmox-subscription: initial bump to 0.1.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-20 13:37:08 +02:00
Wolfgang Bumiller
757031ef33 sys: clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-20 13:35:58 +02:00
Wolfgang Bumiller
94d388b988 http: clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-20 13:31:58 +02:00
Wolfgang Bumiller
5e630472ec subscription: clippy fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-20 13:28:31 +02:00
Wolfgang Bumiller
ab17e16664 subscription: line-wrap test data
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-20 13:28:31 +02:00
Wolfgang Bumiller
0cd02a0d2b subscription: doc comment fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-20 13:28:31 +02:00
Fabian Grünbichler
3f694b5481 subscription: clippy lints
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-20 13:28:31 +02:00
Fabian Grünbichler
baf31dc2d8 subscription: properly case status enum values
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-20 13:28:31 +02:00
Fabian Grünbichler
38492bde83 check signature when reading subscription
and handle signed keys differently w.r.t. age checks, since they will be
refreshed less frequently.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-19 15:20:36 +02:00
Fabian Grünbichler
4ec9a8183d add new proxmox-subscription crate
taking over slighlty generified helpers and types:
- subscription info and status
- checking subscription status with shop
- reading/writing local subscription-related files

the perl-based code uses base64 with newlines for the data, and base64
without padding for the checksum. accordingly, calculate the checksum
with and without newlines, and compare the decoded checksum instead of
the encoded one.

furthermore, the perl-based code encodes the subscription status using
Capitalized values instead of lowercase, so alias those for the time
being.

PVE also stores the serverid as 'validdirectory', so add that as alias
as well.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-19 15:20:36 +02:00
Wolfgang Bumiller
6e4a43d683 bump proxmox-sys to 0.3.2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-07 11:49:57 +02:00
Wolfgang Bumiller
67fbf2b2ee sys: make escape_unit() more flexible, add unescape_unit_path
This adds the ability to use these functions with non-utf8
strings as well.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-07 11:45:26 +02:00
Wolfgang Bumiller
c7224c5f67 bump proxmox-compression to 0.1.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-05 13:46:38 +02:00
Wolfgang Bumiller
ff86aa5f8a compression: more cleanups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-05 13:23:14 +02:00
Wolfgang Bumiller
2d37cd92e0 compression: indentation cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-05 12:17:04 +02:00
Wolfgang Bumiller
cc6e5d7372 compression: minor cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-05 12:13:38 +02:00
Dominik Csapak
6e989a1c29 proxmox-compression: add 'tar_directory'
similar to 'zip_directory', this is intended to tar a local directory,
e.g. when we're in a restore vm.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-07-05 12:12:02 +02:00
Dominik Csapak
38db37dc5f proxmox-compression: make ZstdEncoder stream a bit more generic
by not requiring the 'anyhow::Error' type from the source, but only
that it implements 'Into<Error>'. This way, we can also accept a stream
that produces e.g. an io::Error

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-07-05 12:11:57 +02:00
Fabian Grünbichler
b5accff750 bump proxmox-http to 0.6.3-1 2022-06-30 12:42:18 +02:00
Fabian Grünbichler
bd1f9f103e http: implement HttpClient for SimpleHttp
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-06-30 12:42:17 +02:00
Fabian Grünbichler
3c0486be50 http: add HttpClient trait
gated behind feature "client-trait"

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-06-30 12:42:12 +02:00
Fabian Grünbichler
94456ee4b1 http: move TLS helper to client feature
it's only used there and pulls in hyper and tokio, which we don't
want/need in http-helpers.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-06-29 10:32:44 +02:00
Fabian Grünbichler
210d4fdb68 http: take over json_object_to_query 2022-06-29 10:32:44 +02:00
Fabian Grünbichler
4393217633 bump proxmox-serde to 0.1.1 2022-06-29 10:32:44 +02:00
Fabian Grünbichler
b239b56999 serde: take over to/write_canonical_json
from PBS' tools module, and feature-guard via optional `serde_json`
dependency.
2022-06-29 10:32:44 +02:00
Fabian Grünbichler
f505240065 cargo fmt
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-06-29 10:32:29 +02:00
Wolfgang Bumiller
0d30720907 http: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 10:14:33 +02:00
Wolfgang Bumiller
064791e565 section-config: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 10:11:28 +02:00
Wolfgang Bumiller
7b1aad429f api-macro: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 10:10:07 +02:00
Wolfgang Bumiller
30901c60f5 compression: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 10:08:49 +02:00
Wolfgang Bumiller
b06b4c7426 lang: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 10:06:57 +02:00
Wolfgang Bumiller
1fca7b715d time: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 10:06:20 +02:00
Wolfgang Bumiller
b1a5daef61 sys: clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 09:58:34 +02:00
Wolfgang Bumiller
2f82a04734 bump proxmox-sys dep to 0.3.1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 09:45:11 +02:00
Wolfgang Bumiller
8f769a3996 bump proxmox-sys to 0.3.1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 09:41:36 +02:00
Dominik Csapak
1e2aa3eea4 partially fix #2915: proxmox-sys: scandir: stat if file_type is unknown
when using readdir/getdents the file type might be 'DT_UNKNOWN'
(depending on the filesystem). Do a fstatat in that case to
get the file type. Since maybe the callback wants to do
a stat anyway, pass it there (if done)

adds two new helpers:
'file_type_from_file_stat': uses a FileStat struct to get the file type
'get_file_type': calls fstatat to determine the file_type

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 09:34:34 +02:00
Hannes Laimer
8e06108d10 proxmox-rest-server: replace print with log macro
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00
Wolfgang Bumiller
a6f9cf3d73 bump proxmox-router dep to 1.2.4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00
Wolfgang Bumiller
09032fb88c bump proxmox-router to 1.2.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:40:05 +02:00
Wolfgang Bumiller
d934c79d4c router: restrict 'env_logger' dep to 'cli' feature
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:38:17 +02:00
Hannes Laimer
32b8ae982f router: add init_cli_logger helper function
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:37:07 +02:00
Wolfgang Bumiller
41d8747de3 metrics: check in d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-13 10:03:48 +02:00
Wolfgang Bumiller
b446456aa5 bump proxmox-metrics to 0.2.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-13 09:56:05 +02:00
Dominik Csapak
e12230d543 proxmox-metrics: send_data_to_channels: change from slice to IntoIterator
which is a bit generic and allows us to use e.g. a map result to be
passed here

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-13 09:53:47 +02:00