6806 Commits

Author SHA1 Message Date
Wolfgang Bumiller
4597eedf13 config: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-27 15:22:09 +02:00
Wolfgang Bumiller
64dc5dbf08 tools: allow type_complexity on purely internal field
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-27 15:19:20 +02:00
Wolfgang Bumiller
19018f9881 rest-server: clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-27 14:54:44 +02:00
Wolfgang Bumiller
92ead5d3f4 rrd: Entry type and clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-27 14:54:44 +02:00
Wolfgang Bumiller
f680e72fae api-types: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-27 13:29:32 +02:00
Fabian Grünbichler
e1db06705e more clippy fixes and annotations
the remaining ones are:
- type complexity
- fns with many arguments
- new() without default()
- false positives for redundant closures (where closure returns a static
  value)
- expected vs actual length check without match/cmp

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-26 14:05:25 +02:00
Fabian Grünbichler
3be9106f1c clippy fixes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-25 16:03:34 +02:00
Wolfgang Bumiller
24fdef9651 bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-25 13:43:32 +02:00
Wolfgang Bumiller
8ab1d13140 tfa: allow modifying 'allow-subdomains'
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-25 13:39:41 +02:00
Wolfgang Bumiller
5242dcb25e bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-25 12:03:41 +02:00
Fabian Grünbichler
0f281d6ca2 cargo fmt
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-25 10:03:44 +02:00
Fabian Grünbichler
68fda26787 adapt to proxmox-subscription changes
key location is now in a single place, missing key and no signature is
not fatal anymore.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-25 10:03:44 +02:00
Fabian Grünbichler
5616dca6b7 adapt to proxmox-apt change
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-25 10:03:44 +02:00
Fabian Grünbichler
480f1552f8 www: add Signed info to subscription panel
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-25 10:03:10 +02:00
Fabian Grünbichler
da7b6af61c manager: add 'subscription set-offline-key' command
and disallow updating offline subscription keys via the regular
check/update code path.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-25 10:03:10 +02:00
Fabian Grünbichler
dd16e1dac8 extract proxmox-subscription crate
and add support for signed subscription keys.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-25 10:03:07 +02:00
Wolfgang Bumiller
9b3b3c88a9 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
Thomas Lamprecht
c5cd99b15b bump version to 2.2.5-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-18 14:32:49 +02:00
Thomas Lamprecht
c2206e21e0 api daemons: periodically unpark a tokio thread to ensure progress
The underlying issue seems to be the case when the thread that runs
the IO driver is polling its own tasks, while that happens the IO
driver/poller won't run and thus work stealing won't happen, meaning
that idle and parked threads will keep being parked even if there's
pending work they could do.

A promising solution for tokio is proposed in its issue tracker [0],
but it wasn't yet implemented. So, as stop gap spawn a separate
thread that periodically spawns a no-op ready future in the runtime
which would unpark a worker in the aforementioned case and thus
should break the bogus idleness. Choose a 3s period for that without
any overly elaborate reasons, our main goal is to ensure we accept
incoming connections and 3s is well below a HTTP timeout and leaves
some room for high network latencies while not invoking to much
additional wakeups for systems that are really idling.

[0]: https://github.com/tokio-rs/tokio/issues/4730#issuecomment-1147975074

Link: https://github.com/tokio-rs/tokio/issues/4730
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-18 14:11:03 +02:00
Thomas Lamprecht
4f04ecb2f6 fix #4157: docs: fix copy-paste error in repo examples
refer to actually used host/datastore from the example

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-16 11:41:21 +02:00
Thomas Lamprecht
ef719f9a18 bump version to 2.2.4-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-14 18:54:46 +02:00
Thomas Lamprecht
3f6a17b09f proxy: scheduler: only do a single round of time alignment and drop counter
not much value in waiting an extra minute, that doesn't really
guarantees better scheduling (as in, less impact on startup).

Dropping that also allows easily to drop the counter by just moving
the sleep to the beginning of the loop.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-14 18:20:44 +02:00
Thomas Lamprecht
9f7752f2b2 proxy: scheduler: code cleanup/bloat reduction
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-14 18:20:12 +02:00
Thomas Lamprecht
37f9b8cc09 proxy: scheduler: move fallback inside next_minute fn, drops result from return
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-14 17:59:24 +02:00
Thomas Lamprecht
ffe7f58191 docs: buildsys: use wild card target for generating config synopsis
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-14 17:56:18 +02:00
Thomas Lamprecht
075add9b3b docs: buildsys: use wild card target for generating synopsis
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-14 17:54:16 +02:00
Thomas Lamprecht
96a7169eb8 docs: replace copyright years statement with single source of truth from conf
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-14 16:54:56 +02:00
Thomas Lamprecht
dc7aad4bcc docs: conf: update copyright years
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-14 16:54:56 +02:00
Thomas Lamprecht
c63688e031 docs: epilog: add version dynamically and drop unused AUTHOR replacement
now that the man pages are generated from sphinx, not rst2man, they
got access to the conf.py and things like its rst_epilog variable.

Use that to set the correct version in there dynamically

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-14 16:54:56 +02:00
Thomas Lamprecht
ed873dc6a4 docs: let sphinx build man pages for better integration and less cruft
rst2man is only good for use in projects that don't use sphinx
already, as there it can help to avoid bringing in the full sphinx
dependencies and be easier to manage (as long as it stay small).

But we already use sphinx, so there's no point in managing the manual
pages in a separate, semi-related way that is quite restricted as we
have no access to sphinx infrastructure like conf.py defined
variables and helpers for things like the current version.

Besides that, we're rather big, so the complexity of sphinx can
shine, e.g., see the diffstat report from switching out rst2man for
sphinx:

22 files changed, 74 insertions(+), 347 deletions(-)

so 273 lines less in total is rather nice.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-14 16:54:56 +02:00
Stefan Sterz
5b5f18eb38 fix: api2: make tasks endpoint work with new prune job worker type
when prune jobs were refactored, their worker type was changed from
"prune" to "prunejob" this broke `check_job_store` and
`check_job_privs`

as reported in the forum: https://forum.proxmox.com/threads/problem-with-apirequest-on-pbs-2-2-3.112131/#post-483835

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2022-07-14 14:29:32 +02:00
Wolfgang Bumiller
91f4b11fa7 api2: optimize filtered snapshot listing
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-14 11:49:36 +02:00
Wolfgang Bumiller
487c5be9ab datastore: add BackupGroup::exists helper
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-14 11:17:15 +02:00
Wolfgang Bumiller
5444b914af datastore: factor type out of ListGroups into ListGroupsType
In the API we want to iterate over all backup groups
belonging to a particular type at least once, and iterating
through *everything* and simply "skipping" over every single
entry from another type makes no sense given that the groups
are organized into subdirectories based on their type.

Let's have an `.iter_backup_type()` method which returns an
iterator over all the groups of a specific type named
ListGroupsType and factorize the type level iterator out of
ListGroups for reuse.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-14 11:17:15 +02:00
Wolfgang Bumiller
8f38e53896 datastore: simplify iter_backup_groups_ok
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-14 11:14:49 +02:00
Wolfgang Bumiller
6b46f25965 api-types: make BackupType::iter an actual iterator
Otherwise we have to use BackupType::iter().iter() whenever
we're not using a `for _ in iter()` construct.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-14 11:14:26 +02:00
Wolfgang Bumiller
5a2f7ea7cf api: wrap get_snapshots_count in spawn_blocking
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-13 14:02:38 +02:00
Wolfgang Bumiller
979b378460 api: wrap set_backup_owner in spawn_blocking
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-13 14:02:27 +02:00
Wolfgang Bumiller
67d7a59d68 api: wrap set_protection in spawn_blocking
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-13 14:02:27 +02:00
Wolfgang Bumiller
7beb27d428 api: wrap catalog in spawn_blocking
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-13 14:02:27 +02:00
Wolfgang Bumiller
af201d7a1d api: wrap delete_snapshot in spawn_blocking
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-13 14:02:13 +02:00
Wolfgang Bumiller
6cb674aaf5 api: wrap list_snapshot_files in spawn_blocking
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-13 14:02:13 +02:00
Wolfgang Bumiller
6f67dc1197 api: wrap delete_group in spawn_blocking
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-13 14:02:11 +02:00
Wolfgang Bumiller
a577d7d801 api: move 'list_snapshots' to a blocking thread
This is a stop-gap measure to prevent snapshot listing from
blocking the main async worker threads as it can potentially
do a *lot* of I/O.

Ideally we'll move to a proper streaming API, but this will
be an API break.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-12 11:09:53 +02:00
Wolfgang Bumiller
143ac7e69b wrap fs_info calls in spawn_blocking
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-11 10:41:16 +02:00
Dominik Csapak
36156038c9 tape: include used tapes in tape notification e-mails
by saving them in the pool-writer, and setting them in the
TapeBackupJobSummary

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-07-05 08:52:57 +02:00
Fabian Grünbichler
2b9cf927e3 move json_object_to_query to proxmox-http+http-helpers
it's used by the subscription code that will be extracted next.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-04 10:08:53 +02:00
Fabian Grünbichler
87b7fa0226 move to/write_canonical_json to proxmox-serde
as preparation for extracting subscription-related code into its own
crate.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-04 10:08:53 +02:00
Fabian Grünbichler
8e76134db9 cruft: remove tools::http
it's not used by anything.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-07-04 10:08:53 +02:00
Wolfgang Bumiller
b58dd1d413 rustfmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-30 10:18:32 +02:00