]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
2 years agoacme: new_account: prevent replacing existing accounts
Wolfgang Bumiller [Fri, 22 Oct 2021 06:35:24 +0000 (08:35 +0200)]
acme: new_account: prevent replacing existing accounts

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 2.0.13-1
Dietmar Maurer [Thu, 21 Oct 2021 06:17:38 +0000 (08:17 +0200)]
bump version to 2.0.13-1

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoupdate dedian/control
Dietmar Maurer [Thu, 21 Oct 2021 05:59:45 +0000 (07:59 +0200)]
update dedian/control

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agouse new fsync parameter to replace_file and atomic_open_or_create
Dietmar Maurer [Wed, 20 Oct 2021 12:56:15 +0000 (14:56 +0200)]
use new fsync parameter to replace_file and atomic_open_or_create

Depend on proxmox 0.15.0 and proxmox-openid 0.8.1

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agotape: simplify export_media_set for pool writer
Dominik Csapak [Mon, 18 Oct 2021 09:24:12 +0000 (11:24 +0200)]
tape: simplify export_media_set for pool writer

our export code can handle if the tape is inside the drive, so unloading
it first does not have an benefit, it even makes the exporting slower,
since we first unload it into its original slot, and then moving it
to an import/export slot

so drop the code that unloads the tape from the drive, and let the
export code itself handle that

change the 'eject' into a 'rewind' and comment why we do that first

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agorest-server: use hashmap for parameter errors
Dominik Csapak [Tue, 19 Oct 2021 11:09:27 +0000 (13:09 +0200)]
rest-server: use hashmap for parameter errors

our ui expects a map here with 'field: "error"'. This way it can mark
the relevant field as invalid and correctly shows the complete error
message

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoproxmox-rrd: use fsync instead of syncfs
Dietmar Maurer [Tue, 19 Oct 2021 16:33:19 +0000 (18:33 +0200)]
proxmox-rrd: use fsync instead of syncfs

syncfs can sync unrelated data, and we do not want that.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoproxmox-rrd: fix regression tests
Dietmar Maurer [Tue, 19 Oct 2021 16:41:03 +0000 (18:41 +0200)]
proxmox-rrd: fix regression tests

2 years agoproxmox-rrd: improve dev docs
Dietmar Maurer [Tue, 19 Oct 2021 09:14:57 +0000 (11:14 +0200)]
proxmox-rrd: improve dev docs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoproxmox-rrd: cleanup - impl FromStr for JournalEntry
Dietmar Maurer [Tue, 19 Oct 2021 08:51:22 +0000 (10:51 +0200)]
proxmox-rrd: cleanup - impl FromStr for JournalEntry

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoproxmox-rrd: add option to avoid page cache for load/save
Dietmar Maurer [Tue, 19 Oct 2021 07:46:05 +0000 (09:46 +0200)]
proxmox-rrd: add option to avoid page cache for load/save

use fadvice(.., POSIX_FADV_DONTNEED) for RRD files. We read those files only once,
and always rewrite them.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agoproxmox-rrd: use syncfs after writing rrd files
Dietmar Maurer [Mon, 18 Oct 2021 11:45:30 +0000 (13:45 +0200)]
proxmox-rrd: use syncfs after writing rrd files

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 years agobump version to 2.0.12-1
Thomas Lamprecht [Tue, 19 Oct 2021 08:48:54 +0000 (10:48 +0200)]
bump version to 2.0.12-1

note, this bump happened outside the main branch as it wasn't in a
good state and there was need for bumping (log/task rotate stuff).

Cherry picking the actual bump to avoid changelog/versioning
confusion on the next one, that should again happen on the main
branch.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit edc876c58e619ee4306f252485a4e364e3bb7784)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: use fine grained locking in commit_journal_impl
Dietmar Maurer [Mon, 18 Oct 2021 12:52:27 +0000 (14:52 +0200)]
proxmox-rrd: use fine grained locking in commit_journal_impl

Aquire the rrd_map lock for each file (else we block access for a long time)

2 years agoproxmox-rrd: log all errors from apply_and_commit_journal_thread (but only once)
Dietmar Maurer [Mon, 18 Oct 2021 09:57:19 +0000 (11:57 +0200)]
proxmox-rrd: log all errors from apply_and_commit_journal_thread (but only once)

2 years agotape: improve export_media error message for not found tape
Dominik Csapak [Fri, 15 Oct 2021 08:32:59 +0000 (10:32 +0200)]
tape: improve export_media error message for not found tape

'export_media' can handle if the tape is in either a normal slot of the
library, or in the drive assigned to the current pool writer.
(because we need to lock the drive)

if it is, for some reason, in a different drive, the error message
 'media is not online'
could be slightly confusing for a user, since it would appear in the drive list

add the 'or a differen drive' to make it clearer

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoproxmox-rrd: cleanup list_old_journals
Dietmar Maurer [Mon, 18 Oct 2021 08:00:16 +0000 (10:00 +0200)]
proxmox-rrd: cleanup list_old_journals

2 years agoproxmox-rrd: cleanup - use struct instead of tuple
Dietmar Maurer [Sat, 16 Oct 2021 10:38:34 +0000 (12:38 +0200)]
proxmox-rrd: cleanup - use struct instead of tuple

2 years agoproxmox-rrd: move RRDMap into extra file
Dietmar Maurer [Sat, 16 Oct 2021 10:22:40 +0000 (12:22 +0200)]
proxmox-rrd: move RRDMap into extra file

2 years agoproxmox-rrd: move JournalState into extra file
Dietmar Maurer [Sat, 16 Oct 2021 10:00:25 +0000 (12:00 +0200)]
proxmox-rrd: move JournalState into extra file

2 years agoproxmox-rrd: implement non blocking journal
Dietmar Maurer [Fri, 15 Oct 2021 10:26:33 +0000 (12:26 +0200)]
proxmox-rrd: implement non blocking journal

Do not block while applying the journal.

2 years agoproxmox-rrd: rename RRDCacheState to JournalState
Dietmar Maurer [Fri, 15 Oct 2021 07:35:44 +0000 (09:35 +0200)]
proxmox-rrd: rename RRDCacheState to JournalState

2 years agoproxmox-rrd: avoild blocking readers while applying the journal
Dietmar Maurer [Fri, 15 Oct 2021 07:22:07 +0000 (09:22 +0200)]
proxmox-rrd: avoild blocking readers while applying the journal

By using and extra RwLock<RRDMap> on the rrd data.

2 years agoproxmox-rrd: log journal apply/flush times, split apply and flush
Dietmar Maurer [Thu, 14 Oct 2021 14:41:08 +0000 (16:41 +0200)]
proxmox-rrd: log journal apply/flush times, split apply and flush

We need to apply the journal only once.

2 years agoproxmox-rrd: cleanup - use slot_end_time()
Dietmar Maurer [Thu, 14 Oct 2021 14:29:00 +0000 (16:29 +0200)]
proxmox-rrd: cleanup - use slot_end_time()

2 years agoproxmox-rrd: cleanup - use staturating_add instead of if/else
Dietmar Maurer [Thu, 14 Oct 2021 14:10:55 +0000 (16:10 +0200)]
proxmox-rrd: cleanup - use staturating_add instead of if/else

2 years agoproxmox-rrd: improve dev docs
Dietmar Maurer [Thu, 14 Oct 2021 09:53:54 +0000 (11:53 +0200)]
proxmox-rrd: improve dev docs

2 years agoproxmox-rrd: make rrd load callback configurable
Dietmar Maurer [Thu, 14 Oct 2021 09:41:26 +0000 (11:41 +0200)]
proxmox-rrd: make rrd load callback configurable

2 years agoproxmox-rrd: add more regression tests
Dietmar Maurer [Thu, 14 Oct 2021 08:55:12 +0000 (10:55 +0200)]
proxmox-rrd: add more regression tests

2 years agoproxmox-rrd: add regression tests and two minor fixes
Dietmar Maurer [Thu, 14 Oct 2021 08:17:07 +0000 (10:17 +0200)]
proxmox-rrd: add regression tests and two minor fixes

2 years agoproxmox-rrd: pass time and value to update function
Dietmar Maurer [Thu, 14 Oct 2021 06:11:04 +0000 (08:11 +0200)]
proxmox-rrd: pass time and value to update function

2 years agocleanup: move rrd cache related code into extra file
Dietmar Maurer [Thu, 14 Oct 2021 05:48:32 +0000 (07:48 +0200)]
cleanup: move rrd cache related code into extra file

2 years agoproxmox-rrd: add some integration tests (file format tests)
Dietmar Maurer [Wed, 13 Oct 2021 16:20:06 +0000 (18:20 +0200)]
proxmox-rrd: add some integration tests (file format tests)

2 years agobump d/control
Wolfgang Bumiller [Wed, 13 Oct 2021 12:47:24 +0000 (14:47 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-tools: drop borrow module
Wolfgang Bumiller [Wed, 13 Oct 2021 08:40:50 +0000 (10:40 +0200)]
pbs-tools: drop borrow module

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agouse complete_file_name from proxmox-router 1.1
Dietmar Maurer [Wed, 13 Oct 2021 10:55:51 +0000 (12:55 +0200)]
use complete_file_name from proxmox-router 1.1

2 years agoproxmox-rrd: move unshipped cli tool to examples
Thomas Lamprecht [Wed, 13 Oct 2021 11:33:15 +0000 (13:33 +0200)]
proxmox-rrd: move unshipped cli tool to examples

it's a rather low-level tool mostly useful for debugging and some of
it is rather "dumb" (by design) anyway, e.g., it does not
transparently applies journal but really only operates on the DB
files as is (which can conflict with daemon operations).

In summary, not (yet) a tool meant for end user consumption.
Move it to examples folder to avoid compilation on packaging (we do
not ship it anyway) which allows us to move the rather expensive
proxmox-router (pulls in hyper) to the dev-dependencies section.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: add more commands to the rrd cli tool
Dietmar Maurer [Wed, 13 Oct 2021 08:24:52 +0000 (10:24 +0200)]
proxmox-rrd: add more commands to the rrd cli tool

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: rename last_counter to last_value
Dietmar Maurer [Wed, 13 Oct 2021 08:24:51 +0000 (10:24 +0200)]
proxmox-rrd: rename last_counter to last_value

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: protect against negative update time
Dietmar Maurer [Wed, 13 Oct 2021 08:24:50 +0000 (10:24 +0200)]
proxmox-rrd: protect against negative update time

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: new helpers: slot, slot_start_time & slot_end_time
Dietmar Maurer [Wed, 13 Oct 2021 08:24:49 +0000 (10:24 +0200)]
proxmox-rrd: new helpers: slot, slot_start_time & slot_end_time

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: avoid expensive modulo (%) inside loop
Dietmar Maurer [Wed, 13 Oct 2021 08:24:48 +0000 (10:24 +0200)]
proxmox-rrd: avoid expensive modulo (%) inside loop

Modulo is very slow, so we try to avoid it inside loops.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: add binary to create/manage rrd files
Dietmar Maurer [Wed, 13 Oct 2021 08:24:47 +0000 (10:24 +0200)]
proxmox-rrd: add binary to create/manage rrd files

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: split out load_rrd (cleanup)
Dietmar Maurer [Wed, 13 Oct 2021 08:24:46 +0000 (10:24 +0200)]
proxmox-rrd: split out load_rrd (cleanup)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: support CF::Last
Dietmar Maurer [Wed, 13 Oct 2021 08:24:45 +0000 (10:24 +0200)]
proxmox-rrd: support CF::Last

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoremove proxmox-rrd-api-types crate, s/RRDTimeFrameResolution/RRDTimeFrame/
Dietmar Maurer [Wed, 13 Oct 2021 08:24:44 +0000 (10:24 +0200)]
remove proxmox-rrd-api-types crate, s/RRDTimeFrameResolution/RRDTimeFrame/

Because the types used inside the RRD have other requirements
than the API types:

- other serialization format
- the API may not support all RRD features

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: extract_data: include values from current slot
Dietmar Maurer [Wed, 13 Oct 2021 08:24:43 +0000 (10:24 +0200)]
proxmox-rrd: extract_data: include values from current slot

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: remove dependency to proxmox-rrd-api-types
Dietmar Maurer [Wed, 13 Oct 2021 08:24:42 +0000 (10:24 +0200)]
proxmox-rrd: remove dependency to proxmox-rrd-api-types

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: implement new CBOR based format
Dietmar Maurer [Wed, 13 Oct 2021 08:24:41 +0000 (10:24 +0200)]
proxmox-rrd: implement new CBOR based format

Storing much more data points now got get better graphs.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-backup-proxy: use tokio::task::spawn_blocking instead of block_in_place
Dietmar Maurer [Wed, 13 Oct 2021 08:24:40 +0000 (10:24 +0200)]
proxmox-backup-proxy: use tokio::task::spawn_blocking instead of block_in_place

allow the current thread to do some other work in-between

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoRRD_CACHE: use a OnceCell instead of lazy_static
Dietmar Maurer [Wed, 13 Oct 2021 08:24:39 +0000 (10:24 +0200)]
RRD_CACHE: use a OnceCell instead of lazy_static

And initialize only with proxmox-backup-proxy. Other binaries dont need it.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rrd: use a journal to reduce amount of bytes written
Dietmar Maurer [Wed, 13 Oct 2021 08:24:38 +0000 (10:24 +0200)]
proxmox-rrd: use a journal to reduce amount of bytes written

Append pending changes in a simple text based format that allows for
lockless appends as long as we stay below 4 KiB data per write.

Apply the journal every 30 minutes and on daemon startup.

Note that we do not ensure that the journal is synced, this is a
perfomance optimization we can make as the kernel defaults to
writeback in-flight data every 30s (sysctl vm/dirty_expire_centisecs)
anyway, so we lose at max half a minute of data on a crash, here one
should have in mind that we normally expose 1 minute as finest
granularity anyway, so not really much lost.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoremove pbs-tools::ops::ControlFlow
Wolfgang Bumiller [Tue, 12 Oct 2021 12:34:08 +0000 (14:34 +0200)]
remove pbs-tools::ops::ControlFlow

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-config: drop default-features on proxmox-router dep
Wolfgang Bumiller [Tue, 12 Oct 2021 11:11:06 +0000 (13:11 +0200)]
pbs-config: drop default-features on proxmox-router dep

we don't need the 'cli' feature in there

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodocs: language and formatting fixup
Dylan Whyte [Mon, 11 Oct 2021 15:15:19 +0000 (17:15 +0200)]
docs: language and formatting fixup

Some minor langague and formatting fixes to sections: Proxmox VE
Integration, pxar Command Line Tool, Managing Remotes, Maintenance
Tasks, Host System Administration, Network Management, and Technical
Overview.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
2 years agodocs: backup-client: langauge and formatting fixup
Dylan Whyte [Mon, 11 Oct 2021 11:46:34 +0000 (13:46 +0200)]
docs: backup-client: langauge and formatting fixup

also remove todo item for scheduling garbage collect with cron, and add
note about schedule configuration through proxmox-backup-manager/PBS GUI

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
2 years agodocs: Update for new features/functionality
Dylan Whyte [Mon, 11 Oct 2021 11:11:44 +0000 (13:11 +0200)]
docs: Update for new features/functionality

Update GUI section and GUI instructions to reflect current layout and
features

List OpenID connect in possible realms (user management)

Link Access Control section when referring to it (user management)

Include Tape roles in access control section

Minor formatting changes

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
2 years agodocs: language and formatting fixup
Dylan Whyte [Mon, 11 Oct 2021 11:11:43 +0000 (13:11 +0200)]
docs: language and formatting fixup

Some minor changes to the sections: Introduction, Installation,
Terminology, GUI, Storage, and User Management

Mention tape backup in main features

Update epilog.rst with link for 'LXC'.
Remove FIXME from epilog.rst (I believe this was a note to repair
the not-yet-created pbs wiki link).

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
2 years agoapi daemons: fix sending log-reopen command
Dominik Csapak [Mon, 11 Oct 2021 12:14:32 +0000 (14:14 +0200)]
api daemons: fix sending log-reopen command

send_command serializes everything so it cannot be used to send a
raw, optimized command. Normally that means we get an error like
> 'unable to parse parameters (expected json object)'
when used that way.

Switch over to send_raw_command which does not re-serializes the
command.

Fixes: 45b8a032 ("refactor send_command")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump d/control
Wolfgang Bumiller [Mon, 11 Oct 2021 10:08:11 +0000 (12:08 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoupdate to first proxmox crate split
Wolfgang Bumiller [Fri, 8 Oct 2021 09:19:37 +0000 (11:19 +0200)]
update to first proxmox crate split

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump proxmox dependency to 0.14.0 and proxmox-http to 0.5.0
Wolfgang Bumiller [Fri, 8 Oct 2021 09:18:22 +0000 (11:18 +0200)]
bump proxmox dependency to 0.14.0 and proxmox-http to 0.5.0

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoproxmox-backup-proxy: clean up old tasks when the task log was rotated
Dominik Csapak [Thu, 7 Oct 2021 12:03:37 +0000 (14:03 +0200)]
proxmox-backup-proxy: clean up old tasks when the task log was rotated

we maybe have old tasks when the task list was rotated, so clean them up

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agorest-server: add cleanup_old_tasks
Dominik Csapak [Thu, 7 Oct 2021 12:03:36 +0000 (14:03 +0200)]
rest-server: add cleanup_old_tasks

this is a helper that removes task log files that are not referenced
by the task archive anymore

it gets the oldest task archive file, gets the first endtime (the
oldest) and removes all files in the taskdir where the mtime is older
than that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoproxmox-rrd: use correct directory options in create_rrdb_dir
Dietmar Maurer [Thu, 7 Oct 2021 06:50:50 +0000 (08:50 +0200)]
proxmox-rrd: use correct directory options in create_rrdb_dir

2 years agoproxmox-rrd: cleanup error handling
Dietmar Maurer [Thu, 7 Oct 2021 06:01:12 +0000 (08:01 +0200)]
proxmox-rrd: cleanup error handling

2 years agoproxmox-rrd: use log crate instead of eprintln, avoid duplicate logs
Dietmar Maurer [Wed, 6 Oct 2021 16:19:22 +0000 (18:19 +0200)]
proxmox-rrd: use log crate instead of eprintln, avoid duplicate logs

2 years agoproxmox-rrd: fix update (do not update) when time is in the past
Dietmar Maurer [Wed, 6 Oct 2021 16:00:37 +0000 (18:00 +0200)]
proxmox-rrd: fix update (do not update) when time is in the past

2 years agodrop dynamic_index.rs duplicate in pbs-client
Wolfgang Bumiller [Wed, 6 Oct 2021 13:29:27 +0000 (15:29 +0200)]
drop dynamic_index.rs duplicate in pbs-client

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-tools::io::pipe: use nix Error type
Wolfgang Bumiller [Wed, 6 Oct 2021 13:18:06 +0000 (15:18 +0200)]
pbs-tools::io::pipe: use nix Error type

there's no need to upgrade to anyhow::Error there already

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoproxmox-rrd: improve developer docs
Dietmar Maurer [Wed, 6 Oct 2021 10:19:54 +0000 (12:19 +0200)]
proxmox-rrd: improve developer docs

2 years agoproxmox-rrd: remove serde dependency
Dietmar Maurer [Wed, 6 Oct 2021 08:55:46 +0000 (10:55 +0200)]
proxmox-rrd: remove serde dependency

2 years agosplit out RRD api types into proxmox-rrd-api-types crate
Dietmar Maurer [Wed, 6 Oct 2021 07:49:51 +0000 (09:49 +0200)]
split out RRD api types into proxmox-rrd-api-types crate

2 years agoproxmox-rrd: use create_path instead of std::fs::create_dir_all
Dietmar Maurer [Wed, 6 Oct 2021 06:37:14 +0000 (08:37 +0200)]
proxmox-rrd: use create_path instead of std::fs::create_dir_all

To ensure correct file ownership.

2 years agomove RRD code into proxmox-rrd crate
Dietmar Maurer [Wed, 6 Oct 2021 05:06:17 +0000 (07:06 +0200)]
move RRD code into proxmox-rrd crate

2 years agobump version to 2.0.11-1
Thomas Lamprecht [Tue, 5 Oct 2021 14:34:35 +0000 (16:34 +0200)]
bump version to 2.0.11-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/changelog: fixup release
Thomas Lamprecht [Tue, 5 Oct 2021 12:23:28 +0000 (14:23 +0200)]
d/changelog: fixup release

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rest-server: use new ServerAdapter trait instead of callbacks
Dietmar Maurer [Tue, 5 Oct 2021 09:01:05 +0000 (11:01 +0200)]
proxmox-rest-server: use new ServerAdapter trait instead of callbacks

Async callbacks are a PITA, so we now pass a single trait object which
implements check_auth and get_index.

2 years agoproxmox-rest-server: pass owned RestEnvironment to get_index
Dietmar Maurer [Mon, 4 Oct 2021 12:49:25 +0000 (14:49 +0200)]
proxmox-rest-server: pass owned RestEnvironment to get_index

This way we avoid pointers with lifetimes.

2 years agoproxmox-rest-server: cleanup, access api_auth using a method
Dietmar Maurer [Mon, 4 Oct 2021 11:32:19 +0000 (13:32 +0200)]
proxmox-rest-server: cleanup, access api_auth using a method

2 years agofix deprecated use of std::u64/... modules
Wolfgang Bumiller [Mon, 4 Oct 2021 12:58:55 +0000 (14:58 +0200)]
fix deprecated use of std::u64/... modules

integer primitive type modules are deprecated, use
associated constants instead

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: datastore/Content: add empty text for no snapshots
Dominik Csapak [Fri, 1 Oct 2021 09:56:55 +0000 (11:56 +0200)]
ui: datastore/Content: add empty text for no snapshots

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: datastore/Content: reload in activate listener
Dominik Csapak [Fri, 1 Oct 2021 09:56:54 +0000 (11:56 +0200)]
ui: datastore/Content: reload in activate listener

when we trigger the first load before the panel was fully created,
there was no load mask for it (but the snapshots would "pop in" on load)

move the first reload into the 'activate' listener. this will be called
the every time a user opens the content tab of a datastore, so guard
it by a 'firstLoad' bool.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agorest: daemon: group systemd FFI together
Thomas Lamprecht [Fri, 1 Oct 2021 14:46:59 +0000 (16:46 +0200)]
rest: daemon: group systemd FFI together

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest: daemon: sd notify: code cleanup
Thomas Lamprecht [Fri, 1 Oct 2021 14:45:19 +0000 (16:45 +0200)]
rest: daemon: sd notify: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest: daemon: sd notify barrier: avoid barging in between SystemdNotify enum and...
Thomas Lamprecht [Fri, 1 Oct 2021 14:44:28 +0000 (16:44 +0200)]
rest: daemon: sd notify barrier: avoid barging in between SystemdNotify enum and systemd_notify

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest: daemon: sd notify barrier: allow caller to set timeout
Thomas Lamprecht [Fri, 1 Oct 2021 13:27:46 +0000 (15:27 +0200)]
rest: daemon: sd notify barrier: allow caller to set timeout

else it's rather to subtle and not a nice interface considering that
we only want to have a thin wrapper for sd_notify_barrier..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest: daemon: comment why using a systemd barrier is important for main PID handover
Thomas Lamprecht [Fri, 1 Oct 2021 13:04:58 +0000 (15:04 +0200)]
rest: daemon: comment why using a systemd barrier is important for main PID handover

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest-server/daemon: use sd_notify_barrier for service reloading
Dominik Csapak [Thu, 30 Sep 2021 07:18:58 +0000 (09:18 +0200)]
rest-server/daemon: use sd_notify_barrier for service reloading

until now, we manually polled the systemd service state during a reload
so that the sd_notify messages get processed in the correct order
(RELOAD(old) -> MAINPID(old) -> READY(new))

with systemd >= 246 there is now 'sd_notify_barrier' which
blocks until systemd processed all prior messages

with that change, the daemon does not need to know the service name anymore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-rest-server: make get_index async
Dietmar Maurer [Fri, 1 Oct 2021 07:38:10 +0000 (09:38 +0200)]
proxmox-rest-server: make get_index async

2 years agoproxmox-rest-server: add comment why ApiService needs to be 'pub'
Dietmar Maurer [Fri, 1 Oct 2021 06:35:51 +0000 (08:35 +0200)]
proxmox-rest-server: add comment why ApiService needs to be 'pub'

2 years agoproxmox-rest-server: make check_auth async
Dietmar Maurer [Fri, 1 Oct 2021 05:29:11 +0000 (07:29 +0200)]
proxmox-rest-server: make check_auth async

2 years agoproxmox-rest-server: fix spelling errors
Dietmar Maurer [Fri, 1 Oct 2021 04:43:30 +0000 (06:43 +0200)]
proxmox-rest-server: fix spelling errors

2 years agoproxmox-rest-server: improve ApiService docs
Dietmar Maurer [Thu, 30 Sep 2021 15:18:47 +0000 (17:18 +0200)]
proxmox-rest-server: improve ApiService docs

2 years agoproxmox-rest-server: start module docs
Dietmar Maurer [Thu, 30 Sep 2021 11:49:29 +0000 (13:49 +0200)]
proxmox-rest-server: start module docs

2 years agorename CommandoSocket to CommandSocket
Dietmar Maurer [Thu, 30 Sep 2021 10:31:38 +0000 (12:31 +0200)]
rename CommandoSocket to CommandSocket

2 years agotools::format: avoid some string copies
Wolfgang Bumiller [Thu, 30 Sep 2021 09:41:21 +0000 (11:41 +0200)]
tools::format: avoid some string copies

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodrop str::join helper
Wolfgang Bumiller [Thu, 30 Sep 2021 09:35:12 +0000 (11:35 +0200)]
drop str::join helper

the standard join method can do this now

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodrop fd_change_cloexec from proxmox-rest-server
Wolfgang Bumiller [Thu, 30 Sep 2021 10:42:28 +0000 (12:42 +0200)]
drop fd_change_cloexec from proxmox-rest-server

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoproxmox-rest-server: improve docs
Dietmar Maurer [Thu, 30 Sep 2021 09:59:21 +0000 (11:59 +0200)]
proxmox-rest-server: improve docs

And rename enable_file_log to enable_access_log.