]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
2 years agoapi/config: use param_bail for parameter errors
Dominik Csapak [Fri, 4 Mar 2022 13:47:50 +0000 (14:47 +0100)]
api/config: use param_bail for parameter errors

when using the 'extjs' formatter, it marks them in a way, so that
the gui can mark the form fields with the error

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoUsername schema: set min_length to 1
Dietmar Maurer [Mon, 7 Mar 2022 12:45:16 +0000 (13:45 +0100)]
Username schema: set min_length to 1

Just to get a better error message (the regex already requires min_length 1)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agocleanup: move BasicRealmInfo to pbs-api-types
Dietmar Maurer [Mon, 7 Mar 2022 06:41:03 +0000 (07:41 +0100)]
cleanup: move BasicRealmInfo to pbs-api-types

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agobump d/control
Wolfgang Bumiller [Fri, 4 Mar 2022 08:53:41 +0000 (09:53 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump proxmox-schema dep to 1.3
Wolfgang Bumiller [Fri, 4 Mar 2022 08:50:21 +0000 (09:50 +0100)]
bump proxmox-schema dep to 1.3

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-config: improve semi-useful comment
Thomas Lamprecht [Tue, 1 Mar 2022 08:54:34 +0000 (09:54 +0100)]
pbs-config: improve semi-useful comment

commenting that version_cache.increase_datastore_generation increases
the, well, version is rather superfluous. Also avoid the use of "we",
which is always ambiguous in code comments.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopbs-datastore: use ConfigVersionCache for datastore
Dominik Csapak [Fri, 25 Feb 2022 14:26:11 +0000 (15:26 +0100)]
pbs-datastore: use ConfigVersionCache for datastore

instead of relying on the content of some configs

previously, we always read and parsed the config file, and only
generated a new config object when the path or the 'verify-new' option
changed.

now, we increase the datastore generation on config save, and if that
changed (or the last load is 1 minute in the past), we always
generate a new object

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodocs: add tape schedule examples
Dominik Csapak [Mon, 28 Feb 2022 11:20:08 +0000 (12:20 +0100)]
docs: add tape schedule examples

just a few examples how one could configure tape pools and jobs.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodocs: explain retention time for event allocation policy in more detail
Dominik Csapak [Mon, 28 Feb 2022 11:20:07 +0000 (12:20 +0100)]
docs: explain retention time for event allocation policy in more detail

'when the calendar event' triggers was too vague, it could mean for
the current media-set or the next time. Apart from that, it was not
technically correct all the time, since we take the start time of
the next media set if that exists first.

The idea here is that we begin the retention when the media set is
finished.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodatastore: add tuning option for chunk order
Dominik Csapak [Tue, 22 Feb 2022 14:57:49 +0000 (15:57 +0100)]
datastore: add tuning option for chunk order

currently, we sort chunks by inode when verifying or backing up to tape.
we get the inode# by stat'ing each chunk, which may be more expensive
than the gains of reading the chunks in order

Since that is highly dependent on the underlying storage of the datastore,
introduce a tuning option  so that the admin can tune that behaviour
for each datastore.

The default stays the same (sorting by inode)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoclient cli: rustfmt
Thomas Lamprecht [Tue, 22 Feb 2022 10:03:13 +0000 (11:03 +0100)]
client cli: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobin: daily-update: use syslog/log crates instead of printing to stderr
Thomas Lamprecht [Tue, 22 Feb 2022 09:58:44 +0000 (10:58 +0100)]
bin: daily-update: use syslog/log crates instead of printing to stderr

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobin: daily-update: make single checks/updates fail gracefully
Thomas Lamprecht [Tue, 22 Feb 2022 09:26:59 +0000 (10:26 +0100)]
bin: daily-update: make single checks/updates fail gracefully

avoid that the acme renewal is skipped due to bailing out earlier
from a subscription or apt update error.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobin: daily-update: use from_millis instead of big nanosecond value
Thomas Lamprecht [Tue, 22 Feb 2022 09:25:40 +0000 (10:25 +0100)]
bin: daily-update: use from_millis instead of big nanosecond value

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobin: daily-update: rustfmt
Thomas Lamprecht [Mon, 21 Feb 2022 14:44:06 +0000 (15:44 +0100)]
bin: daily-update: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump d/control
Wolfgang Bumiller [Mon, 21 Feb 2022 13:24:52 +0000 (14:24 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump proxmox-async dep to 0.4
Wolfgang Bumiller [Mon, 21 Feb 2022 13:25:29 +0000 (14:25 +0100)]
bump proxmox-async dep to 0.4

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump proxmox-lang dep to 1.1
Wolfgang Bumiller [Mon, 21 Feb 2022 13:24:24 +0000 (14:24 +0100)]
bump proxmox-lang dep to 1.1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agouse io_format_err, io_bail, io_err_other from proxmox-lang
Dominik Csapak [Mon, 21 Feb 2022 10:39:18 +0000 (11:39 +0100)]
use io_format_err, io_bail, io_err_other from proxmox-lang

and move the comment from the local io_bail in pbs-client/src/pxar/fuse.rs
to the only use

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodepend on new 'proxmox-compression' crate
Dominik Csapak [Mon, 21 Feb 2022 10:39:17 +0000 (11:39 +0100)]
depend on new 'proxmox-compression' crate

the compression utilities live there now

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agocargo: bump schema dependency
Thomas Lamprecht [Fri, 18 Feb 2022 14:00:08 +0000 (15:00 +0100)]
cargo: bump schema dependency

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocli client: backup: better use of our api macro capabilities
Thomas Lamprecht [Fri, 18 Feb 2022 14:01:09 +0000 (15:01 +0100)]
cli client: backup: better use of our api macro capabilities

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocli client: backup: refactor/cleanup of (dry-run) logs
Thomas Lamprecht [Fri, 18 Feb 2022 14:02:23 +0000 (15:02 +0100)]
cli client: backup: refactor/cleanup of (dry-run) logs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3323: cli client: add dry-run option for backup command
Markus Frank [Fri, 18 Feb 2022 09:55:38 +0000 (10:55 +0100)]
fix #3323: cli client: add dry-run option for backup command

adds a dry-run parameter for "proxmox-backup-client backup".
With this parameter on it simply prints out what would be uploaded,
instead of uploading it.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agotape/pool_writer: skip already backed up chunks in iterator
Dominik Csapak [Thu, 17 Feb 2022 13:50:40 +0000 (14:50 +0100)]
tape/pool_writer: skip already backed up chunks in iterator

currently, the iterator goes over *all* chunks of the index, even
those already backed up by a previous snapshots in the same tape
backup. this is bad since for each iterator, we stat each chunk to
sort by inode number. so to avoid stat'ing the same chunks over
and over for consecutive snapshots, add a 'skip_fn' to the iterator
and in the pool writer and check the catalog_set if we can skip it

this means we can drop the later check for the catalog_set
(since we don't modify that here)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agorrd: extract data: avoid always calculating start-time fallback
Thomas Lamprecht [Tue, 15 Feb 2022 06:58:18 +0000 (07:58 +0100)]
rrd: extract data: avoid always calculating start-time fallback

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorrd: avoid intermediate index, directly loop over data
Thomas Lamprecht [Tue, 15 Feb 2022 06:55:08 +0000 (07:55 +0100)]
rrd: avoid intermediate index, directly loop over data

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorrd cache: code style, avoid useless intermediate mutable
Thomas Lamprecht [Tue, 15 Feb 2022 06:53:29 +0000 (07:53 +0100)]
rrd cache: code style, avoid useless intermediate mutable

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomove src/shared_rate_limiter.rs to src/tools/shared_rate_limiter.rs
Dietmar Maurer [Mon, 14 Feb 2022 13:34:31 +0000 (14:34 +0100)]
move src/shared_rate_limiter.rs to src/tools/shared_rate_limiter.rs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoParallelHandler: avoid re-export (cleanup)
Dietmar Maurer [Mon, 14 Feb 2022 13:12:39 +0000 (14:12 +0100)]
ParallelHandler: avoid re-export (cleanup)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agorename cached_traffic_control.rs to traffic_control_cache.rs, improve dev docs
Dietmar Maurer [Mon, 14 Feb 2022 12:44:27 +0000 (13:44 +0100)]
rename cached_traffic_control.rs to traffic_control_cache.rs, improve dev docs

Keep things inside crate::traffic_control_cache (do not pollute root namespace).

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agorrd_cache: add developer docs
Dietmar Maurer [Mon, 14 Feb 2022 11:03:58 +0000 (12:03 +0100)]
rrd_cache: add developer docs

and make RRD_CACHE private (please use get_rrd_cache instead).

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoui: fixup title case
Thomas Lamprecht [Mon, 14 Feb 2022 10:37:18 +0000 (11:37 +0100)]
ui: fixup title case

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: node options: add support for selecting default language
Matthias Heiserer [Thu, 10 Feb 2022 11:57:37 +0000 (12:57 +0100)]
ui: node options: add support for selecting default language

Allows setting the default language in Configuration/Other/General

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3853: tape cli: add force flag to key change-passphrase
Stefan Sterz [Thu, 10 Feb 2022 14:23:25 +0000 (15:23 +0100)]
fix #3853: tape cli: add force flag to key change-passphrase

Adds the '--force' flag to the proxmox-tape command allowing users
with root privileges to overwrite the passphrase of a given key.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2 years agofix #3853: api: add force option to tape key change-passphrase
Stefan Sterz [Thu, 10 Feb 2022 14:23:24 +0000 (15:23 +0100)]
fix #3853: api: add force option to tape key change-passphrase

When force is used, the current passphrase is not required. Instead
it will be read from the file pointed to by TAPE_KEYS_FILENAME and
the old key configuration will be overwritten using the new
passphrase. Requires super user privileges.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2 years agorest-server: bump schema to 1.2 and use convenience methods
Wolfgang Bumiller [Fri, 11 Feb 2022 13:09:45 +0000 (14:09 +0100)]
rest-server: bump schema to 1.2 and use convenience methods

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoproxmox-rest-server: add missing 'derive' feature
Wolfgang Bumiller [Fri, 11 Feb 2022 12:57:48 +0000 (13:57 +0100)]
proxmox-rest-server: add missing 'derive' feature

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agotools: disk: rustfmt
Thomas Lamprecht [Thu, 10 Feb 2022 16:46:13 +0000 (17:46 +0100)]
tools: disk: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: node/disk: rustfmt
Thomas Lamprecht [Thu, 10 Feb 2022 12:12:15 +0000 (13:12 +0100)]
api: node/disk: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomisc clippy fixes
Fabian Grünbichler [Tue, 8 Feb 2022 13:57:16 +0000 (14:57 +0100)]
misc clippy fixes

the trivial ones ;)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoreport: add tape, traffic control and disk infos
Aaron Lauterer [Mon, 7 Feb 2022 13:37:30 +0000 (14:37 +0100)]
report: add tape, traffic control and disk infos

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2 years agoreport: move subscription info further up
Aaron Lauterer [Mon, 7 Feb 2022 13:37:29 +0000 (14:37 +0100)]
report: move subscription info further up

This is something that is checked all the time. Having it further up
saves on scrolling and brings it into better alignment with PVE & PMG
regarding where in the report the info is located.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2 years agonode config: add english to translation enum for default-lang
Matthias Heiserer [Mon, 7 Feb 2022 11:19:02 +0000 (12:19 +0100)]
node config: add english to translation enum for default-lang

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: node config: add default-lang integration
Matthias Heiserer [Mon, 7 Feb 2022 11:19:01 +0000 (12:19 +0100)]
api: node config: add default-lang integration

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: webauthn: decrease upgrade frequency from 1s to 2.5s
Thomas Lamprecht [Mon, 7 Feb 2022 14:20:08 +0000 (15:20 +0100)]
ui: webauthn: decrease upgrade frequency from 1s to 2.5s

this is nothing to important and nothing that'll get changed *that*
often, so 2.5s is more than enough.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: webauthn: fix stopping store upgrades on destroy
Thomas Lamprecht [Mon, 7 Feb 2022 14:17:00 +0000 (15:17 +0100)]
ui: webauthn: fix stopping store upgrades on destroy

`deactivate` is only triggered if we switch to a different tab on
the same navigation level, but if we switch to a completely different
component (e.g., fom `Options -> Others` to `Datastore foo`) we can
only work with the destroy event, use the before one as else we
cannot access the view controllers method anymore.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agore-use PROXMOX_DEBUG env variable to control log level filter
Dominik Csapak [Fri, 4 Feb 2022 09:12:20 +0000 (10:12 +0100)]
re-use PROXMOX_DEBUG env variable to control log level filter

So that we can make 'log::debug' messages actually appear in the
syslog.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3856 hint parameter is not optional
Markus Frank [Thu, 3 Feb 2022 11:57:26 +0000 (12:57 +0100)]
fix #3856 hint parameter is not optional

For the API the parameter --hint is not optional. This patch fixes
the man page and cli command doesn't send an API call, if the
parameter does not exist.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
2 years agoproxy: refactor gui-language logic
Thomas Lamprecht [Mon, 31 Jan 2022 14:58:44 +0000 (15:58 +0100)]
proxy: refactor gui-language logic

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest: add cookie_from_header helper
Thomas Lamprecht [Mon, 31 Jan 2022 14:50:23 +0000 (15:50 +0100)]
rest: add cookie_from_header helper

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxy: rustfmt
Thomas Lamprecht [Mon, 31 Jan 2022 13:21:47 +0000 (14:21 +0100)]
proxy: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: fix typo in tape backup
Matthias Heiserer [Mon, 24 Jan 2022 13:30:54 +0000 (14:30 +0100)]
docs: fix typo in tape backup

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
2 years agonode config: avoid "allow" annotation
Thomas Lamprecht [Thu, 27 Jan 2022 15:08:53 +0000 (16:08 +0100)]
node config: avoid "allow" annotation

We rename those anyway for serialization so we do not need to bother
with spelling them in an non-idiomatic way just because i18n has it
like that.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3103. node config: allow to configure default UI language
Matthias Heiserer [Mon, 24 Jan 2022 10:09:51 +0000 (11:09 +0100)]
fix #3103. node config: allow to configure default UI language

This language is only used if none is set in the cookies.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
2 years agobump proxmox-acme-rs dependency to 0.4
Wolfgang Bumiller [Wed, 2 Feb 2022 12:18:47 +0000 (13:18 +0100)]
bump proxmox-acme-rs dependency to 0.4

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agotraffic-control: use SocketAddr from 'accept()'
Dominik Csapak [Fri, 28 Jan 2022 14:10:30 +0000 (15:10 +0100)]
traffic-control: use SocketAddr from 'accept()'

instead of getting the 'peer_addr()' from the socket.
The advantage is that we must get this and thus can drop the mapping
from result -> option, and can drop the testing for None and a test case

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: datastore/Content: improve verification actions
Dominik Csapak [Thu, 27 Jan 2022 14:13:20 +0000 (15:13 +0100)]
ui: datastore/Content: improve verification actions

verifying a single snapshot is now never skipped because of recent verify
verifying a group will now reverify after 29 days to be consistent
with the 'All OK (old)' display

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoverify: allow '0' days for reverification
Dominik Csapak [Thu, 27 Jan 2022 14:13:19 +0000 (15:13 +0100)]
verify: allow '0' days for reverification

and let it mean that we will always reverify

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agobump version to 2.1.5-1
Thomas Lamprecht [Wed, 26 Jan 2022 15:24:11 +0000 (16:24 +0100)]
bump version to 2.1.5-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoREADME: update for bullseye
Thomas Lamprecht [Wed, 26 Jan 2022 15:19:15 +0000 (16:19 +0100)]
README: update for bullseye

and start with a higher level for "h1" headlines

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile restore: scale per-round delay up dynamically
Thomas Lamprecht [Wed, 26 Jan 2022 15:08:19 +0000 (16:08 +0100)]
file restore: scale per-round delay up dynamically

Avoids latency for restore-VMs that are finished fast but not ready
yet the first round while not checking to often for slower ones, iow,
we assume that the start up distribution is looking like a chi-square
Χ² with k=3.

With 25*round we get at max 45 rounds totalling to 25.875 s delay and
1.125 max between-round delay, which still provides an ok reaction
time.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile restore: always wait up to 25s
Thomas Lamprecht [Wed, 26 Jan 2022 15:04:41 +0000 (16:04 +0100)]
file restore: always wait up to 25s

the timeout for connecting may be much shorter if we get a response
(which doesn't needs to be Ok, e.g., "Connection refused"), so
instead of trying a fixed amount of 60 times lets try for 25s
independent of how often that will be then.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoSet MMAP_THRESHOLD to a fixed value (128K)
Dietmar Maurer [Wed, 26 Jan 2022 06:10:59 +0000 (07:10 +0100)]
Set MMAP_THRESHOLD to a fixed value (128K)

glibc's malloc has a misguided heuristic to detect transient allocations that
will just result in allocation sizes below 32 MiB never using mmap.

That it turn means that those relatively big allocations are on the heap where
cleanup and returning memory to the OS is harder to do and easier to be blocked
by long living, small allocations at the top (end) of the heap.

Observing the malloc size distribution in a file-level backup run:

@size:
[0]                   14 |                                                    |
[1]                25214 |@@@@@                                               |
[2, 4)              9090 |@                                                   |
[4, 8)             12987 |@@                                                  |
[8, 16)            93453 |@@@@@@@@@@@@@@@@@@@@                                |
[16, 32)           30255 |@@@@@@                                              |
[32, 64)          237445 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[64, 128)          32692 |@@@@@@@                                             |
[128, 256)         22296 |@@@@                                                |
[256, 512)         16177 |@@@                                                 |
[512, 1K)           5139 |@                                                   |
[1K, 2K)            3352 |                                                    |
[2K, 4K)             214 |                                                    |
[4K, 8K)            1568 |                                                    |
[8K, 16K)             95 |                                                    |
[16K, 32K)          3457 |                                                    |
[32K, 64K)          3175 |                                                    |
[64K, 128K)          161 |                                                    |
[128K, 256K)         453 |                                                    |
[256K, 512K)          93 |                                                    |
[512K, 1M)            74 |                                                    |
[1M, 2M)             774 |                                                    |
[2M, 4M)             319 |                                                    |
[4M, 8M)             700 |                                                    |
[8M, 16M)             93 |                                                    |
[16M, 32M)            18 |                                                    |

We see that all allocations will be on the heap, and that while most
allocations are small, the relatively few big ones will still make up most of
the RSS and if blocked from being released back to the OS result in much higher
peak and average usage for the program than actually required.

Avoiding the "dynamic" mmap-threshold increasement algorithm and fixing it at
the original default of 128 KiB reduces RSS size by factor 10-20 when running
backups. As with memory mappings other mappings or the heap can never block
freeing the memory fully back to the OS.

But, the drawback of using mmap is more wasted space for unaligned or small
allocation sizes, and the fact that the kernel allegedly zeros out the data
before giving it to user space. The former doesn't really matter for us when
using it only for allocations bigger than 128 KiB, and the latter is a
trade-off, using 10 to 20 times less memory brings its own performance
improvement possibilities for the whole system after all ;-)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
 [ Thomas: added to comment & commit message + extra-empty-line fixes ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.1.4-1
Thomas Lamprecht [Fri, 21 Jan 2022 09:48:42 +0000 (10:48 +0100)]
bump version to 2.1.4-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopbs-tools: LruCache: implement Drop
Dominik Csapak [Thu, 20 Jan 2022 10:16:08 +0000 (11:16 +0100)]
pbs-tools: LruCache: implement Drop

this fixes the leaked memory for the cache, as we had only pointers
in the map/list which were freed, not the underlying chunks

moves the 'clear' implementation out of the trait bounds so that
Drop can reuse it

this is used e.g. for file download from a pxar

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodocs: make external hyperlinks clickable
Matthias Heiserer [Tue, 18 Jan 2022 14:25:43 +0000 (15:25 +0100)]
docs: make external hyperlinks clickable

rustdoc lints detected that two external hyperlinks were not
clickable.

The short cut used is only available for internal links, otherwise
one needs to use the Markdown syntax, so either [Text](URL) or <URL>.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
[ T: commit message text width, mention markdown ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agociphers: improve option naming
Fabian Grünbichler [Thu, 13 Jan 2022 09:54:40 +0000 (10:54 +0100)]
ciphers: improve option naming

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoapi2: make tls ciphers updatable
Hannes Laimer [Tue, 11 Jan 2022 11:39:37 +0000 (12:39 +0100)]
api2: make tls ciphers updatable

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agoproxy: use ciphers from config if set
Hannes Laimer [Tue, 11 Jan 2022 11:39:36 +0000 (12:39 +0100)]
proxy: use ciphers from config if set

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agociphers: simplify API schema
Fabian Grünbichler [Thu, 13 Jan 2022 09:16:15 +0000 (10:16 +0100)]
ciphers: simplify API schema

these need to be checked (and are) via libssl anyway before persisting,
and newer versions might contain new ciphers/variants/... (and things
like @STRENGTH or @SECLEVEL=n were missing).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoconfig: add tls ciphers to NodeConfig
Hannes Laimer [Tue, 11 Jan 2022 11:39:35 +0000 (12:39 +0100)]
config: add tls ciphers to NodeConfig

for TLS 1.3 and for TLS <= 1.2

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agobump version to 2.1.3-1
Thomas Lamprecht [Wed, 12 Jan 2022 15:49:33 +0000 (16:49 +0100)]
bump version to 2.1.3-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi-types: relax NODENAME_SCHEMA
Fabian Grünbichler [Wed, 12 Jan 2022 13:52:10 +0000 (14:52 +0100)]
api-types: relax NODENAME_SCHEMA

there isn't really a concept of 'nodes' in PBS (yet) anyway - and if
there ever is, it needs to be handled by the rest-server / specific API
endpoints (like in PVE), and not by the schema.

this allows dropping proxmox-sys from pbs-api-types (and thus nix and
some other transitive deps as well).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoapi-types: move RsaPubKeyInfo to pbs-client
Fabian Grünbichler [Wed, 12 Jan 2022 13:52:09 +0000 (14:52 +0100)]
api-types: move RsaPubKeyInfo to pbs-client

it's the only thing requiring openssl in pbs-api-types, and it's only
used by the client to pretty-print the 'master' key, which is
client-specific.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agodocs: fix some typos
Thomas Lamprecht [Wed, 12 Jan 2022 14:19:50 +0000 (15:19 +0100)]
docs: fix some typos

the `congestion` typo has been mentioned in the forum:
https://forum.proxmox.com/threads/proxmox-backup-server-2-1-released.100240/#post-443370

fixed a few surrounding ones and ones that `codespell` found in
addition to that.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: sys config: add icons to tabs
Thomas Lamprecht [Wed, 12 Jan 2022 11:41:16 +0000 (12:41 +0100)]
ui: sys config: add icons to tabs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: sys config: code cleanup/refactoring
Thomas Lamprecht [Wed, 12 Jan 2022 11:38:45 +0000 (12:38 +0100)]
ui: sys config: code cleanup/refactoring

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: sys config: merge webauthn and general options into one tab
Thomas Lamprecht [Wed, 12 Jan 2022 11:36:36 +0000 (12:36 +0100)]
ui: sys config: merge webauthn and general options into one tab

To much wasted space else.
Also rename "Options" to "Others", while it's not _that_ much better
it's slightly more intuitive than config -> options (which has some
redundancy)...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3058: ui: improve remote edit UX by clarifying ID vs host
Thomas Lamprecht [Wed, 12 Jan 2022 08:38:20 +0000 (09:38 +0100)]
fix #3058: ui: improve remote edit UX by clarifying ID vs host

also fixup missing emptyText for fingerprint (adapted from PVE's PBS
storage addition) and code-style in surrounding areas a bit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: hide rrd chart for io delay if no io_ticks are returned
Dominik Csapak [Tue, 11 Jan 2022 09:27:08 +0000 (10:27 +0100)]
ui: hide rrd chart for io delay if no io_ticks are returned

it makes no sense to show a completely empty graph

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi/admin/datastore: rrd: do not include io_ticks for zfs datastores
Dominik Csapak [Tue, 11 Jan 2022 09:27:07 +0000 (10:27 +0100)]
api/admin/datastore: rrd: do not include io_ticks for zfs datastores

since it is not possible to collect them, do not return them here either

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agofix #3743: extract zfs dataset io stats from /proc/spl/kstat/zfs/POOL/objset-*
Dominik Csapak [Mon, 10 Jan 2022 11:08:14 +0000 (12:08 +0100)]
fix #3743: extract zfs dataset io stats from /proc/spl/kstat/zfs/POOL/objset-*

Recently, ZFS removed the pool global io stats from
/proc/spl/kstat/zfs/POOL/io with no replacement.

To gather stats about the datastores, access now the objset specific
entries there. To be able to make that efficient, cache a map of
dataset <-> obset ids, so that we do not have to parse all files each time.

We update the cache each time we try to get the info for a dataset
where we do not have a mapping.

We cannot update it on datastore add/remove since that happens in the
proxmox-backup daemon, while we need the info here in proxmox-backup-proxy.

Sadly with this we lose the io wait metric, but it seems that this is no
longer tracked in zfs at all, so nothing we can do for that.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodatastore status: do not count empty groups
Dietmar Maurer [Fri, 7 Jan 2022 07:40:22 +0000 (08:40 +0100)]
datastore status: do not count empty groups

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agotools::config: error on newlines in string values
Wolfgang Bumiller [Wed, 5 Jan 2022 09:03:44 +0000 (10:03 +0100)]
tools::config: error on newlines in string values

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: add new options tab under configuration
Hannes Laimer [Mon, 3 Jan 2022 09:04:56 +0000 (10:04 +0100)]
ui: add new options tab under configuration

... and add from-email + move http-proxy there

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agoserver: use configured email-from for sending mail
Hannes Laimer [Mon, 3 Jan 2022 09:04:55 +0000 (10:04 +0100)]
server: use configured email-from for sending mail

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agoapi2: make email-from updatable
Hannes Laimer [Mon, 3 Jan 2022 09:04:54 +0000 (10:04 +0100)]
api2: make email-from updatable

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agoconfig: add email-from to NodeConfig
Hannes Laimer [Mon, 3 Jan 2022 09:04:53 +0000 (10:04 +0100)]
config: add email-from to NodeConfig

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2 years agoTimeSpan: parse via FromStr
Fabian Grünbichler [Thu, 30 Dec 2021 12:57:27 +0000 (13:57 +0100)]
TimeSpan: parse via FromStr

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agouse schema verify methods
Fabian Grünbichler [Thu, 30 Dec 2021 12:55:54 +0000 (13:55 +0100)]
use schema verify methods

the old, deprecated ones only forward to these anyway.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agorrd: drop redundant field names
Fabian Grünbichler [Thu, 30 Dec 2021 13:18:43 +0000 (14:18 +0100)]
rrd: drop redundant field names

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agotree-wide: is_ok/is_err()
Fabian Grünbichler [Thu, 30 Dec 2021 14:01:31 +0000 (15:01 +0100)]
tree-wide: is_ok/is_err()

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agotree-wide: use is_empty() and similar
Fabian Grünbichler [Thu, 30 Dec 2021 13:49:11 +0000 (14:49 +0100)]
tree-wide: use is_empty() and similar

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agotree-wide: cleanup manual map/flatten
Fabian Grünbichler [Thu, 30 Dec 2021 13:35:24 +0000 (14:35 +0100)]
tree-wide: cleanup manual map/flatten

found with clippy, best viewed with `-w` ;)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoview_task_result: remove unnecessary &mut
Fabian Grünbichler [Thu, 30 Dec 2021 12:35:51 +0000 (13:35 +0100)]
view_task_result: remove unnecessary &mut

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agotree-wide: drop redundant clones
Fabian Grünbichler [Thu, 30 Dec 2021 12:20:03 +0000 (13:20 +0100)]
tree-wide: drop redundant clones

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agotape: multi-volume: fix overflow check
Fabian Grünbichler [Thu, 30 Dec 2021 12:03:55 +0000 (13:03 +0100)]
tape: multi-volume: fix overflow check

the part number cannot go above 255 at the moment, but if it ever gets
bumped to a bigger integer type this boundary wouldn't cause a
compile-error. explicitly checking for overflowing u8 makes this a bit
more future-proof, and shuts up clippy as well ;)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agotree-wide: fix needless borrows
Fabian Grünbichler [Thu, 30 Dec 2021 11:57:37 +0000 (12:57 +0100)]
tree-wide: fix needless borrows

found and fixed via clippy

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agofix #3763: disable renegotiation
Fabian Grünbichler [Wed, 15 Dec 2021 14:18:36 +0000 (15:18 +0100)]
fix #3763: disable renegotiation

requires openssl crate with fix[0], like our packaged one.

0: https://github.com/sfackler/rust-openssl/pull/1584

Tested-by: Stoiko Ivanov s.ivanov@proxmox.com
Reviewed-by: Stoiko Ivanov s.ivanov@proxmox.com
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>