]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
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>
3 years agoserver: add CommandoSocket where multiple users can register commands
Thomas Lamprecht [Mon, 2 Nov 2020 09:12:56 +0000 (10:12 +0100)]
server: add CommandoSocket where multiple users can register commands

This is a preparatory step to replace the task control socket with it
and provide a "reopen log file" command for the rest server.

Kept it simple by disallowing to register new commands after the
socket gets spawned, this avoids the need for locking.

If we really need that we can always wrap it in a Arc<RWLock<..>> or
something like that, or even nicer, register at compile time.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoconfig: network: use error message when parsing netmask failed
Thomas Lamprecht [Mon, 2 Nov 2020 17:52:47 +0000 (18:52 +0100)]
config: network: use error message when parsing netmask failed

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotools: file logger: avoid some possible unwraps in log method
Thomas Lamprecht [Mon, 2 Nov 2020 18:26:59 +0000 (19:26 +0100)]
tools: file logger: avoid some possible unwraps in log method

writing to a file can explode quite easily.
time formatting to rfc3339 should be more robust, but it has a few
conditions where it could fail, so catch that too (and only really
do it if required).

The writes to stdout are left as is, it normally is redirected to
journal which is in memory, and thus breaks later than most stuff,
and at that point we probably do not care anymore anyway.

It could make sense to actually return a result here..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotools: log rotate: compressing rotated files
Thomas Lamprecht [Mon, 2 Nov 2020 17:31:31 +0000 (18:31 +0100)]
tools: log rotate: compressing rotated files

We renamed the last one always to a file without compression
extension, even if it was .zst previously. So always add the correct
ending to the new last one, if compress was true.

Further, we cannot detect if there'd be a compression required if we
rotated (renamed) it already to the file with .zst included.

So check on rotation itself if it would be a "no .zst" -> ",zst"
transition, and call compress there.

it really should be OK now *knocking wood*

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotools: log rotate: fix file ending for compressed files
Thomas Lamprecht [Mon, 2 Nov 2020 16:45:02 +0000 (17:45 +0100)]
tools: log rotate: fix file ending for compressed files

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoconfig: support netmask when parsing interfaces file
Dietmar Maurer [Mon, 2 Nov 2020 13:32:35 +0000 (14:32 +0100)]
config: support netmask when parsing interfaces file

3 years agoui: fix verificationjob task description
Dietmar Maurer [Mon, 2 Nov 2020 09:03:36 +0000 (10:03 +0100)]
ui: fix verificationjob task description

3 years agofile logger: allow reopening file
Thomas Lamprecht [Mon, 2 Nov 2020 07:51:24 +0000 (08:51 +0100)]
file logger: allow reopening file

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agopull out /run and /var/log directory constants to buildcfg
Thomas Lamprecht [Mon, 2 Nov 2020 07:50:56 +0000 (08:50 +0100)]
pull out /run and /var/log directory constants to buildcfg

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agonotify: add link to server GUI
Dietmar Maurer [Mon, 2 Nov 2020 08:11:08 +0000 (09:11 +0100)]
notify: add link to server GUI

3 years agogc: remove extra empty lines in email notification template
Dietmar Maurer [Mon, 2 Nov 2020 07:02:51 +0000 (08:02 +0100)]
gc: remove extra empty lines in email notification template

3 years agoui: fix dashboard subscription
Thomas Lamprecht [Mon, 2 Nov 2020 07:08:25 +0000 (08:08 +0100)]
ui: fix dashboard subscription

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosync: allow sync for non-superusers
Fabian Grünbichler [Fri, 30 Oct 2020 11:36:42 +0000 (12:36 +0100)]
sync: allow sync for non-superusers

by requiring
- Datastore.Backup permission for target datastore
- Remote.Read permission for source remote/datastore
- Datastore.Prune if vanished snapshots should be removed
- Datastore.Modify if another user should own the freshly synced
snapshots

reading a sync job entry only requires knowing about both the source
remote and the target datastore.

note that this does not affect the Authid used to authenticate with the
remote, which of course also needs permissions to access the source
datastore.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agofix #2864: add owner option to sync
Fabian Grünbichler [Fri, 30 Oct 2020 11:36:41 +0000 (12:36 +0100)]
fix #2864: add owner option to sync

instead of hard-coding 'backup@pam'. this allows a bit more flexibility
(e.g., syncing to a datastore that can directly be used as restore
source) without overly complicating things.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agomanager: subscription commands s/delete/remove/
Thomas Lamprecht [Sun, 1 Nov 2020 12:19:29 +0000 (13:19 +0100)]
manager: subscription commands s/delete/remove/

no idea why I added it as "delete", for all other such operations we
use the "remove" sub-command...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapt: sort packages for update notifcation mail
Thomas Lamprecht [Sat, 31 Oct 2020 21:55:54 +0000 (22:55 +0100)]
apt: sort packages for update notifcation mail

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoadd daily update and maintenance task
Thomas Lamprecht [Sat, 31 Oct 2020 20:27:06 +0000 (21:27 +0100)]
add daily update and maintenance task

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi: apt: implement support to send notification email on new updates
Thomas Lamprecht [Sat, 31 Oct 2020 20:09:21 +0000 (21:09 +0100)]
api: apt: implement support to send notification email on new updates

again, base idea copied off PVE, but, we safe the information about
which pending version we send a mail out already in a separate
object, to keep the api return type APTUpdateInfo clean.

This also makes a few things a bit easier, as we can update the
package status without saving/restoring the notify information.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi: implement apt pkg cache
Thomas Lamprecht [Sat, 31 Oct 2020 20:02:25 +0000 (21:02 +0100)]
api: implement apt pkg cache

based on the idea of PVE

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi: apt: factor out and improve calling apt update
Thomas Lamprecht [Sat, 31 Oct 2020 19:54:53 +0000 (20:54 +0100)]
api: apt: factor out and improve calling apt update

apt changes some of its state/cache also if it errors out, most of
the time, so we actually want to print both, stderr and stdout.

Further, only warn if its exit code is non-zero, for the same
rationale, it may bring updates available even if it errors (e.g.,
because a future pbs-enterprise repo is additionally configured but
not accessible).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi/tools: split out apt helpers from api to own module
Thomas Lamprecht [Sat, 31 Oct 2020 19:40:05 +0000 (20:40 +0100)]
api/tools: split out apt helpers from api to own module

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi types: derive Debug for APTUpdateInfo
Thomas Lamprecht [Sat, 31 Oct 2020 20:28:57 +0000 (21:28 +0100)]
api types: derive Debug for APTUpdateInfo

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoworker task: drop debug prints
Thomas Lamprecht [Sat, 31 Oct 2020 18:46:54 +0000 (19:46 +0100)]
worker task: drop debug prints

they are not useful anymore, rather noisy

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotools: do not unnecessarily prefix module path
Thomas Lamprecht [Sat, 31 Oct 2020 20:30:29 +0000 (21:30 +0100)]
tools: do not unnecessarily prefix module path

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotrivial: fix typo in comment
Thomas Lamprecht [Sat, 31 Oct 2020 20:29:34 +0000 (21:29 +0100)]
trivial: fix typo in comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: ACL view: do not save grid state
Thomas Lamprecht [Sat, 31 Oct 2020 10:36:48 +0000 (11:36 +0100)]
ui: ACL view: do not save grid state

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: improve ACL view layout
Thomas Lamprecht [Sat, 31 Oct 2020 10:33:31 +0000 (11:33 +0100)]
ui: improve ACL view layout

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: bump sync/verify grid stateid
Thomas Lamprecht [Sat, 31 Oct 2020 09:58:42 +0000 (10:58 +0100)]
ui: bump sync/verify grid stateid

so that people get the improved view by default

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: improve sync job view layout
Thomas Lamprecht [Sat, 31 Oct 2020 09:54:14 +0000 (10:54 +0100)]
ui: improve sync job view layout

Avoid overuse of flex, that is as bad as having all to fixed widths.

In spirit similar to the previous commit for the verify panel, see
that for some rationale.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: improve verify job view layout, show job-id
Thomas Lamprecht [Sat, 31 Oct 2020 09:30:23 +0000 (10:30 +0100)]
ui: improve verify job view layout, show job-id

Avoid overuse of flex, that is as bad as having all to fixed widths.

* Set date-time fields to 150 px as they are fixed width text.
* Duration is maximal 3 units, so it can be made fixed too.
* Schedule is flex with lower and upper limits, this is useful as
  it's a field which can be both, quite short (daily) or long
  (mon..fri *-10..12-1..7 02:00/30:30)
* Status and comment is flex, this way we always get a filled grid

Move status after last verify date and duration field, increases
information density at the left of the grid - reducing need for eye
movement, also, it groups together the "information about last job"
nicer.

Show job-id by default even if they are auto generated when adding
over the gui, as it can help finding the respective job faster when
getting a mail with an error.

Reported-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: administration: set icons for tabs
Thomas Lamprecht [Sat, 31 Oct 2020 08:11:10 +0000 (09:11 +0100)]
ui: administration: set icons for tabs

orient on PVE, the ones for Updates, ServerStatus, should by
self-explanatory.

Services is in PVE named "System", but reusing that cogs icon makes
similar sense here too, and seems in line with search result of a
"service icons" query.

Syslog is the same as our general log icon, but as we also use this
normally for worker task logs and that is present here too, I
changed the worker task log icon to the alternative list, which
resembles a task view window - so IMO even better than before.

Sync that change also into the always present tasks button at the top
right.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agocleanup: fix wording in GC status emails
Dietmar Maurer [Sat, 31 Oct 2020 06:55:30 +0000 (07:55 +0100)]
cleanup: fix wording in GC status emails

3 years agodocs: client: avoid that repo gets detected as email address
Thomas Lamprecht [Fri, 30 Oct 2020 16:08:08 +0000 (17:08 +0100)]
docs: client: avoid that repo gets detected as email address

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: fixup bad RST table format
Thomas Lamprecht [Fri, 30 Oct 2020 16:05:49 +0000 (17:05 +0100)]
docs: fixup bad RST table format

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: add token example to client, and reformat a bit
Thomas Lamprecht [Fri, 30 Oct 2020 16:01:18 +0000 (17:01 +0100)]
docs: add token example to client, and reformat a bit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodocs: add API tokens to documentation
Fabian Grünbichler [Fri, 30 Oct 2020 14:18:42 +0000 (15:18 +0100)]
docs: add API tokens to documentation

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoapi: replace auth_id with auth-id
Fabian Grünbichler [Fri, 30 Oct 2020 14:18:41 +0000 (15:18 +0100)]
api: replace auth_id with auth-id

in parameters, and fix up the completion for the ACL update parameter.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoprivs: add some more comments explaining privileges
Fabian Grünbichler [Fri, 30 Oct 2020 11:36:44 +0000 (12:36 +0100)]
privs: add some more comments explaining privileges

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoprivs: remove PRIV_REMOVE_PRUNE
Fabian Grünbichler [Fri, 30 Oct 2020 11:36:43 +0000 (12:36 +0100)]
privs: remove PRIV_REMOVE_PRUNE

it's not used anywhere, and not needed either until the day we might
implement push syncs.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoverify jobs: add permissions
Fabian Grünbichler [Fri, 30 Oct 2020 11:36:40 +0000 (12:36 +0100)]
verify jobs: add permissions

equivalent to verifying a whole datastore, except for reading job
(entries), which is accessible to regular Datastore.Audit/Backup users
as well.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>