Commit Graph

2871 Commits

Author SHA1 Message Date
Thomas Lamprecht
610b147ba7 server/rest: fix new type ambiguity
basically the same as commit 5fb15b781e
Will be required once we get to use a newer rustc, at least the
client build for archlinux was broken due to this.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 21:24:44 +02:00
Wolfgang Bumiller
4dda9b5865 proxmox: constify CreateOptions methods and add helpers
Adds convenience helpers `.owner_root()`.
Unfortunately for the group equivalent `nix` needs to have
const `Gid` constructors...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-21 12:00:57 +02:00
Wolfgang Bumiller
6eef946e20 websocket: remove AsyncReadExt
style wise, bounds should refer to AsyncRead instead

also we don't actually use any of the Ext methods

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-15 13:14:55 +02:00
Wolfgang Bumiller
a6ff69404b bump version to 0.2.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-14 14:57:46 +02:00
Wolfgang Bumiller
558f51a167 make revocation workflow accessible without client
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-14 14:56:40 +02:00
Wolfgang Bumiller
31402407c4 bump proxmox to 0.11.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-14 12:04:35 +02:00
Wolfgang Bumiller
6729d41188 bump api-macro to 0.3.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-14 12:00:01 +02:00
Wolfgang Bumiller
cde2863a68 api-macro: fix Updatable path in generated derive attribute
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-14 11:58:32 +02:00
Wolfgang Bumiller
6fc95b8628 add proxmox::tools::serde::string_as_base64url_nopad
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-14 11:32:24 +02:00
Wolfgang Bumiller
b624fa1f3c bump version to 0.2.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-12 15:31:53 +02:00
Wolfgang Bumiller
a947050ec1 add util::Csr for CSR generation
This is essentially taken from pmg-rs and should be used
from there.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-12 14:54:21 +02:00
Wolfgang Bumiller
37b4c4f654 add is_valid to all Status enums
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-12 13:38:10 +02:00
Wolfgang Bumiller
5a70f0c392 add is_pending to all Status enums
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-12 13:32:40 +02:00
Thomas Lamprecht
ac49fbd472 enable tape backup by default
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-12 12:31:56 +02:00
Stefan Reiter
c80251ecca server/rest: add ApiAuth trait to make user auth generic
This allows switching the base user identification/authentication method
in the rest server. Will initially be used for single file restore VMs,
where authentication is based on a ticket file, not the PBS user
backend (PAM/local).

To avoid putting generic types into the RestServer type for this, we
merge the two calls "extract_auth_data" and "check_auth" into a single
one, which can use whatever type it wants internally.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-08 13:57:57 +02:00
Thomas Lamprecht
1b2a34166d server: rest: collapse nested if for less indentation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-07 17:57:46 +02:00
Thomas Lamprecht
27fca61f1b server: rest: switch from fastest to default deflate compression level
I made some comparision with bombardier[0], the one listed here are
30s looped requests with two concurrent clients:

[ static download of ext-all.js ]:
  lvl                              avg /   stdev  / max
 none        1.98 MiB  100 %    5.17ms /  1.30ms / 32.38ms
 fastest   813.14 KiB   42 %   20.53ms /  2.85ms / 58.71ms
 default   626.35 KiB   30 %   39.70ms /  3.98ms / 85.47ms

[ deterministic (pre-defined data), but real API call ]:
  lvl                              avg /   stdev  / max
 none      129.09 KiB  100 %    2.70ms / 471.58us / 26.93ms
 fastest    42.12 KiB   33 %    3.47ms / 606.46us / 32.42ms
 default    34.82 KiB   27 %    4.28ms / 737.99us / 33.75ms

The reduction is quite better with default, but it's also slower, but
only when testing over unconstrained network. For real world
scenarios where compression actually matters, e.g., when using a
spotty train connection, we will be faster again with better
compression.

A GPRS limited connection (Firefox developer console) requires the
following load (until the DOMContentLoaded event triggered) times:
  lvl        t      x faster
 none      9m 18.6s   x 1.0
 fastest   3m 20.0s   x 2.8
 default   2m 30.0s   x 3.7

So for worst case using sligthly more CPU time on the server has a
tremendous effect on the client load time.

Using a more realistical example and limiting for "Good 2G" gives:

 none      1m  1.8s   x 1.0
 fastest      22.6s   x 2.7
 default      16.6s   x 3.7

16s is somewhat OK, >1m just isn't...

So, use default level to ensure we get bearable load times on
clients, and if we want to improve transmission size AND speed then
we could always use a in-memory cache, only a few MiB would be
required for the compressable static files we server.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-07 17:57:42 +02:00
Dominik Csapak
692de3a903 server/rest: compress static files
compress them on the fly
and refactor the size limit for chunking files

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-07 12:34:31 +02:00
Dominik Csapak
376d90679c server/rest: compress api calls
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-07 12:34:31 +02:00
Dominik Csapak
c2a1c87039 server/rest: add helper to extract compression headers
for now we only extract 'deflate'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-07 12:34:31 +02:00
Dominik Csapak
a06d3892fe tools/compression: add DeflateEncoder and helpers
implements a deflate encoder that can compress anything that implements
AsyncRead + Unpin into a file with the helper 'compress'

if the inner type is a Stream, it implements Stream itself, this way
some streaming data can be streamed compressed

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-07 12:34:31 +02:00
Dominik Csapak
d28249c290 tools: add compression module
only contains a basic enum for the different compresssion methods

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-07 12:34:31 +02:00
Wolfgang Bumiller
c735b4bde0 api: enable Updater for usize, isize, f32, f64, char
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-07 10:48:46 +02:00
Thomas Lamprecht
7334107fae server/rest: drop now unused imports
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-01 11:53:13 +02:00
Stefan Reiter
25a14e8eb6 server/rest: extract auth to seperate module
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-01 11:26:28 +02:00
Thomas Lamprecht
5fb15b781e server/rest: fix type ambiguity
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-29 12:02:30 +02:00
Thomas Lamprecht
45a652c26f server/rest: rust format
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-29 08:17:26 +02:00
Wolfgang Bumiller
248335df36 api-macro: fix dev-dep versions
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-24 11:20:23 +01:00
Wolfgang Bumiller
afc59f6d15 add more of the ACME workflow to 'Account'
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-18 11:36:42 +01:00
Wolfgang Bumiller
02ecbb499c bump version to 0.1.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-17 15:28:55 +01:00
Wolfgang Bumiller
5aee14ac00 collect extra account fields in AccountData
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-17 15:20:50 +01:00
Wolfgang Bumiller
d369de8636 bump version to 0.1.3-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-17 13:35:49 +01:00
Wolfgang Bumiller
937a99a2e1 fix ec signature padding
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-17 13:32:57 +01:00
Wolfgang Bumiller
549b52cf68 don't serialize 'null' for 'expires' when ordering
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-17 12:24:21 +01:00
Wolfgang Bumiller
15fae62c15 bump version to 0.1.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-12 15:43:40 +01:00
Wolfgang Bumiller
ca0f57290f explicitly pass Content-Length header
pebble refuses to cooperate without it

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-10 12:01:00 +01:00
Wolfgang Bumiller
c9f137a093 bump version to 0.1.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-09 13:23:27 +01:00
Wolfgang Bumiller
cbfeb58ce4 make AccountData fields public
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-09 13:22:52 +01:00
Wolfgang Bumiller
aa23068293 import
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-09 13:07:59 +01:00
Dietmar Maurer
9dbc5f47ca ui: enable experimental tape UI if tape.cfg exists 2021-03-03 09:02:02 +01:00
Wolfgang Bumiller
1fce0ff41d bump proxmox to 0.11.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-25 09:21:14 +01:00
Wolfgang Bumiller
53146006b5 fmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-25 09:16:44 +01:00
Wolfgang Bumiller
8ce46932d6 use Send+Sync on dyn ObjectSchemaType
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-25 09:16:38 +01:00
Wolfgang Bumiller
42eb380917 support AllOfSchemas in section_config
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-24 14:48:21 +01:00
Wolfgang Bumiller
e2975598ad get rid of associated type in ObjectSchemaType trait
The AllOfProperties Iterator is capable of also being the
Iterator for the regular ObjectSchemas by simply filling it
like it was the "last" object type in an AllOf.

This makes the ObjectSchemaType trait more usable later.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-24 14:43:21 +01:00
Wolfgang Bumiller
adcbf7cab8 AllOfSchema support in parse_property_string
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-24 13:40:50 +01:00
Wolfgang Bumiller
12a6846a03 fix AllOfSchema::lookup to allow nesting
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-24 13:34:06 +01:00
Wolfgang Bumiller
bd4f9a313b proxmox: bump api-macro dep to 0.3.3
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-24 09:38:32 +01:00
Wolfgang Bumiller
1f6a2a66c9 bump api-macro to 0.3.3-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-24 09:37:30 +01:00
Wolfgang Bumiller
857b8ab2b9 Updater: take serde renames into account
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-24 09:21:52 +01:00