Commit Graph

6095 Commits

Author SHA1 Message Date
Thomas Lamprecht ce3c7a1bda ui: sync job: allow to configure rate limit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 12:20:27 +01:00
Thomas Lamprecht 50a39bbc1f ui: datastore content: rework rendering protection state
avoid that there's the same icon rendered twice, once clickable and
once as status. Also indicate the protection with a literal text and
by highlighting the single shield with green, if protected.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 11:22:29 +01:00
Wolfgang Bumiller 154d01b042 d/control and Cargo.toml bumps
* pin-utils isn't used anymore
* proxmox-sys version should also be tracked in Cargo.toml

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-22 10:56:36 +01:00
Thomas Lamprecht 1f3352018b ui: traffic-control edit: add spaces between networks for more readabillity
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 10:45:29 +01:00
Thomas Lamprecht b721783c48 d/control: bump versioned build-dependency to librust-proxmox-sys
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 10:41:56 +01:00
Thomas Lamprecht 76ee3085a4 ui: traffic-control edit: simple duplicate networks detection
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 10:30:17 +01:00
Thomas Lamprecht 5d5a53059f ui: traffic-control edit: move on-load set value logic to own method
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 10:30:17 +01:00
Thomas Lamprecht 77d8c593b3 ui: traffic-control edit: simpler unique timeframe logic
still just a heuristic, i.e., it does the same as previously but in
one line..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 10:30:17 +01:00
Thomas Lamprecht c450a3cafd ui: traffic-control edit: there's no 'network-select' anymore
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 10:30:17 +01:00
Thomas Lamprecht f8f4d7cab4 ui: traffic-control edit: avoid CIDR literals in gettext
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 10:30:17 +01:00
Dominik Csapak 91abfef049 ui: traffic-control: include ipv6 in 'all' networks
by including '::/0' too

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 10:30:17 +01:00
Dominik Csapak 963b7ec51b ui: traffic-control: fix sending network value
we forgot to correclty send the network value as we changed from
the radiogroup to a simple text field

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 10:30:17 +01:00
Dominik Csapak 16aab0c137 ui: indentation fix
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 10:30:17 +01:00
Thomas Lamprecht bf8b8be976 ui: fix group-filter property name
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 09:13:32 +01:00
Dietmar Maurer e201104d0b docs: update traffic control docs (use HumanBytes)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-22 09:07:05 +01:00
Dietmar Maurer d63db0863d proxmox-backup-manager traffic: render data human readable
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-22 09:07:05 +01:00
Dietmar Maurer 7a36833103 fix sync job regression test (add RateLimitConfig)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-22 08:29:43 +01:00
Dietmar Maurer ca6e66aa5a Fingerprint: add new signature method
commit c42a54795d introcuded a bug by
using fp.to_string(). Replace this with fp.signature() which correctly
returns the full fingerprint instead of the short version.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-22 08:29:43 +01:00
Dominik Csapak 94a6b33680 set default for 'protected' flag
otherwise we cannot properly parse the api return value from older
versions, since that field does not exist there.

fixes sync from older versions without the protected feature

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-22 08:28:37 +01:00
Dietmar Maurer 2d5287fbbc use RateLimitConfig for HttpClient and pull
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-22 07:49:41 +01:00
Dietmar Maurer 6eb756bcab sync-job: add rate limit
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-22 07:49:41 +01:00
Dietmar Maurer 5647219049 pbs-api-types: split out type RateLimitConfig 2021-11-22 07:49:41 +01:00
Thomas Lamprecht b810972823 bump version to 2.1.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-21 10:32:17 +01:00
Thomas Lamprecht 3a07cdf574 d/control: bump versioned dependency for proxmox-widget-toolkit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-21 10:32:17 +01:00
Dietmar Maurer 193ec30c2b fix proxmox-backup-manager sync-job list
Property is called 'group-filter' (not 'groups').
2021-11-21 09:46:46 +01:00
Dietmar Maurer c94723062c pbs-api-types: fix HumanByte::auto_scale 2021-11-21 09:13:02 +01:00
Thomas Lamprecht 0eadfdf670 ui: traffic-control edit: fix name minLength (3 not 4)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 22:33:32 +01:00
Thomas Lamprecht ebf8ce20bc ui: traffic-control view: tune column width, add more flex
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 22:32:53 +01:00
Thomas Lamprecht e7acdde758 ui: traffic-control edit: make window taller for more common ratio
and add timeframe emptyText

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 22:09:41 +01:00
Thomas Lamprecht f2c9da2349 ui: traffic-control edit: send rates as stringified, auto-scaled size-unit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 22:08:22 +01:00
Thomas Lamprecht ff344655e2 ui: traffic-control edit: make network edit a single text field
here's to note that the radio-group was my idea, Dominik just
executed it, nicely that is.

But, the panel looks a bit glitchy layout wise as with that and the
bandwidth fields (maybe we should render their unit inline) the
vertical alignments were all over the place.

So for now make it a simple text field and throw in a tooltip for
good measurement

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 22:04:59 +01:00
Thomas Lamprecht 3490d9460c ui: traffic-control edit: very simple duplicate timeframe detection
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 22:04:01 +01:00
Thomas Lamprecht fdf9373f9e ui: traffic-control edit: handle empty time-frame correctly
delete on update and avoid sending an empty string in any case, the
backend does not likes that much.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 22:02:47 +01:00
Thomas Lamprecht ba80611324 ui: traffic-control view: various code cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 21:54:55 +01:00
Thomas Lamprecht 07a579c632 ui: traffic-control view: time frames are optional so avoid render exception
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 21:54:22 +01:00
Thomas Lamprecht 188a37fbed ui: traffic-control view: make rendere more flexible
do not choke on non-numbers but use the (partially new) widget
toolkit helpers to also be able to parse string based sizes with
units and auto-scale them

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 21:52:31 +01:00
Thomas Lamprecht f251367c33 ui: navigation: change traffic-control icon to rotated signal
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 21:43:03 +01:00
Dominik Csapak ac4e399a10 ui: add Traffic Control UI
adds a list of traffic control rules (with their current usage)
and let the user add/edit/remove them

the edit window currently has a grid for timeframes to add/remove
with input fields for start/endtime and checkboxes for the days

there are still some improvements possible, like having a seperate
grid for networks (the input field is maybe too small), or
optimizing consecutive days to a range (e.g. mon..wed instead of mon,tue,wed)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-20 19:40:59 +01:00
Dominik Csapak 4fe77c36df api: traffic_control: add missing rename to 'kebab-case'
otherwise the 'delete' properties need underscores
(e.g. 'burst_in' instead of 'burst-in')

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-20 19:40:30 +01:00
Dietmar Maurer 118515dbd0 use HumanByte for traffic-control config
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 19:35:24 +01:00
Thomas Lamprecht 42ba4cd399 human byte: make proper proxmox API type
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 19:35:24 +01:00
Thomas Lamprecht ab1c07a622 human byte: add from string parser
Adapted from Dietmar's v3 on pbs-devel but some changes:
- reworked with a strip_suffix fn that does matching, way shorter and
  even easier to read IMO
- make b/B byte symbol fully optional, not just for base-10
- also trim trailing whitespace for SizeUnit::Byte
- simplify the FromStr impl
- adapt parser unit tests such that we actually see the failed test's
  definition line, simplifies debugging a bit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 19:35:24 +01:00
Thomas Lamprecht 930a71460f human byte: add proper unit type and support base-10
The new SizeUnit type takes over the auto scaling logic and could be
used on its own too.

Switch the internal type of HumanByte from u64 to f64, this results
in a slight reduce of usable sizes we can represent (there's no
unsigned float type after all) but we support pebibyte now with quite
the precision and ebibytes should be also work out ok, and that
really should us have covered for a while..

Partially adapted by Dietmar's version, but split up and change so:
* there's no None type, for a SizeUnit that does not makes much sense
* print the unit for byte too, better consistency and one can still
  use as_u64() or as_f64() if they do not want/need the unit rendered
* left the "From usize/u64" impls intact, just convenient to have and
  avoids all over the tree changes to adapt to loosing that
* move auto-scaling into SizeUnit, good fit there and I could see
  some re-use potential for non-human-byte users in the future
* impl Display for SizeUnit instead of the separate unit_str method,
  better usability as it can be used directly in format (with zero
  alloc/copy) and saw no real reason of not having that this way
* switch the place where we auto-scale in HumanByte's to the new_X
  helpers which allows for slightly reduced code usage and simplify
  implementation where possible
* use rounding for the precision limit algorithm. This is a stupid
  problem as in practices there are cases for requiring every variant:
  - flooring would be good for limits, better less than to much
  - ceiling would be good for file sizes, to less can mean ENOSPACE
    and user getting angry if their working value is messed with
  - rounding can be good for rendering benchmark, closer to reality
    and no real impact
  So going always for rounding is really not the best solution..

Some of those changes where naturally opinionated, if there's a good
practical reason we can switch back (or to something completely
different).

The single thing I kept and am not _that_ happy with is being able to
have fractional bytes (1.1 B or even 0.01 B), which just does not
makes much sense as most of those values cannot exist at all in
reality - I say most as multiple of 1/8 Byte can exists, those are
bits.o

Note, the precission also changed from fixed 2 to max 3 (trailing
zeros stripped), while that can be nice we should see if we get
a better precision limiting algorithm, e.g., directly in the printer.
Rust sadly does not supports "limit to precision of 3 but avoid
trailing zeros" so we'd need to adapt their Grisu based algorithm our
own - way to much complexity for this though..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 19:35:24 +01:00
Thomas Lamprecht a58a5cf795 move HumanByte to pbs-abi-types crate
Originally-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-20 19:35:24 +01:00
Dietmar Maurer 92a8f0bc82 depend on proxmox-async 0.2 2021-11-20 17:14:02 +01:00
Dietmar Maurer bf298a16ef proxmox-rest-server: remove pbs-tools dependency 2021-11-19 18:06:54 +01:00
Dietmar Maurer 9a1b24b6b1 use new proxmox-async crate
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-19 18:03:22 +01:00
Fabian Grünbichler ea67cd70c9 tfa: handle incompatible challenge data
by returning default data, in case the challenge data is not parseable.
this allows a new challenge to be started for the userid in question
without manual cleanup.

currently this can be triggered if an ongoing challenge created with
webauthn-rs 0.2.5 is stored in /run and attempted to be read
post-upgrade.

Reported-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-11-19 14:12:31 +01:00
Wolfgang Bumiller 281a5dd1fc cleanup unused re-exports
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-19 12:49:46 +01:00
Wolfgang Bumiller df3b3d1798 bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-19 12:22:44 +01:00