]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
3 years agofix #2957: allow Sys.Audit access to node RRD
Fabian Grünbichler [Wed, 16 Sep 2020 09:51:12 +0000 (11:51 +0200)]
fix #2957: allow Sys.Audit access to node RRD

this is the same privilege needed to query the node status.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agodocs: fix epilogs fixme comment
Thomas Lamprecht [Wed, 16 Sep 2020 14:36:20 +0000 (16:36 +0200)]
docs: fix epilogs fixme comment

restructured text comment syntax, i.e., everything it cannot parse is
a comment, is a real PITA!

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosrc/backup/data_blob.rs: expose verify_crc again
Dietmar Maurer [Wed, 16 Sep 2020 08:43:42 +0000 (10:43 +0200)]
src/backup/data_blob.rs: expose verify_crc again

3 years agoSnapshotVerifyState: use enum for state
Stefan Reiter [Tue, 15 Sep 2020 08:19:23 +0000 (10:19 +0200)]
SnapshotVerifyState: use enum for state

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agobackup: check all referenced chunks actually exist
Stefan Reiter [Mon, 14 Sep 2020 08:50:19 +0000 (10:50 +0200)]
backup: check all referenced chunks actually exist

A client can omit uploading chunks in the "known_chunks" list, those
then also won't be written on the server side. Check all those chunks
mentioned in the index but not uploaded for existance and report an
error if they don't exist instead of marking a potentially broken backup
as "successful".

This is only important if the base snapshot references corrupted chunks,
but has not been negatively verified. Also, it is important to only
verify this at the end, *after* all index writers are closed, since only
then can it be guaranteed that no GC will sweep referenced chunks away.

If a chunk is found missing, also mark the previous backup with a
verification failure, since we know the missing chunk has to referenced
in it (only way it could have been inserted to known_chunks with
checked=false). This has the benefit of automatically doing a
full-upload backup if the user attempts to retry after seeing the new
error, instead of requiring a manual verify or forget.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agobackup: check verify state of previous backup before allowing reuse
Stefan Reiter [Mon, 14 Sep 2020 08:50:18 +0000 (10:50 +0200)]
backup: check verify state of previous backup before allowing reuse

Do not allow clients to reuse chunks from the previous backup if it has
a failed validation result. This would result in a new "successful"
backup that potentially references broken chunks.

If the previous backup has not been verified, assume it is fine and
continue on.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agorename BackupDir::new_with_group to BackupDir::with_group
Dietmar Maurer [Tue, 15 Sep 2020 07:40:03 +0000 (09:40 +0200)]
rename BackupDir::new_with_group to BackupDir::with_group

3 years agosrc/backup/backup_info.rs: new BackupDir::with_rfc3339
Dietmar Maurer [Tue, 15 Sep 2020 07:34:46 +0000 (09:34 +0200)]
src/backup/backup_info.rs: new BackupDir::with_rfc3339

3 years agodebian/control: update
Dietmar Maurer [Tue, 15 Sep 2020 07:33:38 +0000 (09:33 +0200)]
debian/control: update

3 years agoavoid chrono dependency, depend on proxmox 0.3.8
Dietmar Maurer [Sat, 12 Sep 2020 13:10:47 +0000 (15:10 +0200)]
avoid chrono dependency, depend on proxmox 0.3.8

- remove chrono dependency

- depend on proxmox 0.3.8

- remove epoch_now, epoch_now_u64 and epoch_now_f64

- remove tm_editor (moved to proxmox crate)

- use new helpers from proxmox 0.3.8
  * epoch_i64 and epoch_f64
  * parse_rfc3339
  * epoch_to_rfc3339_utc
  * strftime_local

- BackupDir changes:
  * store epoch and rfc3339 string instead of DateTime
  * backup_time_to_string now return a Result
  * remove unnecessary TryFrom<(BackupGroup, i64)> for BackupDir

- DynamicIndexHeader: change ctime to i64

- FixedIndexHeader: change ctime to i64

3 years agowww/OnlineHelpInfo.js: update for syncjobs
Dietmar Maurer [Sat, 12 Sep 2020 13:10:08 +0000 (15:10 +0200)]
www/OnlineHelpInfo.js: update for syncjobs

3 years agodebian/control: update hyper dependency
Dietmar Maurer [Fri, 11 Sep 2020 14:03:38 +0000 (16:03 +0200)]
debian/control: update hyper dependency

3 years agobump version to 0.8.16-1 v0.8.16
Dietmar Maurer [Fri, 11 Sep 2020 13:55:37 +0000 (15:55 +0200)]
bump version to 0.8.16-1

3 years agoBackupDir: make constructor fallible
Fabian Grünbichler [Fri, 11 Sep 2020 12:34:38 +0000 (14:34 +0200)]
BackupDir: make constructor fallible

since converting from i64 epoch timestamp to DateTime is not always
possible. previously, passing invalid backup-time from client to server
(or vice-versa) panicked the corresponding tokio task. now we get proper
error messages including the invalid timestamp.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agohandle invalid mtime when formating entries
Fabian Grünbichler [Fri, 11 Sep 2020 12:34:37 +0000 (14:34 +0200)]
handle invalid mtime when formating entries

otherwise operations like catalog shell panic when viewing pxar archives
containing such entries, e.g. with mtime very far ahead into the future.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agouse non-panicky timestamp_opt where appropriate
Fabian Grünbichler [Fri, 11 Sep 2020 12:34:36 +0000 (14:34 +0200)]
use non-panicky timestamp_opt where appropriate

by either printing the original, out-of-range timestamp as-is, or
bailing with a proper error message instead of panicking.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agodon't truncate DateTime nanoseconds
Fabian Grünbichler [Fri, 11 Sep 2020 12:34:35 +0000 (14:34 +0200)]
don't truncate DateTime nanoseconds

where we don't care about them anyway..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agocatalog dump: preserve original mtime
Fabian Grünbichler [Fri, 11 Sep 2020 12:34:34 +0000 (14:34 +0200)]
catalog dump: preserve original mtime

even if it can't be handled by chrono. silently replacing it with epoch
0 is confusing..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoui/docs: add onlineHelp button for syncjobs
Dominik Csapak [Fri, 11 Sep 2020 08:35:28 +0000 (10:35 +0200)]
ui/docs: add onlineHelp button for syncjobs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agodocs: add section for calendar events
Dominik Csapak [Fri, 11 Sep 2020 08:35:27 +0000 (10:35 +0200)]
docs: add section for calendar events

and move the info defined in 'Schedules' there,
the explanation of calendar events is inspired by the systemd.time
manpage and the pve docs (especially the examples are mostly
copied/adapted from there)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: fix calendarevent examples
Dominik Csapak [Fri, 11 Sep 2020 08:35:26 +0000 (10:35 +0200)]
ui: fix calendarevent examples

*/x is valid syntax for us, but not systemd, so to not confuse users
write it like systemd would accept it

also an timespec must at least have hours and minutes

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/systemd/parse_time: enable */x syntax for calendar events
Dominik Csapak [Fri, 11 Sep 2020 08:35:25 +0000 (10:35 +0200)]
tools/systemd/parse_time: enable */x syntax for calendar events

we support this in pve, so also support it here to have a more
consistent syntax

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agodocs: set html img width limitation through css
Thomas Lamprecht [Fri, 11 Sep 2020 09:10:07 +0000 (11:10 +0200)]
docs: set html img width limitation through css

avoid hardcoding width in the docs itself, so that other render
outputs can choose another size.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: do not render TODOs in release builts
Thomas Lamprecht [Fri, 11 Sep 2020 09:08:59 +0000 (11:08 +0200)]
docs: do not render TODOs in release builts

they are not useful for endusers...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: set GmbH as copyright holder
Thomas Lamprecht [Fri, 11 Sep 2020 09:08:33 +0000 (11:08 +0200)]
docs: set GmbH as copyright holder

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: use alabaster theme
Thomas Lamprecht [Fri, 11 Sep 2020 09:05:41 +0000 (11:05 +0200)]
docs: use alabaster theme

It's not all perfect (yet) but way cleaner and simpler to use than
the sphinx one.

Custom do the scrolling for the fixed side bar and make some other
slight adjustments.

Main issue for now is that the "Developer Appendix" is always shown
in the navigation tree, but we only include that toctree for
devbuilds...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agofaq: fix typo
Dylan Whyte [Thu, 10 Sep 2020 12:37:33 +0000 (14:37 +0200)]
faq: fix typo

In note block:
    Proxmox Packup Server -> Proxmox Backup Server

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agobenchmark: update TLS reference speed
Dietmar Maurer [Thu, 10 Sep 2020 10:55:43 +0000 (12:55 +0200)]
benchmark: update TLS reference speed

We are now faster with recent patches.

3 years agoserver: set http2 max frame size
Fabian Grünbichler [Thu, 10 Sep 2020 08:36:33 +0000 (10:36 +0200)]
server: set http2 max frame size

else we get the default of 16k, which is quite low for our use case.
this improves the TLS upload benchmark speed by about 30-40% for me.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agodocs: faq: spell out PBS
Thomas Lamprecht [Thu, 10 Sep 2020 10:33:12 +0000 (12:33 +0200)]
docs: faq: spell out PBS

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoAdd section "FAQ"
Dylan Whyte [Thu, 10 Sep 2020 09:05:00 +0000 (11:05 +0200)]
Add section "FAQ"

Adds an FAQ to the docs, based on question that have
been appearing on the forum.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoexamples/upload-speed.rs: pass new benchmark parameter
Dietmar Maurer [Thu, 10 Sep 2020 07:34:51 +0000 (09:34 +0200)]
examples/upload-speed.rs: pass new benchmark parameter

3 years agobump version to 0.8.15-1 v0.8.15
Dietmar Maurer [Thu, 10 Sep 2020 07:26:16 +0000 (09:26 +0200)]
bump version to 0.8.15-1

3 years agoverify: fix done count
Dietmar Maurer [Thu, 10 Sep 2020 06:54:29 +0000 (08:54 +0200)]
verify: fix done count

We need to filter out benchmark group earlier

3 years agoverify: skip benchmark directory
Dietmar Maurer [Thu, 10 Sep 2020 06:44:18 +0000 (08:44 +0200)]
verify: skip benchmark directory

3 years agoadd benchmark flag to backup creation for proper cleanup when running a benchmark
Hannes Laimer [Wed, 2 Sep 2020 09:41:22 +0000 (11:41 +0200)]
add benchmark flag to backup creation for proper cleanup when running a benchmark

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 years agomount: fix mount subcommand
Dylan Whyte [Tue, 8 Sep 2020 13:33:54 +0000 (15:33 +0200)]
mount: fix mount subcommand

fixes the error, "manifest does not contain
file 'X.pxar'", that occurs when trying to mount
a pxar archive with 'proxmox-backup-client mount':

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoui: only mark backup encrypted if there are any files
Dominik Csapak [Wed, 9 Sep 2020 14:18:11 +0000 (16:18 +0200)]
ui: only mark backup encrypted if there are any files

if we have a stale backup without an manifest, we do not count
the remaining files in the backup dir anymore, but this means
we now have to check here if there are really any encrypted

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoimprove server->client tcp performance for high latency links
Dominik Csapak [Wed, 9 Sep 2020 13:56:54 +0000 (15:56 +0200)]
improve server->client tcp performance for high latency links

similar to the other fix, if we do not set the buffer size manually,
we get better performance for high latency connections

restore benchmark from f.gruenbicher:

no delay, without patch: ~50MB/s
no delay, with patch: ~50MB/s
25ms delay, without patch: ~11MB/s
25ms delay, with path: ~50MB/s

my own restore benchmark:

no delay, without patch: ~1.5GiB/s
no delay, with patch: ~1.5GiB/s
25ms delay, without patch: 30MiB/s
25ms delay, with patch: ~950MiB/s

for some more details about those benchmarks see
https://lists.proxmox.com/pipermail/pbs-devel/2020-September/000600.html

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agofix #2983: improve tcp performance
Dominik Csapak [Wed, 9 Sep 2020 11:54:10 +0000 (13:54 +0200)]
fix #2983: improve tcp performance

by leaving the buffer sizes on default, we get much better tcp performance
for high latency links

throughput is still impacted by latency, but much less so when
leaving the sizes at default.
the disadvantage is slightly higher memory usage of the server
(details below)

my local benchmarks (proxmox-backup-client benchmark):

pbs client:
PVE Host
Epyc 7351P (16core/32thread)
64GB Memory

pbs server:
VM on Host
1 Socket, 4 Cores (Host CPU type)
4GB Memory

average of 3 runs, rounded to MB/s
                    | no delay |     1ms |     5ms |     10ms |    25ms |
without this patch  |  230MB/s |  55MB/s |  13MB/s |    7MB/s |   3MB/s |
with this patch     |  293MB/s | 293MB/s | 249MB/s |  241MB/s | 104MB/s |

memory usage (resident memory) of proxmox-backup-proxy:

                    | peak during benchmarks | after benchmarks |
without this patch  |                  144MB |            100MB |
with this patch     |                  145MB |            130MB |

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agosrc/backup/chunk_store.rs: use ? insteadf of unwrap
Dietmar Maurer [Thu, 10 Sep 2020 04:37:37 +0000 (06:37 +0200)]
src/backup/chunk_store.rs: use ? insteadf of unwrap

3 years agoclean up .bad file handling in sweep_unused_chunks
Stefan Reiter [Tue, 8 Sep 2020 13:02:46 +0000 (15:02 +0200)]
clean up .bad file handling in sweep_unused_chunks

Code cleanup, no functional change intended.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agobackup: ensure no fixed index writers are left over either
Stefan Reiter [Tue, 8 Sep 2020 13:29:42 +0000 (15:29 +0200)]
backup: ensure no fixed index writers are left over either

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agobuildsys: upload client packages also to PMG repo
Thomas Lamprecht [Tue, 8 Sep 2020 14:48:10 +0000 (16:48 +0200)]
buildsys: upload client packages also to PMG repo

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: calendar event: disable matchFieldWidth for picker
Thomas Lamprecht [Tue, 8 Sep 2020 07:13:47 +0000 (09:13 +0200)]
ui: calendar event: disable matchFieldWidth for picker

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: calendar event: enable more complex examples again
Thomas Lamprecht [Tue, 8 Sep 2020 07:04:35 +0000 (09:04 +0200)]
ui: calendar event: enable more complex examples again

now that they (should) work.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoChange "data store" to "datastore" throughout docs
Dylan Whyte [Tue, 8 Sep 2020 09:07:07 +0000 (11:07 +0200)]
Change "data store" to "datastore" throughout docs

Before, there were mixed usages of "data store" and
"datastore" throughout the docs.
This improves consistency in the docs by using only
"datastore" throughout.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agobackup: touch all chunks, even if they exist
Stefan Reiter [Mon, 7 Sep 2020 15:30:36 +0000 (17:30 +0200)]
backup: touch all chunks, even if they exist

We need to update the atime of chunk files if they already exist,
otherwise a concurrently running GC could sweep them away.

This is protected with ChunkStore.mutex, so the fstat/unlink does not
race with touching.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agogc: remove .bad files on garbage collect
Stefan Reiter [Mon, 7 Sep 2020 15:30:34 +0000 (17:30 +0200)]
gc: remove .bad files on garbage collect

The iterator of get_chunk_iterator is extended with a third parameter
indicating whether the current file is a chunk (false) or a .bad file
(true).

Count their sizes to the total of removed bytes, since it also frees
disk space.

.bad files are only deleted if the corresponding chunk exists, i.e. has
been rewritten. Otherwise we might delete data only marked bad because
of transient errors.

While at it, also clean up and use nix::unistd::unlinkat instead of
unsafe libc calls.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agocleanup rename_corrupted_chunk: avoid duplicate format macro
Dietmar Maurer [Tue, 8 Sep 2020 10:29:53 +0000 (12:29 +0200)]
cleanup rename_corrupted_chunk: avoid duplicate format macro

3 years agoverify: rename corrupted chunks with .bad extension
Stefan Reiter [Mon, 7 Sep 2020 15:30:33 +0000 (17:30 +0200)]
verify: rename corrupted chunks with .bad extension

This ensures that following backups will always upload the chunk,
thereby replacing it with a correct version again.

Format for renaming is <digest>.<counter>.bad where <counter> is used if
a chunk is found to be bad again before a GC cleans it up.

Care has been taken to deliberately only rename a chunk in conditions
where it is guaranteed to be an error in the chunk itself. Otherwise a
broken index file could lead to an unwanted mass-rename of chunks.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoverify: fix log units
Stefan Reiter [Mon, 7 Sep 2020 15:30:32 +0000 (17:30 +0200)]
verify: fix log units

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoui: add translation support
Thomas Lamprecht [Mon, 7 Sep 2020 12:33:05 +0000 (14:33 +0200)]
ui: add translation support

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotools: rename extract_auth_cookie to extract_cookie
Thomas Lamprecht [Mon, 7 Sep 2020 12:30:44 +0000 (14:30 +0200)]
tools: rename extract_auth_cookie to extract_cookie

It does nothing specific to authentication..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotools/sytemd/time: add tests for multivalue fields
Dominik Csapak [Mon, 7 Sep 2020 07:19:55 +0000 (09:19 +0200)]
tools/sytemd/time: add tests for multivalue fields

we did this wrong earlier, so it makes sense to add regression tests

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoserver/worker_task: fix upid_read_status
Dominik Csapak [Mon, 7 Sep 2020 12:50:01 +0000 (14:50 +0200)]
server/worker_task: fix upid_read_status

a range from high to low in rust results in an empty range
(see std::ops::Range documentation)
so we need to generate the range from 0..data.len() and then reverse it

also, the task log contains a newline at the end, so we have to remove
that (should it exist)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoEdit section "Network Management"
Dylan Whyte [Wed, 2 Sep 2020 08:22:18 +0000 (10:22 +0200)]
Edit section "Network Management"

Following changes made:
    * Remove empty column "method6" from network list output,
      so table fits in console code-block
    * Walkthrough bond, rather than a bridge as it may be a more
      common setup case

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoPVE integration: Add note about hiding password
Dylan Whyte [Mon, 7 Sep 2020 15:38:36 +0000 (17:38 +0200)]
PVE integration: Add note about hiding password

Add a note to section "Proxmox VE integration" explaining
how to avoid passing password as plain text when using the
pvesm command.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agochange order of "Image Archives" and "File Archives"
Dylan Whyte [Mon, 7 Sep 2020 15:28:48 +0000 (17:28 +0200)]
change order of "Image Archives" and "File Archives"

Change the order of the "Image Archives" and "File
Archives" subsections, so that they match the order
which they are introduced in, in the section "Backup
Content" (minor readability improvement).

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoSync Jobs: add screenshots and explanation
Dylan Whyte [Mon, 7 Sep 2020 15:21:12 +0000 (17:21 +0200)]
Sync Jobs: add screenshots and explanation

Add screenshots of sync jobs panel in web interface
and explain how to carry out related tasks from it.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoNetwork Config: Add screenshots and explanation
Dylan Whyte [Mon, 7 Sep 2020 15:21:11 +0000 (17:21 +0200)]
Network Config: Add screenshots and explanation

Add screenshots for network configuration and explain
how to carry out related tasks using the web interface.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoUser Management: Add screenshots and explanation
Dylan Whyte [Mon, 7 Sep 2020 15:21:10 +0000 (17:21 +0200)]
User Management: Add screenshots and explanation

Add screenshots for user management section in web
interface and explain how to carry out relevant tasks
using it.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoDatastore Config: add screenshots and explanation
Dylan Whyte [Mon, 7 Sep 2020 15:21:09 +0000 (17:21 +0200)]
Datastore Config: add screenshots and explanation

Add screenshots from the datastore section of the
web interface and explain how to carry out tasks using
the web interface.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoDisk Management: Add screenshots and explanation
Dylan Whyte [Mon, 7 Sep 2020 15:21:08 +0000 (17:21 +0200)]
Disk Management: Add screenshots and explanation

This adds screenshots from the web interface for the
sections related to disk management and adds explanation
of how to carry out tasks using the web interface.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoAdd screenshots of web interface
Dylan Whyte [Mon, 7 Sep 2020 15:21:07 +0000 (17:21 +0200)]
Add screenshots of web interface

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agosrc/tools/systemd/time.rs: derive Clone
Dietmar Maurer [Mon, 7 Sep 2020 10:37:08 +0000 (12:37 +0200)]
src/tools/systemd/time.rs: derive Clone

3 years agoSYSTEMD_CALENDAR_EVENT_SCHEMA: fix wrong schema description
Dietmar Maurer [Mon, 7 Sep 2020 07:07:55 +0000 (09:07 +0200)]
SYSTEMD_CALENDAR_EVENT_SCHEMA: fix wrong schema description

3 years agotools/systemd/time: enable dates for calendarevents
Dominik Csapak [Fri, 4 Sep 2020 12:33:34 +0000 (14:33 +0200)]
tools/systemd/time: enable dates for calendarevents

this implements parsing and calculating calendarevents that have a
basic date component (year-mon-day) with the usual syntax options
(*, ranges, lists)

and some special events:
monthly
yearly/annually (like systemd)
quarterly
semiannually,semi-annually (like systemd)

includes some regression tests

the ~ syntax for days (the last x days of the month) is not yet
implemented

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/systemd/time: fix signed conversion
Dominik Csapak [Fri, 4 Sep 2020 12:33:33 +0000 (14:33 +0200)]
tools/systemd/time: fix signed conversion

instead of using 'as' and silently converting wrong,
use the TryInto trait and raise an error if we cannot convert

this should only happen if we have a negative year,
but this is expected (we do not want schedules from before the year 0)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/systemd/tm_editor: add setter/getter for months/years/days
Dominik Csapak [Fri, 4 Sep 2020 12:33:32 +0000 (14:33 +0200)]
tools/systemd/tm_editor: add setter/getter for months/years/days

add_* are modeled after add_days

subtract one for set_mon to have a consistent interface for all fields
(i.e. getter/setter return/expect the 'real' number, not the ones
in the tm struct)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/systemd/tm_editor: move conversion of the year into getter and setter
Dominik Csapak [Fri, 4 Sep 2020 12:33:31 +0000 (14:33 +0200)]
tools/systemd/tm_editor: move conversion of the year into getter and setter

the tm struct contains the year - 1900 but we added that

if we want to use the libc normalization correctly, the tm struct
must have the correct year in it, else the computations for timezones,
etc. fail

instead add a getter that adds the years and a setter that subtracts it again

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/systemd/time: fix selection for multiple options
Dominik Csapak [Fri, 4 Sep 2020 12:33:30 +0000 (14:33 +0200)]
tools/systemd/time: fix selection for multiple options

if we give multiple options/ranges for a value, e.g.
2,4,8
we always choose the biggest, instead of the smallest that is next

this happens because in DateTimeValue::find_next(value)
'next' can be set multiple times and we set it when the new
value was *bigger* than the last found 'next' value, when in reality
we have to choose the *smallest* next we can find

reverse the comparison operator to fix this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/systemd/parse_time: error out on invalid ranges
Dominik Csapak [Fri, 4 Sep 2020 12:33:29 +0000 (14:33 +0200)]
tools/systemd/parse_time: error out on invalid ranges

if the range is reverse (bigger..smaller) we will never find a value,
so error out during parsing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/systemd/tm_editor: remove reset_time from add_days and document it
Dominik Csapak [Fri, 4 Sep 2020 12:33:28 +0000 (14:33 +0200)]
tools/systemd/tm_editor: remove reset_time from add_days and document it

we never passed 'false' to it anyway so remove it
(we can add it again if we should ever need it)

also remove the adding of wday (gets normalized anyway)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/systemd/time: convert the resulting timestamp into an option
Dominik Csapak [Fri, 4 Sep 2020 12:33:27 +0000 (14:33 +0200)]
tools/systemd/time: convert the resulting timestamp into an option

we want to use dates for the calendarspec, and with that there are some
impossible combinations that cannot be detected during parsing
(e.g. some datetimes do not exist in some timezones, and the timezone
can change after setting the schedule)

so finding no timestamp is not an error anymore but a valid result

we omit logging in that case (since it is not an error anymore)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/systemd/time: move continue out of the if/else
Dominik Csapak [Fri, 4 Sep 2020 12:33:26 +0000 (14:33 +0200)]
tools/systemd/time: move continue out of the if/else

will be called anyway

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/systemd/time: let libc normalize time for us
Dominik Csapak [Fri, 4 Sep 2020 12:33:25 +0000 (14:33 +0200)]
tools/systemd/time: let libc normalize time for us

mktime/gmtime can normalize time and even can handle special timezone
cases like the fact that the time 2:30 on specific day/timezone combos
do not exists

we have to convert the signature of all functions that use
normalize_time since mktime/gmtime can return an EOVERFLOW
but if this happens there is no way we can find a good time anyway

since normalize_time will always set wday according to the rest of the
time, remove set_wday

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agotools/systemd/tm_editor: remove TMChanges optimization
Dominik Csapak [Fri, 4 Sep 2020 12:33:24 +0000 (14:33 +0200)]
tools/systemd/tm_editor: remove TMChanges optimization

while it was correct, there was no measurable speed gain
(a benchmark yielded 2.8 ms for a spec that did not find a timestamp either way)
so remove it for simpler code

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoserver/worker_task: fix 'unknown' status for some big task logs
Dietmar Maurer [Fri, 4 Sep 2020 08:41:13 +0000 (10:41 +0200)]
server/worker_task: fix 'unknown' status for some big task logs

when trying to parse the task status, we seek 8k from the end
which may be into the middle of a line, so the datetime parsing
can fail (when the log message contains ': ')

This patch does a fast search for the last line, and avoid the
'lines' iterator.

3 years agodepend on proxmox 0.3.5
Dietmar Maurer [Fri, 4 Sep 2020 06:11:53 +0000 (08:11 +0200)]
depend on proxmox 0.3.5

3 years agofix #2978: allow non-root to view datastore usage
Fabian Grünbichler [Thu, 3 Sep 2020 12:49:22 +0000 (14:49 +0200)]
fix #2978: allow non-root to view datastore usage

for datastores where the requesting user has read or write permissions,
since the API method itself filters by that already. this is the same
permission setting and filtering that the datastore list API endpoint
does.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoonline help: use a phony target and regenerate
Thomas Lamprecht [Wed, 2 Sep 2020 12:41:03 +0000 (14:41 +0200)]
online help: use a phony target and regenerate

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: add prototype sphinx extension for online help
Oguz Bektas [Wed, 2 Sep 2020 12:22:36 +0000 (14:22 +0200)]
docs: add prototype sphinx extension for online help

goes through the sections in the documents and creates the
OnlineHelpInfo.js file from the explicitly defined section labels which
are used in the js files with 'onlineHelp' variable.

3 years agobump version to 0.8.14-1 v0.8.14
Thomas Lamprecht [Wed, 2 Sep 2020 07:36:56 +0000 (09:36 +0200)]
bump version to 0.8.14-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agogc: improve percentage done logs
Dietmar Maurer [Wed, 2 Sep 2020 08:03:53 +0000 (10:03 +0200)]
gc: improve percentage done logs

3 years agoverify: also fail on server shutdown
Dietmar Maurer [Wed, 2 Sep 2020 07:50:17 +0000 (09:50 +0200)]
verify: also fail on server shutdown

3 years agoui: datastore content: eslint fixes
Thomas Lamprecht [Wed, 2 Sep 2020 07:15:53 +0000 (09:15 +0200)]
ui: datastore content: eslint fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore: show more granular verify state
Thomas Lamprecht [Wed, 2 Sep 2020 07:13:37 +0000 (09:13 +0200)]
ui: datastore: show more granular verify state

Allows to differ the following situations:
* some snapshots in a group where not verified
* how many snapshots failed to verify in a group
* all snapshots verified but last verification task was over 30 days
  ago

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore: mark row invalid if last snapshot verification failed
Thomas Lamprecht [Wed, 2 Sep 2020 07:12:05 +0000 (09:12 +0200)]
ui: datastore: mark row invalid if last snapshot verification failed

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoverify: log progress
Dietmar Maurer [Wed, 2 Sep 2020 05:43:04 +0000 (07:43 +0200)]
verify: log progress

3 years agodatastore content: search: set emptytext to searched columns
Thomas Lamprecht [Tue, 1 Sep 2020 16:30:20 +0000 (18:30 +0200)]
datastore content: search: set emptytext to searched columns

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodatastore content: reduce count column width
Thomas Lamprecht [Tue, 1 Sep 2020 16:28:12 +0000 (18:28 +0200)]
datastore content: reduce count column width

Using 75 as width we can display up to 9999999 which would allow
displaying over 19 years of snapshots done each minute, so quite
enough for the common cases.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodatastore content: reload after verify
Thomas Lamprecht [Tue, 1 Sep 2020 16:27:30 +0000 (18:27 +0200)]
datastore content: reload after verify

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/postinst: always fixup termproxy user id and for all users
Stefan Reiter [Tue, 1 Sep 2020 14:50:18 +0000 (16:50 +0200)]
d/postinst: always fixup termproxy user id and for all users

Anyone with a PAM account and Sys.Console access could have started a
termproxy session, adapt the regex.

Always test for broken entries and run the sed expression to make sure
eventually all occurences of the broken syntax are fixed.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoui: DataStoreContent.js: fix wrong comma
Dominik Csapak [Tue, 1 Sep 2020 09:05:21 +0000 (11:05 +0200)]
ui: DataStoreContent.js: fix wrong comma

should be semicolon

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: DataStoreContent: improve encrypted column
Dominik Csapak [Tue, 1 Sep 2020 09:05:20 +0000 (11:05 +0200)]
ui: DataStoreContent: improve encrypted column

do not count files where we do not have any information

such files exist in the backup dir, but are not in the manifest
so we cannot use those files for determining if the backups are
encrypted or not

this marks encrypted/signed backups with unencrypted client.log.blob files as
encrypted/signed (respectively) instead of 'Mixed'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agosrc/backup/verify.rs: use global hashes (instead of per group)
Dietmar Maurer [Tue, 1 Sep 2020 11:33:04 +0000 (13:33 +0200)]
src/backup/verify.rs: use global hashes (instead of per group)

This makes verify more predictable.

3 years agosrc/backup/data_blob.rs: avoid useless &, data is already a reference
Dietmar Maurer [Tue, 1 Sep 2020 10:47:17 +0000 (12:47 +0200)]
src/backup/data_blob.rs: avoid useless &, data is already a reference

3 years agosrc/backup/verify.rs: use separate thread to load data
Dietmar Maurer [Tue, 1 Sep 2020 09:17:13 +0000 (11:17 +0200)]
src/backup/verify.rs: use separate thread to load data

3 years agodebian/control: fix versions
Dietmar Maurer [Tue, 1 Sep 2020 08:19:40 +0000 (10:19 +0200)]
debian/control: fix versions