]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
2 years agoadapt compute_next_event to new signature
Dominik Csapak [Wed, 1 Dec 2021 08:45:07 +0000 (09:45 +0100)]
adapt compute_next_event to new signature

the 'utc' flag is now contained in the event itself and not given
as a flag to 'compute_next_event' anymore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoui: group filter: merge duplicate filters
Thomas Lamprecht [Wed, 1 Dec 2021 13:30:38 +0000 (14:30 +0100)]
ui: group filter: merge duplicate filters

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: group filter: cleanup and comment more
Thomas Lamprecht [Wed, 1 Dec 2021 13:29:08 +0000 (14:29 +0100)]
ui: group filter: cleanup and comment more

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: form/GroupFilter: copy records for the pbsGroupSelectors
Dominik Csapak [Wed, 1 Dec 2021 10:57:08 +0000 (11:57 +0100)]
ui: form/GroupFilter: copy records for the pbsGroupSelectors

store.getData() returns an 'Ext.util.Collection' which is a special
class that does more than being an array of records. Namely, it can
have 'observers' which can react on the change of the collection

Here, the 'onWidgetAttach' callback will be called twice on the first
row add and the widgets (and thus stores) are cached by extjs. When
doing a 'setData' of a Collection, it tries to add the store as an
observer, but due to the above caching and multiple calling this fails
since the store is already an observer.

For this reason, we want to actually copy the records (which neither
the store, nor the Collection has a method for...)

This gives us an additional benefit: The different pbsGroupSelectors can
sort independently now, before it was all linked to the original store's
collection.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: form/GroupFilter: improve group load callback handling
Dominik Csapak [Wed, 1 Dec 2021 10:57:07 +0000 (11:57 +0100)]
ui: form/GroupFilter: improve group load callback handling

if 'me' is already destroyed here, return
if records is 'null' (which can happen on a not successful load),
load an empty list instead

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: form/GroupFilter: correctly resolve the reference cycle
Dominik Csapak [Wed, 1 Dec 2021 10:57:06 +0000 (11:57 +0100)]
ui: form/GroupFilter: correctly resolve the reference cycle

'record[widget]' does not contain anything since the widgets are
in the 'widgets' property so delete that

we also have to remove the 'record' entry of the widget so that
the widget does not have a link to the record anymore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix broken format strings
Fabian Grünbichler [Mon, 29 Nov 2021 13:16:18 +0000 (14:16 +0100)]
fix broken format strings

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agodeps: env_logger update to 0.9
Fabian Grünbichler [Mon, 29 Nov 2021 13:10:04 +0000 (14:10 +0100)]
deps: env_logger update to 0.9

and removal from main crate, not needed there anymore.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agopbs-api-types: remove proxmox-sys dependency for target wasm
Dietmar Maurer [Wed, 1 Dec 2021 08:49:52 +0000 (09:49 +0100)]
pbs-api-types: remove proxmox-sys dependency for target wasm

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agopbs-api-types: remove openssl dependency for target wasm
Dietmar Maurer [Wed, 1 Dec 2021 08:28:47 +0000 (09:28 +0100)]
pbs-api-types: remove openssl dependency for target wasm

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agopbs-api-types: remove libc dependency
Dietmar Maurer [Wed, 1 Dec 2021 08:10:25 +0000 (09:10 +0100)]
pbs-api-types: remove libc dependency

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agopbs-api-types: removbe usused nix dependency
Dietmar Maurer [Wed, 1 Dec 2021 08:08:25 +0000 (09:08 +0100)]
pbs-api-types: removbe usused nix dependency

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoremove use of deprecated functions from proxmox-time
Dominik Csapak [Tue, 30 Nov 2021 12:12:09 +0000 (13:12 +0100)]
remove use of deprecated functions from proxmox-time

Depend on proxmox-time 1.1.1

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoui: SyncJobEdit: add second tab with group filters
Dominik Csapak [Mon, 29 Nov 2021 14:39:43 +0000 (15:39 +0100)]
ui: SyncJobEdit: add second tab with group filters

adds a second tab and adapts the styling to our usual one (border/padding)

adds a change listener to the remote datastore selector to change the
remote + datastore on the group filters

remaining changes are mostly indentation changes

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: tape/BackupJobEdit: add second tab with group filters
Dominik Csapak [Mon, 29 Nov 2021 14:39:42 +0000 (15:39 +0100)]
ui: tape/BackupJobEdit: add second tab with group filters

adds a second tab and adapts the styling to our usual one (border/padding)

adds a change listener to the datastore selector to change it on the
group filters

remaining changes are mostly indentation changes

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: add GroupFilter form field(container)
Dominik Csapak [Mon, 29 Nov 2021 14:39:41 +0000 (15:39 +0100)]
ui: add GroupFilter form field(container)

this contains a grid + button + hidden field which lets the user
add group filters one by one. the first column is the type selector
(type, group, regex) and the second column shows the relevant
input field (groupselector, kvcombobox for type, and textfield for regex)

i had to hack a little to get access to the widgets of the
fieldcontainer, since we cannot simply access the widget of a column
from another column (which we need to show the correct one when changing
the type), also we cannot traverse the widget hirachy in the usual way,
since extjs seems to build it differently for widgetcolumns.

to solve this, i added references of the widgets to the record, and a
reference of the record to the widgets. since this is now a cyclic
reference, i solve that in 'removeFilter' and in 'beforedestroy' of the grid
by removing the references again

also contains a small css style to remove the padding in the rows

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: add GroupSelector
Dominik Csapak [Mon, 29 Nov 2021 14:39:40 +0000 (15:39 +0100)]
ui: add GroupSelector

to select either a group from a datastore

for now it is expected to set the data in the store manually

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agofix a warning in io_return macro
Wolfgang Bumiller [Mon, 29 Nov 2021 10:26:24 +0000 (11:26 +0100)]
fix a warning in io_return macro

newer compilers warn about the semicolon there, so put
braces around it

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoremove unused identity macro
Wolfgang Bumiller [Mon, 29 Nov 2021 10:24:02 +0000 (11:24 +0100)]
remove unused identity macro

this is not required anymore by the sortable macro

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump d/control
Wolfgang Bumiller [Mon, 29 Nov 2021 10:20:52 +0000 (11:20 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoupdate proxmox-tfa to 2.0
Wolfgang Bumiller [Mon, 29 Nov 2021 10:19:49 +0000 (11:19 +0100)]
update proxmox-tfa to 2.0

and fix still-very-bad updater usage in config api call...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-tape: do not depend on pbs-tools
Dietmar Maurer [Thu, 25 Nov 2021 12:17:58 +0000 (13:17 +0100)]
pbs-tape: do not depend on pbs-tools

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agofix typo in comment
Dietmar Maurer [Thu, 25 Nov 2021 12:15:35 +0000 (13:15 +0100)]
fix typo in comment

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agouse proxmox-sys 0.2.1 and proxmox-io 1.0.1
Dietmar Maurer [Thu, 25 Nov 2021 11:30:03 +0000 (12:30 +0100)]
use proxmox-sys 0.2.1 and proxmox-io 1.0.1

And remove unused code from pbs-tools.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agomove pbs-tools/src/percent_encoding.rs to pbs-api-types/src/percent_encoding.rs
Dietmar Maurer [Thu, 25 Nov 2021 10:48:52 +0000 (11:48 +0100)]
move pbs-tools/src/percent_encoding.rs to pbs-api-types/src/percent_encoding.rs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agofix StdChannelWriter usage
Dietmar Maurer [Thu, 25 Nov 2021 10:27:20 +0000 (11:27 +0100)]
fix StdChannelWriter usage

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoStdChannelWriter: avoid using anyhow::Error
Dietmar Maurer [Thu, 25 Nov 2021 10:14:56 +0000 (11:14 +0100)]
StdChannelWriter: avoid using anyhow::Error

Use a generic implementation to allow different error types.

2 years agomove pbs-tools/src/str.rs to pbs-client/src/pxar/create.rs
Dietmar Maurer [Thu, 25 Nov 2021 09:43:22 +0000 (10:43 +0100)]
move pbs-tools/src/str.rs to pbs-client/src/pxar/create.rs

Code is only used there.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoremove trait BufferedRead from pbs-tools/src/io.rs
Dietmar Maurer [Thu, 25 Nov 2021 08:45:47 +0000 (09:45 +0100)]
remove trait BufferedRead from pbs-tools/src/io.rs

We do not need it.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoremove pbs-tools/src/sys.rs
Dietmar Maurer [Thu, 25 Nov 2021 07:52:17 +0000 (08:52 +0100)]
remove pbs-tools/src/sys.rs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoremove pbs-tools/src/cli.rs
Dietmar Maurer [Thu, 25 Nov 2021 07:33:10 +0000 (08:33 +0100)]
remove pbs-tools/src/cli.rs

Code is only used once in src/bin/proxmox_backup_debug/inspect.rs, so
move it into that file.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoopenid_login: improve error message for disabled users.
Dietmar Maurer [Thu, 25 Nov 2021 06:29:33 +0000 (07:29 +0100)]
openid_login: improve error message for disabled users.

2 years agoupdate debian/control
Dietmar Maurer [Thu, 25 Nov 2021 05:49:26 +0000 (06:49 +0100)]
update debian/control

2 years agopbs-datastore: use hex::serde feature
Dietmar Maurer [Wed, 24 Nov 2021 12:02:22 +0000 (13:02 +0100)]
pbs-datastore: use hex::serde feature

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agodebian/control: add librust-proxmox-serde
Dietmar Maurer [Wed, 24 Nov 2021 09:58:01 +0000 (10:58 +0100)]
debian/control: add librust-proxmox-serde

2 years agoupdate to proxmox-sys 0.2 crate
Dietmar Maurer [Tue, 23 Nov 2021 16:57:00 +0000 (17:57 +0100)]
update to proxmox-sys 0.2 crate

- imported pbs-api-types/src/common_regex.rs from old proxmox crate
- use hex crate to generate/parse hex digest
- remove all reference to proxmox crate (use proxmox-sys and
  proxmox-serde instead)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agobump version to 2.1.2-1 2.1.1 2.1.2 v2.1.2
Thomas Lamprecht [Tue, 23 Nov 2021 12:56:36 +0000 (13:56 +0100)]
bump version to 2.1.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: remotes: note that protected flags will not be synced
Dominik Csapak [Tue, 23 Nov 2021 09:54:24 +0000 (10:54 +0100)]
docs: remotes: note that protected flags will not be synced

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodocs: backup-client: fix wrong ':ref:'
Dominik Csapak [Tue, 23 Nov 2021 09:54:23 +0000 (10:54 +0100)]
docs: backup-client: fix wrong ':ref:'

there is no 'backup server' reference we can link to here, and it would
not make sense anyway.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agosync job: correctly apply rate limit
Dietmar Maurer [Tue, 23 Nov 2021 08:40:59 +0000 (09:40 +0100)]
sync job: correctly apply rate limit

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agobump version to 2.1.1-2
Thomas Lamprecht [Mon, 22 Nov 2021 15:07:42 +0000 (16:07 +0100)]
bump version to 2.1.1-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: add/update tc related screenshots & content, document tc for sync-job
Thomas Lamprecht [Mon, 22 Nov 2021 15:05:16 +0000 (16:05 +0100)]
docs: add/update tc related screenshots & content, document tc for sync-job

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.1.1-1
Thomas Lamprecht [Mon, 22 Nov 2021 11:27:22 +0000 (12:27 +0100)]
bump version to 2.1.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: sync job: allow to configure rate limit
Thomas Lamprecht [Mon, 22 Nov 2021 11:20:27 +0000 (12:20 +0100)]
ui: sync job: allow to configure rate limit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: datastore content: rework rendering protection state
Thomas Lamprecht [Mon, 22 Nov 2021 10:21:23 +0000 (11:21 +0100)]
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>
2 years agod/control and Cargo.toml bumps
Wolfgang Bumiller [Mon, 22 Nov 2021 09:55:38 +0000 (10:55 +0100)]
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>
2 years agoui: traffic-control edit: add spaces between networks for more readabillity
Thomas Lamprecht [Mon, 22 Nov 2021 09:45:29 +0000 (10:45 +0100)]
ui: traffic-control edit: add spaces between networks for more readabillity

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: bump versioned build-dependency to librust-proxmox-sys
Thomas Lamprecht [Mon, 22 Nov 2021 09:41:56 +0000 (10:41 +0100)]
d/control: bump versioned build-dependency to librust-proxmox-sys

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: traffic-control edit: simple duplicate networks detection
Thomas Lamprecht [Mon, 22 Nov 2021 09:26:13 +0000 (10:26 +0100)]
ui: traffic-control edit: simple duplicate networks detection

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: traffic-control edit: move on-load set value logic to own method
Thomas Lamprecht [Mon, 22 Nov 2021 09:25:06 +0000 (10:25 +0100)]
ui: traffic-control edit: move on-load set value logic to own method

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: traffic-control edit: simpler unique timeframe logic
Thomas Lamprecht [Mon, 22 Nov 2021 09:25:38 +0000 (10:25 +0100)]
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>
2 years agoui: traffic-control edit: there's no 'network-select' anymore
Thomas Lamprecht [Mon, 22 Nov 2021 09:26:47 +0000 (10:26 +0100)]
ui: traffic-control edit: there's no 'network-select' anymore

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: traffic-control edit: avoid CIDR literals in gettext
Thomas Lamprecht [Mon, 22 Nov 2021 08:21:43 +0000 (09:21 +0100)]
ui: traffic-control edit: avoid CIDR literals in gettext

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: traffic-control: include ipv6 in 'all' networks
Dominik Csapak [Mon, 22 Nov 2021 08:09:35 +0000 (09:09 +0100)]
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>
2 years agoui: traffic-control: fix sending network value
Dominik Csapak [Mon, 22 Nov 2021 08:09:34 +0000 (09:09 +0100)]
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>
2 years agoui: indentation fix
Dominik Csapak [Mon, 22 Nov 2021 08:09:33 +0000 (09:09 +0100)]
ui: indentation fix

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: fix group-filter property name
Thomas Lamprecht [Mon, 22 Nov 2021 08:02:04 +0000 (09:02 +0100)]
ui: fix group-filter property name

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: update traffic control docs (use HumanBytes)
Dietmar Maurer [Mon, 22 Nov 2021 08:05:01 +0000 (09:05 +0100)]
docs: update traffic control docs (use HumanBytes)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoproxmox-backup-manager traffic: render data human readable
Dietmar Maurer [Mon, 22 Nov 2021 08:06:07 +0000 (09:06 +0100)]
proxmox-backup-manager traffic: render data human readable

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agofix sync job regression test (add RateLimitConfig)
Dietmar Maurer [Mon, 22 Nov 2021 07:28:54 +0000 (08:28 +0100)]
fix sync job regression test (add RateLimitConfig)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoFingerprint: add new signature method
Dietmar Maurer [Mon, 22 Nov 2021 07:19:09 +0000 (08:19 +0100)]
Fingerprint: add new signature method

commit c42a54795df332cd778a53ea500b901ae873c81d 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>
2 years agoset default for 'protected' flag
Dominik Csapak [Tue, 16 Nov 2021 09:21:05 +0000 (10:21 +0100)]
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>
2 years agouse RateLimitConfig for HttpClient and pull
Dietmar Maurer [Mon, 22 Nov 2021 05:26:55 +0000 (06:26 +0100)]
use RateLimitConfig for HttpClient and pull

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agosync-job: add rate limit
Dietmar Maurer [Sun, 21 Nov 2021 09:29:58 +0000 (10:29 +0100)]
sync-job: add rate limit

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agopbs-api-types: split out type RateLimitConfig
Dietmar Maurer [Sun, 21 Nov 2021 09:20:41 +0000 (10:20 +0100)]
pbs-api-types: split out type RateLimitConfig

2 years agobump version to 2.1.0-1
Thomas Lamprecht [Sat, 20 Nov 2021 21:45:50 +0000 (22:45 +0100)]
bump version to 2.1.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: bump versioned dependency for proxmox-widget-toolkit
Thomas Lamprecht [Sat, 20 Nov 2021 21:43:44 +0000 (22:43 +0100)]
d/control: bump versioned dependency for proxmox-widget-toolkit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix proxmox-backup-manager sync-job list
Dietmar Maurer [Sun, 21 Nov 2021 08:46:46 +0000 (09:46 +0100)]
fix proxmox-backup-manager sync-job list

Property is called 'group-filter' (not 'groups').

2 years agopbs-api-types: fix HumanByte::auto_scale
Dietmar Maurer [Sun, 21 Nov 2021 08:13:02 +0000 (09:13 +0100)]
pbs-api-types: fix HumanByte::auto_scale

2 years agoui: traffic-control edit: fix name minLength (3 not 4)
Thomas Lamprecht [Sat, 20 Nov 2021 21:33:32 +0000 (22:33 +0100)]
ui: traffic-control edit: fix name minLength (3 not 4)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: traffic-control view: tune column width, add more flex
Thomas Lamprecht [Sat, 20 Nov 2021 21:32:02 +0000 (22:32 +0100)]
ui: traffic-control view: tune column width, add more flex

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: traffic-control edit: make window taller for more common ratio
Thomas Lamprecht [Sat, 20 Nov 2021 21:09:39 +0000 (22:09 +0100)]
ui: traffic-control edit: make window taller for more common ratio

and add timeframe emptyText

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: traffic-control edit: send rates as stringified, auto-scaled size-unit
Thomas Lamprecht [Sat, 20 Nov 2021 21:08:22 +0000 (22:08 +0100)]
ui: traffic-control edit: send rates as stringified, auto-scaled size-unit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: traffic-control edit: make network edit a single text field
Thomas Lamprecht [Sat, 20 Nov 2021 21:04:57 +0000 (22:04 +0100)]
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>
2 years agoui: traffic-control edit: very simple duplicate timeframe detection
Thomas Lamprecht [Sat, 20 Nov 2021 21:03:58 +0000 (22:03 +0100)]
ui: traffic-control edit: very simple duplicate timeframe detection

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: traffic-control edit: handle empty time-frame correctly
Thomas Lamprecht [Sat, 20 Nov 2021 20:56:12 +0000 (21:56 +0100)]
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>
2 years agoui: traffic-control view: various code cleanups
Thomas Lamprecht [Sat, 20 Nov 2021 20:54:53 +0000 (21:54 +0100)]
ui: traffic-control view: various code cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: traffic-control view: time frames are optional so avoid render exception
Thomas Lamprecht [Sat, 20 Nov 2021 20:54:22 +0000 (21:54 +0100)]
ui: traffic-control view: time frames are optional so avoid render exception

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: traffic-control view: make rendere more flexible
Thomas Lamprecht [Sat, 20 Nov 2021 20:52:29 +0000 (21:52 +0100)]
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>
2 years agoui: navigation: change traffic-control icon to rotated signal
Thomas Lamprecht [Sat, 20 Nov 2021 20:43:03 +0000 (21:43 +0100)]
ui: navigation: change traffic-control icon to rotated signal

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: add Traffic Control UI
Dominik Csapak [Fri, 19 Nov 2021 14:42:27 +0000 (15:42 +0100)]
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>
2 years agoapi: traffic_control: add missing rename to 'kebab-case'
Dominik Csapak [Fri, 19 Nov 2021 14:42:26 +0000 (15:42 +0100)]
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>
2 years agouse HumanByte for traffic-control config
Dietmar Maurer [Thu, 18 Nov 2021 07:29:22 +0000 (08:29 +0100)]
use HumanByte for traffic-control config

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agohuman byte: make proper proxmox API type
Thomas Lamprecht [Sat, 20 Nov 2021 17:21:53 +0000 (18:21 +0100)]
human byte: make proper proxmox API type

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agohuman byte: add from string parser
Thomas Lamprecht [Sat, 20 Nov 2021 17:21:33 +0000 (18:21 +0100)]
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>
2 years agohuman byte: add proper unit type and support base-10
Thomas Lamprecht [Sat, 20 Nov 2021 16:32:16 +0000 (17:32 +0100)]
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>
2 years agomove HumanByte to pbs-abi-types crate
Thomas Lamprecht [Fri, 19 Nov 2021 12:48:38 +0000 (13:48 +0100)]
move HumanByte to pbs-abi-types crate

Originally-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodepend on proxmox-async 0.2
Dietmar Maurer [Sat, 20 Nov 2021 16:14:02 +0000 (17:14 +0100)]
depend on proxmox-async 0.2

2 years agoproxmox-rest-server: remove pbs-tools dependency
Dietmar Maurer [Fri, 19 Nov 2021 17:06:54 +0000 (18:06 +0100)]
proxmox-rest-server: remove pbs-tools dependency

2 years agouse new proxmox-async crate
Dietmar Maurer [Fri, 19 Nov 2021 16:36:06 +0000 (17:36 +0100)]
use new proxmox-async crate

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agotfa: handle incompatible challenge data
Fabian Grünbichler [Fri, 19 Nov 2021 13:10:57 +0000 (14:10 +0100)]
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>
2 years agocleanup unused re-exports
Wolfgang Bumiller [Fri, 19 Nov 2021 11:49:46 +0000 (12:49 +0100)]
cleanup unused re-exports

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump d/control
Wolfgang Bumiller [Thu, 18 Nov 2021 13:19:08 +0000 (14:19 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agowebauthn: correctly set origin when updating
Fabian Grünbichler [Thu, 18 Nov 2021 13:13:06 +0000 (14:13 +0100)]
webauthn: correctly set origin when updating

with current proxmox-tfa this became a hard error, since origin and rp
are not both Strings anymore..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoupdate to base64 0.13
Fabian Grünbichler [Thu, 18 Nov 2021 13:12:59 +0000 (14:12 +0100)]
update to base64 0.13

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agofix debian/control: include librust-proxmox-sys
Dietmar Maurer [Fri, 19 Nov 2021 10:35:28 +0000 (11:35 +0100)]
fix debian/control: include librust-proxmox-sys

2 years agouse new proxmox-sys crate
Dietmar Maurer [Fri, 19 Nov 2021 09:51:41 +0000 (10:51 +0100)]
use new proxmox-sys crate

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agouse proxmox::tools::fd::fd_change_cloexec from proxmox 0.15.3
Dietmar Maurer [Thu, 18 Nov 2021 12:43:41 +0000 (13:43 +0100)]
use proxmox::tools::fd::fd_change_cloexec from proxmox 0.15.3

Depend on proxmox 0.15.3

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agotraffic-control api: return current traffic with config
Dietmar Maurer [Thu, 18 Nov 2021 11:23:50 +0000 (12:23 +0100)]
traffic-control api: return current traffic with config

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agobump d/control
Wolfgang Bumiller [Thu, 18 Nov 2021 10:25:04 +0000 (11:25 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>