]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
3 years agoprune sim: avoid unnecessary viewmodel formula
Thomas Lamprecht [Sat, 7 Nov 2020 12:33:07 +0000 (13:33 +0100)]
prune sim: avoid unnecessary viewmodel formula

we set a reference on the checkbox, so we get this for free

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoprune sim: fix numberfield spinner scroll with firefox
Thomas Lamprecht [Sat, 7 Nov 2020 12:32:00 +0000 (13:32 +0100)]
prune sim: fix numberfield spinner scroll with firefox

copied over from widget toolkit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoprune sim: eslint fixes, do not define console
Thomas Lamprecht [Sat, 7 Nov 2020 12:31:09 +0000 (13:31 +0100)]
prune sim: eslint fixes, do not define console

really not required nowadays, and we do not use it anyway here..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoprune sim: improve documentation layout
Thomas Lamprecht [Sat, 7 Nov 2020 12:28:49 +0000 (13:28 +0100)]
prune sim: improve documentation layout

Better line height, some margin on the edges, and max width to avoid
very long lines on wide displays.

Avoid to much contrast by using black on white, use a very dark grey
instead.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: datastore: backup owner change: fix layout
Thomas Lamprecht [Fri, 6 Nov 2020 18:48:08 +0000 (19:48 +0100)]
ui: datastore: backup owner change: fix layout

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: move backup group owner changer into window folder
Thomas Lamprecht [Fri, 6 Nov 2020 18:47:00 +0000 (19:47 +0100)]
ui: move backup group owner changer into window folder

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: auth-id selector: validity, code-style and layout fixes
Thomas Lamprecht [Fri, 6 Nov 2020 18:46:08 +0000 (19:46 +0100)]
ui: auth-id selector: validity, code-style and layout fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: use AuthidSelector for selecting new owner
Fabian Grünbichler [Fri, 6 Nov 2020 12:01:58 +0000 (13:01 +0100)]
ui: use AuthidSelector for selecting new owner

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoui: use AuthidSelector for sync job owner
Fabian Grünbichler [Fri, 6 Nov 2020 12:01:57 +0000 (13:01 +0100)]
ui: use AuthidSelector for sync job owner

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoproxmox-backup-proxy: remove unnecessary alias
Dominik Csapak [Fri, 6 Nov 2020 10:03:38 +0000 (11:03 +0100)]
proxmox-backup-proxy: remove unnecessary alias

the basedir is already /usr/share/javascript/proxmox-backup/
so adding a subdir of that as alias is not needed

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoui: datastore: add option view tab
Thomas Lamprecht [Fri, 6 Nov 2020 16:51:52 +0000 (17:51 +0100)]
ui: datastore: add option view tab

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: add NotifyOptions edit window
Thomas Lamprecht [Fri, 6 Nov 2020 16:49:22 +0000 (17:49 +0100)]
ui: add NotifyOptions edit window

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: maintenance: document notifications
Thomas Lamprecht [Fri, 6 Nov 2020 16:41:11 +0000 (17:41 +0100)]
docs: maintenance: document notifications

can surely be improved, just to have anything..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: utils: add property format string helpers from PVE
Thomas Lamprecht [Fri, 6 Nov 2020 16:49:42 +0000 (17:49 +0100)]
ui: utils: add property format string helpers from PVE

slightly adapted, i.e., the delete_if_default helper always sets the
delete property to an array if not existing.

Also, filtering out undefined values when printing properties.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi: datastore: allow to set "verify-new" option over API
Thomas Lamprecht [Fri, 6 Nov 2020 13:08:01 +0000 (14:08 +0100)]
api: datastore: allow to set "verify-new" option over API

Until now, one could only set this by editing the configuration file
manually.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoRemove reference to backup@pam
Dietmar Maurer [Fri, 6 Nov 2020 15:32:35 +0000 (16:32 +0100)]
Remove reference to backup@pam

3 years agoAdd screenshots
Dylan Whyte [Fri, 6 Nov 2020 14:46:30 +0000 (15:46 +0100)]
Add screenshots

For:
- api tokens
- new user management interface
- updatae server administration

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agomaintenance: add verification and prune to section
Dylan Whyte [Fri, 6 Nov 2020 14:46:28 +0000 (15:46 +0100)]
maintenance: add verification and prune to section

Includes new screen shots of interface

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoUpdate where to find certain items since GUI update
Dylan Whyte [Fri, 6 Nov 2020 14:46:27 +0000 (15:46 +0100)]
Update where to find certain items since GUI update

- Sync jobs in datastore
- "User management" is now section of Access Control

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agodatastore: description of new datastore view
Dylan Whyte [Fri, 6 Nov 2020 14:46:26 +0000 (15:46 +0100)]
datastore: description of new datastore view

- Add screenshots from new datastore view
- Add description of comment field in create datastore window
- Add description of each tab in the datastore panel
- Update instructions to add datastore from GUI

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agobackup-client: add section on change-owner command
Dylan Whyte [Fri, 6 Nov 2020 14:46:25 +0000 (15:46 +0100)]
backup-client: add section on change-owner command

Add section "Changing the Owner of a Backup Group"

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoinstallation & gui: Formatting fixup
Dylan Whyte [Fri, 6 Nov 2020 14:46:24 +0000 (15:46 +0100)]
installation & gui: Formatting fixup

Fix some minor formatting errors in the docs

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoVec::new is Vec's default default
Wolfgang Bumiller [Fri, 6 Nov 2020 13:55:34 +0000 (14:55 +0100)]
Vec::new is Vec's default default

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoclient: properly complete new-owner
Fabian Grünbichler [Fri, 6 Nov 2020 13:44:44 +0000 (14:44 +0100)]
client: properly complete new-owner

with remote Authids, not local Userids.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agowww: add AuthidSelector
Fabian Grünbichler [Fri, 6 Nov 2020 12:01:56 +0000 (13:01 +0100)]
www: add AuthidSelector

similar to TokenSelector, but with different fields / mapping of data.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agotasks: allow access to job tasks
Fabian Grünbichler [Fri, 6 Nov 2020 10:23:09 +0000 (11:23 +0100)]
tasks: allow access to job tasks

if the user/token could have either configured/manually executed the
task, but it was either executed via the schedule (root@pam) or
another user/token.

without this change, semi-privileged users (that cannot read all tasks
globally, but are DatastoreAdmin) could schedule jobs, but not read
their logs once the schedule executes them. it also makes sense for
multiple such users to see eachothers manually executed jobs, as long as
the privilege level on the datastore (or remote/remote_store/local
store) itself is sufficient.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoverify: allow unprivileged access to admin API
Fabian Grünbichler [Fri, 6 Nov 2020 10:23:08 +0000 (11:23 +0100)]
verify: allow unprivileged access to admin API

which is the one used by the GUI.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoverify: fix unprivileged verification jobs
Fabian Grünbichler [Fri, 6 Nov 2020 10:23:07 +0000 (11:23 +0100)]
verify: fix unprivileged verification jobs

since the store is not a path parameter, we need to do manual instead of
schema checks. also dropping Datastore.Backup here

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoui: improve prune simulator layout
Dietmar Maurer [Fri, 6 Nov 2020 11:12:59 +0000 (12:12 +0100)]
ui: improve prune simulator layout

3 years agoinclude prune simulator in build
Fabian Ebner [Tue, 3 Nov 2020 14:28:42 +0000 (15:28 +0100)]
include prune simulator in build

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 years agocreate prune simulator
Fabian Ebner [Tue, 3 Nov 2020 14:28:41 +0000 (15:28 +0100)]
create prune simulator

A stand-alone ExtJS app that allows experimenting with different backup
schedules and prune parameters.

The HTML for the documentation was taken from the PBS docs and adapted to the
context of the simulator.

For performance reasons, the week table does not use
subcomponents, but raw HTML.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoui: require owner for sync jobs
Dietmar Maurer [Fri, 6 Nov 2020 07:07:02 +0000 (08:07 +0100)]
ui: require owner for sync jobs

3 years agoui: use pbsUserSelector for BackupGroupChangeOwner
Dietmar Maurer [Fri, 6 Nov 2020 06:40:09 +0000 (07:40 +0100)]
ui: use pbsUserSelector for BackupGroupChangeOwner

3 years agogui: Add button for changing backup group owner
Dylan Whyte [Tue, 3 Nov 2020 08:30:54 +0000 (09:30 +0100)]
gui: Add button for changing backup group owner

Extension of fix #2847

Adds an action button to the datastore content view,
to change the owner of a backup.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
3 years agoget rid of backup@pam
Dietmar Maurer [Thu, 5 Nov 2020 13:03:15 +0000 (14:03 +0100)]
get rid of backup@pam

3 years agofixup: acutally commit all changes..
Thomas Lamprecht [Fri, 6 Nov 2020 07:24:30 +0000 (08:24 +0100)]
fixup: acutally commit all changes..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: move datastore related files into own folder
Thomas Lamprecht [Fri, 6 Nov 2020 07:11:06 +0000 (08:11 +0100)]
ui: move datastore related files into own folder

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agowww: add remote store selector
Fabian Grünbichler [Thu, 5 Nov 2020 11:12:24 +0000 (12:12 +0100)]
www: add remote store selector

(hopefully) improved upon NFS export selection in PVE

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoapi: refactor remote client and add remote scan
Fabian Grünbichler [Thu, 5 Nov 2020 11:12:23 +0000 (12:12 +0100)]
api: refactor remote client and add remote scan

to allow on-demand scanning of remote datastores accessible for the
configured remote user.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agotypes: extract DataStoreListItem
Fabian Grünbichler [Thu, 5 Nov 2020 11:12:22 +0000 (12:12 +0100)]
types: extract DataStoreListItem

for reuse in remote scan API call

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoconfig: make notify a property string
Dietmar Maurer [Thu, 5 Nov 2020 10:32:59 +0000 (11:32 +0100)]
config: make notify a property string

For example "gc=never,verify=always,sync=error".

3 years agotools/daemon: fix reload with open connections
Dominik Csapak [Wed, 4 Nov 2020 12:09:38 +0000 (13:09 +0100)]
tools/daemon: fix reload with open connections

instead of await'ing the result of 'create_service' directly,
poll it together with the shutdown_future

if we reached that, fork_restart the new daemon, and await
the open future from 'create_service'

this way the old process still handles open connections until they finish,
while we already start a new process that handles new incoming connections

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agopxar: more concise EOF handling
Wolfgang Bumiller [Thu, 5 Nov 2020 09:32:48 +0000 (10:32 +0100)]
pxar: more concise EOF handling

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agopxar/create: handle ErrorKind::Interrupted for file reads
Dominik Csapak [Thu, 5 Nov 2020 08:29:06 +0000 (09:29 +0100)]
pxar/create: handle ErrorKind::Interrupted for file reads

they are not an error and we should retry the read

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agopxar/create: fix endless loop for shrinking files
Dominik Csapak [Thu, 5 Nov 2020 08:17:43 +0000 (09:17 +0100)]
pxar/create: fix endless loop for shrinking files

when a file shrunk during backup, we endlessly looped, reading/copying 0 bytes
we already have code that handles shrunk files, but we forgot to
break from the read loop

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agobump version to 0.9.6-1 v0.9.6
Thomas Lamprecht [Wed, 4 Nov 2020 18:13:04 +0000 (19:13 +0100)]
bump version to 0.9.6-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: sync jobs: add tooltip for remove vanished
Thomas Lamprecht [Wed, 4 Nov 2020 18:07:07 +0000 (19:07 +0100)]
ui: sync jobs: add tooltip for remove vanished

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: sync jobs: reorder fields
Thomas Lamprecht [Wed, 4 Nov 2020 18:05:46 +0000 (19:05 +0100)]
ui: sync jobs: reorder fields

group local ones togeteher on the left side, and source + schedule
on the right side.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: sync jobs: fix originalValue of owner and improve label
Thomas Lamprecht [Wed, 4 Nov 2020 18:04:42 +0000 (19:04 +0100)]
ui: sync jobs: fix originalValue of owner and improve label

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: sync jobs: only set default schedule when creating new jobs
Thomas Lamprecht [Wed, 4 Nov 2020 18:04:06 +0000 (19:04 +0100)]
ui: sync jobs: only set default schedule when creating new jobs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: add shell panel under administration
Dominik Csapak [Wed, 4 Nov 2020 14:35:08 +0000 (15:35 +0100)]
ui: add shell panel under administration

some users prefer an inline console
we still have the pop-out console in 'Administration'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoproxy: also rotate auth.log file
Thomas Lamprecht [Wed, 4 Nov 2020 16:15:28 +0000 (17:15 +0100)]
proxy: also rotate auth.log file

no need for triggering re-open here, we always re-open that file.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoproxy: logrotate: do not serialize sending async log-reopen commands
Thomas Lamprecht [Wed, 4 Nov 2020 15:45:12 +0000 (16:45 +0100)]
proxy: logrotate: do not serialize sending async log-reopen commands

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi: factor out auth logger and use for all API authentication failures
Thomas Lamprecht [Wed, 4 Nov 2020 15:12:13 +0000 (16:12 +0100)]
api: factor out auth logger and use for all API authentication failures

we have information here not available in the access log, especially
if the /api2/extjs formatter is used, which encapsulates errors in a
200 response.

So keep the auth log for now, but extend it use from create ticket
calls to all authentication failures for API calls, this ensures one
can also fail2ban tokens.

Do that logging in a central place, which makes it simple but means
that we do not have the user ID information available to include in
the log.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoworker task: fix passing upid to send command
Thomas Lamprecht [Wed, 4 Nov 2020 15:44:07 +0000 (16:44 +0100)]
worker task: fix passing upid to send command

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agolog rotate: only add .zst to new file after second rotation
Thomas Lamprecht [Wed, 4 Nov 2020 16:15:11 +0000 (17:15 +0100)]
log rotate: only add .zst to new file after second rotation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: fix task description for log rotate
Thomas Lamprecht [Wed, 4 Nov 2020 13:20:44 +0000 (14:20 +0100)]
ui: fix task description for log rotate

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoproxy: use new datastore notify settings
Dietmar Maurer [Wed, 4 Nov 2020 10:27:57 +0000 (11:27 +0100)]
proxy: use new datastore notify settings

3 years agoconfig: allow to configure who receives job notify emails
Dietmar Maurer [Wed, 4 Nov 2020 09:42:22 +0000 (10:42 +0100)]
config: allow to configure who receives job notify emails

3 years agoui: SyncJobEdit: fix sending 'delete' values on SyncJob creation
Dominik Csapak [Wed, 4 Nov 2020 10:34:14 +0000 (11:34 +0100)]
ui: SyncJobEdit: fix sending 'delete' values on SyncJob creation

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agosync: improve log format
Dietmar Maurer [Wed, 4 Nov 2020 08:10:56 +0000 (09:10 +0100)]
sync: improve log format

3 years agoproxy: log if there are too many open connections
Dietmar Maurer [Wed, 4 Nov 2020 07:49:35 +0000 (08:49 +0100)]
proxy: log if there are too many open connections

3 years agofix bug #2870: use updated tickets
Dietmar Maurer [Wed, 4 Nov 2020 07:20:36 +0000 (08:20 +0100)]
fix bug #2870: use updated tickets

3 years agoui: set default deduplication factor to 1.0
Dietmar Maurer [Wed, 4 Nov 2020 06:12:55 +0000 (07:12 +0100)]
ui: set default deduplication factor to 1.0

3 years agoproxy: use env PROXMOX_DEBUG to enable/disable debug output
Dietmar Maurer [Wed, 4 Nov 2020 05:52:10 +0000 (06:52 +0100)]
proxy: use env PROXMOX_DEBUG to enable/disable debug output

We only print early connection errors when this env var is set.

3 years agocleanup: use Arc to count open connections
Dietmar Maurer [Wed, 4 Nov 2020 05:35:44 +0000 (06:35 +0100)]
cleanup: use Arc to count open connections

3 years agofix #3106: correctly queue incoming connections
Dietmar Maurer [Tue, 3 Nov 2020 12:14:10 +0000 (13:14 +0100)]
fix #3106: correctly queue incoming connections

3 years agobump version to 0.9.5-1 v0.9.5
Thomas Lamprecht [Tue, 3 Nov 2020 16:41:26 +0000 (17:41 +0100)]
bump version to 0.9.5-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoreport: add more commands/files to check
Thomas Lamprecht [Tue, 3 Nov 2020 16:29:17 +0000 (17:29 +0100)]
report: add more commands/files to check

add all of our configuration files in /etc/proxmox-backup/ further,
call some ZFS tool to get that status.

Also, use the subscription command form manager, as we often require
more info than the status. Also, adapt formatting a bit.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoreport: avoid lazy_static for command/files/.. definitions
Thomas Lamprecht [Tue, 3 Nov 2020 16:27:12 +0000 (17:27 +0100)]
report: avoid lazy_static for command/files/.. definitions

those are not in a hot code path, and it is not really much work to
build them on the go..

It may not matther much, but it is unnecessary. Rust will probably
inline most of it anyway..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agomanager: report: call method directly, avoid HTTPS request
Thomas Lamprecht [Tue, 3 Nov 2020 16:23:43 +0000 (17:23 +0100)]
manager: report: call method directly, avoid HTTPS request

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agomanager: add report cli command
Hannes Laimer [Tue, 3 Nov 2020 12:29:08 +0000 (13:29 +0100)]
manager: add report cli command

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
3 years agoreport: add webui button for system report
Hannes Laimer [Tue, 3 Nov 2020 12:29:07 +0000 (13:29 +0100)]
report: add webui button for system report

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
3 years agoreport: add api endpoint and function to generate report
Hannes Laimer [Tue, 3 Nov 2020 12:29:06 +0000 (13:29 +0100)]
report: add api endpoint and function to generate report

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
3 years agoui: task filter: add button icons
Thomas Lamprecht [Tue, 3 Nov 2020 13:49:04 +0000 (14:49 +0100)]
ui: task filter: add button icons

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: task filter: reorder to avoid wasting vertical space
Thomas Lamprecht [Tue, 3 Nov 2020 13:47:59 +0000 (14:47 +0100)]
ui: task filter: reorder to avoid wasting vertical space

Includes some eslint fixes and label changes as well, was to much
work to split that out in its own commit.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: add panel/Tasks and use it for the node tasks
Dominik Csapak [Fri, 30 Oct 2020 14:02:15 +0000 (15:02 +0100)]
ui: add panel/Tasks and use it for the node tasks

this is a panel that is heavily inspired from widget-toolkits
node/Tasks panel, but is adapted to use the extended api calls of
pbs (e.g. since/until filter)

has 'filter' panel (like pmgs log tracker gui), but it is collapsible

if we extend the api calls of the other projects, we can merge this
again into the widget-toolkit one and use that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/node/tasks: add optional until filter
Dominik Csapak [Fri, 30 Oct 2020 14:02:14 +0000 (15:02 +0100)]
api2/node/tasks: add optional until filter

so that users select specific time ranges with 'since' and 'until'
(e.g. a single day)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/status: remove list_task api call
Dominik Csapak [Fri, 30 Oct 2020 14:02:13 +0000 (15:02 +0100)]
api2/status: remove list_task api call

we do not need it anymore, we can do everything with nodes/NODE/tasks
instead

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/node/tasks: add optional since/typefilter/statusfilter
Dominik Csapak [Fri, 30 Oct 2020 14:02:12 +0000 (15:02 +0100)]
api2/node/tasks: add optional since/typefilter/statusfilter

and change all users of the /status/tasks api call to this

with this change we can now delete the /status/tasks api call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/node/tasks: change limit behaviour when it is 0
Dominik Csapak [Fri, 30 Oct 2020 14:02:11 +0000 (15:02 +0100)]
api2/node/tasks: change limit behaviour when it is 0

instead of returning 0 elements (which does not really make sense anyway),
change it so that there is no limit anymore (besides usize::MAX)

this is technically a breaking change for the api, but i guess
no one is using limit=0 for anything sensible anyway

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoserver/worker_task: add tasktype to return the api type of a taskstate
Dominik Csapak [Fri, 30 Oct 2020 14:02:10 +0000 (15:02 +0100)]
server/worker_task: add tasktype to return the api type of a taskstate

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agocleanup: use const_regex, use BACKUP_ID_REGEX for api too
Dietmar Maurer [Tue, 3 Nov 2020 05:36:50 +0000 (06:36 +0100)]
cleanup: use const_regex, use BACKUP_ID_REGEX for api too

3 years agofix #3039: use the same ID regex for info and api
Dominik Csapak [Mon, 2 Nov 2020 12:08:04 +0000 (13:08 +0100)]
fix #3039: use the same ID regex for info and api

in the api we use PROXMOX_SAFE_ID_REGEX for backup ids, but here
(where we use it to list them) we use a local regex

since the first is a superset of the one used here, simply extend
the local one

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agodocs: extend managing remotes
Fabian Grünbichler [Mon, 2 Nov 2020 10:48:11 +0000 (11:48 +0100)]
docs: extend managing remotes

with information about required privileges and limitations

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agosync: add access check tests
Fabian Grünbichler [Mon, 2 Nov 2020 10:48:10 +0000 (11:48 +0100)]
sync: add access check tests

should cover all the current scenarios. remote server-side checks can't
be meaningfully unit-tested, but they are simple enough so should
hopefully never break.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agouser.cfg/user info: add test constructors
Fabian Grünbichler [Mon, 2 Nov 2020 10:48:09 +0000 (11:48 +0100)]
user.cfg/user info: add test constructors

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoproxy: drop now unused UPID import
Thomas Lamprecht [Mon, 2 Nov 2020 19:56:30 +0000 (20:56 +0100)]
proxy: drop now unused UPID import

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoproxmox-backup-proxy: use only jobstate for garbage_collection schedule
Dominik Csapak [Mon, 2 Nov 2020 11:34:39 +0000 (12:34 +0100)]
proxmox-backup-proxy: use only jobstate for garbage_collection schedule

in case the garbage_collection errors out, we never set the in-memory
state, so if it failed, the last 'good' starttime was considered
for the schedule

this could lead to the job running every minute instead of the
correct schedule

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoapi2/admin/datastore: start the garbage_collection task with our helper
Dominik Csapak [Mon, 2 Nov 2020 11:34:38 +0000 (12:34 +0100)]
api2/admin/datastore: start the garbage_collection task with our helper

instead of manually, this has the advantage that we now set
the jobstate correctly and can return with an error if it is
currently running (instead of failing in the task)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoserver/gc_job: add 'to_stdout'
Dominik Csapak [Mon, 2 Nov 2020 11:34:37 +0000 (12:34 +0100)]
server/gc_job: add 'to_stdout'

we will use this for the manual api call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agobackup/{dynamic, fixed}_index: improve error message for small index files
Dominik Csapak [Mon, 2 Nov 2020 11:34:36 +0000 (12:34 +0100)]
backup/{dynamic, fixed}_index: improve error message for small index files

index files that were smaller than their respective header size,
would fail with

"failed to fill whole buffer"

instead now check explicitely for the size and fail with
"index too small (size)"

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agogc: mark_used_chunks: reduce implementation noise
Thomas Lamprecht [Mon, 2 Nov 2020 19:50:24 +0000 (20:50 +0100)]
gc: mark_used_chunks: reduce implementation noise

try do reduce some unecessary lines, make match arms more precise so
one can faster see what's actually happening.

Also, avoid
> return Err(format_err!(...))
stuff, just use bail!()

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agogarbage collect: improve index error messages
Dominik Csapak [Mon, 2 Nov 2020 11:34:35 +0000 (12:34 +0100)]
garbage collect: improve index error messages

so that in case of a broken index file, the user knows which it is

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agolog rotate task: make task archive limits be binary based
Thomas Lamprecht [Mon, 2 Nov 2020 18:31:56 +0000 (19:31 +0100)]
log rotate task: make task archive limits be binary based

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agolog rotate task: adapt internal jobstate ID, set worker one to None for now
Thomas Lamprecht [Mon, 2 Nov 2020 18:30:49 +0000 (19:30 +0100)]
log rotate task: adapt internal jobstate ID, set worker one to None for now

as we have only one logrotate task currently..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoserver: implement access log rotation with re-open via command socket
Thomas Lamprecht [Mon, 2 Nov 2020 18:21:58 +0000 (19:21 +0100)]
server: implement access log rotation with re-open via command socket

re-use the future we already have for task log rotation to trigger
it.

Move the FileLogger in ApiConfig into an Arc, so that we can actually
update it and REST using the new one.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoserver: write main daemon PID to run directory
Thomas Lamprecht [Mon, 2 Nov 2020 18:18:36 +0000 (19:18 +0100)]
server: write main daemon PID to run directory

so that we can easily get the main PID of the last recently launched
daemon. Will be used to get the control socket of that one for access
lgo rotate in a future patch

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agocommand socket: make create_control_socket private
Thomas Lamprecht [Mon, 2 Nov 2020 18:23:18 +0000 (19:23 +0100)]
command socket: make create_control_socket private

this is internal for now, use the comanndo socket struct
implementation, and ideally not a new one but the existing ones
created in the proxy and api daemons.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoserver: use generalized commando socket for worker tasks commands
Thomas Lamprecht [Mon, 2 Nov 2020 18:13:36 +0000 (19:13 +0100)]
server: use generalized commando socket for worker tasks commands

Allows to extend the use of that socket in the future, e.g., for log
rotate re-open signaling.

To reflect this we use a more general name, and change the commandos
to a more clear namespace.

Both are actually somewhat a breaking change, but the single real
world issue it should be able to cause is, that one won't be able to
stop task from older daemons, which still use the older abstract
socket name format.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>