Commit Graph

6686 Commits

Author SHA1 Message Date
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
Dominik Csapak
4a2bb3e6cd api: tape/backup: improve behaviour for vanishing snapshots
when snapshots vanish during tape backup, we skip them. Until now,
we also warned with the error and failed the task at the end.

Since deleting snapshots during tape backup does not really interfere
with it, don't fail the whole task, and only add a log line that it
was skipped.

To differentiate from different errors (e.g. permission problems),
introduce a 'SnapshotBackupResult' which is returned by 'backup_snapshot'.

Also remove the 'pub' there since we don't want to leak the
SnapshotBackupResult type and it's not used anywhere outside this file.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-30 10:17:05 +02:00
Wolfgang Bumiller
40e47aa9cf file-restore: fix a hyperlink in docs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-30 10:16:03 +02:00
Stefan Sterz
3fe0f8ef4c api-types: doc: add crate to Display trait in comments
when creating the documentation (e.g. `cargo doc --open`), it would
warn that `Display` is not in scope.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-30 10:15:22 +02:00
Thomas Lamprecht
69a680e54b tape reader: improve error for unknown magic number
ancient LTO version can cause this too (got some forum reports)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-29 12:11:34 +02:00
Dominik Csapak
6de1899bb1 partially fix #2915: 'stat' in case ReadDirEntry does not contain type
readdir/getdents may return 'DT_UNKNOWN' for the file type
(which corresponds to 'None' in nix::dir::Entry), so stat the file and
check the type

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 09:45:11 +02:00
Wolfgang Bumiller
04dffc3ad7 bump proxmox-sys dep to 0.3.1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 09:45:11 +02:00
Wolfgang Bumiller
adeda54505 d/control cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:52:57 +02:00
Wolfgang Bumiller
a88cad60bf bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:48:59 +02:00
Dominik Csapak
057e188b1e restore-daemon: make file listing 'streaming'
this prevents an oom kill when listing large directories.
Without this, i'd get an oom kill in the restore vm when
i tried to list a directory with ~60000 entries, but with this,
i'd get the response for even 250000 entries

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:46:30 +02:00
Hannes Laimer
707e2b39f3 fixed_index: remove unused 'print_info' function
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00
Hannes Laimer
045dfe3e93 docs: add note for setting verbosity level
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00
Hannes Laimer
0608b36b30 replace print with log macro
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00
Hannes Laimer
d0c75b9b9c proxmox-rest-server: replace print with log macro
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00
Hannes Laimer
095b3c1c18 proxmox-file-restore: replace print with log macro
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00
Hannes Laimer
4a2e446767 proxmox-backup-client: replace print with log macro
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00
Hannes Laimer
e82c03a196 pbs-fuse+pbs-tape: replace print with log macro
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00
Hannes Laimer
dce4b5403b pbs-datastore: replace print with log macro
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00
Hannes Laimer
e10fccf5cc pbs-client: replace print with log macro
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00
Hannes Laimer
955aea8ae8 bins: init cli logger
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00
Wolfgang Bumiller
a3593c890e bump proxmox-router dep to 1.2.4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-21 10:43:19 +02:00