5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-08 21:18:07 +03:00
Commit Graph

6663 Commits

Author SHA1 Message Date
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
Hannes Laimer
30730d544c ui: disks: show partitions by default
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2022-06-15 10:59:38 +02:00
Hannes Laimer
be2604109d disks: use builder pattern for querying disk usage
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2022-06-15 10:59:34 +02:00
Hannes Laimer
6a6ba4cdac api2: disks endpoint return partitions
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2022-06-15 10:59:21 +02:00
Wolfgang Bumiller
a1896bffb6 remove outdated comment
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-14 13:00:14 +02:00
Stefan Sterz
9e8daa1d10 fix #3867: server/api: send emails on certificate renewal failure
the superuser's email will be used to notify them that certificate
renewal has failed.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-14 12:59:17 +02:00
Wolfgang Bumiller
a83283cdf5 bump proxmox-fuse dep to 0.1.3
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-13 15:12:07 +02:00
Wolfgang Bumiller
670534b0e3 bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-13 10:05:44 +02:00
Dominik Csapak
f7ff48ded4 ui: add MetricServerView and use it
simple CRUD interface to show/add/edit/delete metric servers

it's a bit different from PVE's so it's harder to reuse that than to
copy it. If we need it again, we can still refactor and combine them.

introduce 'PBS.Schema' class to hold the server type/xtype mappings

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-13 10:01:05 +02:00
Dominik Csapak
3d6b21bf05 ui: add window/InfluxDbEdit
contains both windows for HTTP and UDP

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-13 10:01:05 +02:00
Dominik Csapak
173b479b08 api: add metricserver endpoints
but in contrast to pve, we split the api by type of the section config,
since we cannot handle multiple types in the updater

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-13 10:01:05 +02:00
Dominik Csapak
4d397849b5 proxmox-backup-proxy: send metrics to configured metrics server
and keep the data as similar as possible to pve (tags/fields)

datastores get their own 'object' type and reside in the "blockstat"
measurement

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-13 10:01:05 +02:00
Dominik Csapak
759c4c87af backup-proxy: decouple stats gathering from rrd update
that way we can reuse the stats gathered

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-13 10:01:05 +02:00
Dominik Csapak
9f30a31e53 pbs-config: add metrics config class
a section config like in pve

also adds a helper to get Metrics structs for all configured servers

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-13 10:01:05 +02:00
Dominik Csapak
db971bf298 pbs-api-types: add metrics api types
InfluxDbUdp and InfluxDbHttp for now

introduces schemas for host:port and https urls

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-13 09:57:16 +02:00
Stefan Sterz
3a8d54e81f config: remove duplicate privilege lookup in cached_user_info
`lookup_privs` just uses `lookup_privs_details` but ignores the
propagated privileges it returns. thus, the lookup here is redundant
as it is immediately followed by a call to `lookup_privs_details` with
the same parameters.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2022-06-10 11:30:40 +02:00
Thomas Lamprecht
a73eafaa1f d/lintian-overrides: ignore some expected warnings
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-08 14:51:03 +02:00
Thomas Lamprecht
b80d7f95db bump version to 2.2.3-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-08 14:23:25 +02:00
Thomas Lamprecht
b4bda79ac5 config: acl get child paths: make tests more specific
to avoid that extra paths "sneak" in in some regression

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-08 14:04:36 +02:00
Thomas Lamprecht
2d7ec3578b config: re-enable efficient mixed acl path/slice support
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-08 14:01:53 +02:00
Fabian Grünbichler
d8ec2a25ba acl: fix any_priv_below when used with API tokens
The previous implementation had one issue with not handling API
tokens correctly.

In general, AclTree(Node) operates on the role level, not the priv
level - the latter is handled by cached_user_info.rs

Accordingly, the ACL tree helpers now return a list of paths where *any*
role is defined for the given AuthId, and any_priv_below then maps those
paths to privs via the regular helpers for priv lookup/checking. this
approach should also be robust if groups and group ACLs are ever
introduced.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-06-08 13:38:02 +02:00
Fabian Grünbichler
663165d662 acl: rename get_node to get_node_mut
get_node will be re-introduced with the next patch, which requires a
non-mut accessor.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-06-08 11:26:36 +02:00
Thomas Lamprecht
87005234c6 cargo fmt/format variable inlining
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-07 14:35:00 +02:00
Thomas Lamprecht
ce9b00e7e3 api: tape restore: warn if snapshot could not get parsed
unlikely, but cost is far too low to not do it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-07 14:29:50 +02:00