Commit Graph

2599 Commits

Author SHA1 Message Date
Dietmar Maurer
2f221df863 RateLimiter: add update_rate method 2021-11-10 09:51:08 +01:00
Dietmar Maurer
0c27d5da17 RateLimitedStream: implement peer_addr 2021-11-10 09:51:08 +01:00
Dietmar Maurer
e0a9982dd1 RateLimiter: avoid panic in time computations 2021-11-10 09:51:08 +01:00
Dietmar Maurer
e0305f724b RateLimitedStream: allow periodic limiter updates 2021-11-10 09:51:08 +01:00
Dietmar Maurer
00ca0b7fae HttpsConnector: use RateLimitedStream
So that we can limit used bandwidth.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-10 09:51:08 +01:00
Dietmar Maurer
ded24b3f4c RateLimitedStream: implement poll_write_vectored
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-10 09:51:08 +01:00
Dietmar Maurer
c94ad247b1 Implement a rate limiting stream (AsyncRead, AsyncWrite)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-10 09:51:08 +01:00
Fabian Grünbichler
e848148f5c websocket: adapt for client connection
previously, this was only used for the server side handling of web
sockets. by making the mask part of the WebSocket struct and making some
of the fns associated, we can re-use this for client-side connections
such as in proxmox-websocket-tunnel.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-11-09 15:45:56 +01:00
Wolfgang Bumiller
e0df53e793 bump proxmox-tfa to 1.2.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 13:27:59 +01:00
Wolfgang Bumiller
0156b3fe03 proxmox-tfa: add version field to u2f::AuthChallenge
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 13:27:59 +01:00
Wolfgang Bumiller
83934e59e6 proxmox-tfa: make u2f::AuthChallenge Clone + Debug
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 13:27:59 +01:00
Fabian Grünbichler
4128c5fdb5 updater: impl UpdaterType for Vec
by replacing the whole Vec.

if we ever want to support adding/removing/modifying elements of a Vec
via the Updater, we'd need to extend it anyway (or use a custom
updater).

Suggested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-11-09 09:18:08 +01:00
Wolfgang Bumiller
bc38ff7878 bump proxmox-tfa to 1.1.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-29 15:07:09 +02:00
Wolfgang Bumiller
1554465d45 proxmox-tfa: add Totp::digits
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-29 14:31:39 +02:00
Dominik Csapak
8e344d3d67 rrd: use saturating_sub to avoid underflow
Without this, the tests fail in debug mode.
Also having start (u64) underflow to a value greater than end does
not really make sense

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-28 12:54:54 +02:00
Wolfgang Bumiller
cb89d97df1 bump version to 0.3.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-21 13:14:10 +02:00
Dominik Csapak
4c5d899c3a directory: make meta object optional
some custom ACME endpoints do not have a TOS, and thus do not return
a meta property at all

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-21 13:09:42 +02:00
Wolfgang Bumiller
4f4fa80f2f bump proxmox to 0.15.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-21 12:44:12 +02:00
Wolfgang Bumiller
bdc7e9d145 proxmox: cleanup files on fsync errors
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-21 12:42:23 +02:00
Dietmar Maurer
a0cfb9c20d bump proxmox-http version to 0.5.1-1
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-21 07:37:30 +02:00
Dietmar Maurer
e9bea7b7ed use new fsync parameter to replace_file and atomic_open_or_create
Depend on proxmox 0.15.0 and proxmox-openid 0.8.1

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-21 07:28:32 +02:00
Dietmar Maurer
75ca726c29 use new fsync parameter to replace_file and atomic_open_or_create
Depend on proxmox 0.15.0 and proxmox-openid 0.8.1

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-21 07:28:32 +02:00
Dietmar Maurer
8ae297c8d2 proxmox: bump d/control
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-21 07:27:43 +02:00
Dietmar Maurer
8471451a7b bump version to 0.8.1-1
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-21 07:15:11 +02:00
Dietmar Maurer
6aa28f0a08 add fsync parameter to replace_file
Depend on proxmox 0.15.0

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-21 07:12:27 +02:00
Dietmar Maurer
bb089965c9 bump proxmox vertsion to 0.15.0-1
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-21 07:08:34 +02:00
Dietmar Maurer
b960bc3a4a add fsync parameter to replace_file and atomic_open_or_create
The fsync is required for consistency after power failure, so it should
be set when writing config files or otherwise important data.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-21 07:06:04 +02:00
Dominik Csapak
b87aa76b64 rest-server: use hashmap for parameter errors
our ui expects a map here with 'field: "error"'. This way it can mark
the relevant field as invalid and correctly shows the complete error
message

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-10-21 06:32:23 +02:00
Wolfgang Bumiller
ffd1d5f378 uuid: bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-20 12:50:26 +02:00
Wolfgang Bumiller
1f03763c3b uuid: fixup debcargo.toml to include uuid-dev dependency
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-20 12:49:40 +02:00
Dietmar Maurer
412712029c proxmox-rrd: use fsync instead of syncfs
syncfs can sync unrelated data, and we do not want that.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-20 11:46:59 +02:00
Dietmar Maurer
a7ee3455da proxmox-rrd: fix regression tests 2021-10-19 18:41:03 +02:00
Dietmar Maurer
86b50e18ed proxmox-rrd: improve dev docs
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-19 11:17:09 +02:00
Dietmar Maurer
ed6a7f52e5 proxmox-rrd: cleanup - impl FromStr for JournalEntry
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-19 11:17:09 +02:00
Dietmar Maurer
75bb60e7b3 proxmox-rrd: add option to avoid page cache for load/save
use fadvice(.., POSIX_FADV_DONTNEED) for RRD files. We read those files only once,
and always rewrite them.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-19 11:17:09 +02:00
Dietmar Maurer
336e8f3e7f proxmox-rrd: use syncfs after writing rrd files
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-10-19 11:17:09 +02:00
Dietmar Maurer
77c2e4668b proxmox-rrd: use fine grained locking in commit_journal_impl
Aquire the rrd_map lock for each file (else we block access for a long time)
2021-10-18 14:55:47 +02:00
Wolfgang Bumiller
8398620669 tfa: u2f: bytes_as_base64{,url} weren't meant to be public
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-18 14:31:04 +02:00
Dietmar Maurer
cc0bb59788 proxmox-rrd: log all errors from apply_and_commit_journal_thread (but only once) 2021-10-18 11:57:19 +02:00
Dietmar Maurer
e23f3ec774 proxmox-rrd: cleanup list_old_journals 2021-10-18 10:00:58 +02:00
Dietmar Maurer
a74384f725 proxmox-rrd: cleanup - use struct instead of tuple 2021-10-16 12:45:03 +02:00
Dietmar Maurer
4393b93a8b proxmox-rrd: move RRDMap into extra file 2021-10-16 12:45:03 +02:00
Dietmar Maurer
9dcc64b71a proxmox-rrd: move JournalState into extra file 2021-10-16 12:45:03 +02:00
Dietmar Maurer
30b4800f4f proxmox-rrd: implement non blocking journal
Do not block while applying the journal.
2021-10-16 12:45:03 +02:00
Dietmar Maurer
2c24c1dd22 proxmox-rrd: rename RRDCacheState to JournalState 2021-10-15 09:35:44 +02:00
Dietmar Maurer
2be07c2250 proxmox-rrd: avoild blocking readers while applying the journal
By using and extra RwLock<RRDMap> on the rrd data.
2021-10-15 09:22:07 +02:00
Dietmar Maurer
3275f1ac16 proxmox-rrd: log journal apply/flush times, split apply and flush
We need to apply the journal only once.
2021-10-15 07:16:41 +02:00
Dietmar Maurer
ec5d84f4d3 proxmox-rrd: cleanup - use slot_end_time() 2021-10-14 16:29:00 +02:00
Dietmar Maurer
2b9fb32de1 proxmox-rrd: cleanup - use staturating_add instead of if/else 2021-10-14 16:10:55 +02:00
Dietmar Maurer
26bd6a4f77 proxmox-rrd: improve dev docs 2021-10-14 11:53:54 +02:00