]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
2 years agomove worker_task.rs into proxmox-rest-server crate
Dietmar Maurer [Thu, 23 Sep 2021 08:09:19 +0000 (10:09 +0200)]
move worker_task.rs into proxmox-rest-server crate

Also moved pbs-datastore/src/task.rs to pbs-tools, which now depends on 'log'.

2 years agouse UPID and systemd helpers from proxmox 0.13.4
Dietmar Maurer [Wed, 22 Sep 2021 10:46:44 +0000 (12:46 +0200)]
use UPID and systemd helpers from proxmox 0.13.4

2 years agoworker task: allow to configure path and owner/group
Dietmar Maurer [Wed, 22 Sep 2021 06:44:48 +0000 (08:44 +0200)]
worker task: allow to configure path and owner/group

And application now needs to call init_worker_tasks() before using
worker tasks.

Notable changes:
- need to call  init_worker_tasks() before using worker tasks.
- create_task_log_dirs() ís called inside init_worker_tasks()
- removed UpidExt trait
- use atomic_open_or_create_file()
- remove pbs_config and pbs_buildcfg dependency

2 years agosrc/server/worker_task.rs: Avoid using pbs-api-type::Authid
Dietmar Maurer [Tue, 21 Sep 2021 10:14:19 +0000 (12:14 +0200)]
src/server/worker_task.rs: Avoid using pbs-api-type::Authid

Because we want to move worker_task.rs into proxmox-rest-server crate.

2 years agobuildsys: better group and sort --bin arguments
Thomas Lamprecht [Wed, 22 Sep 2021 14:27:37 +0000 (16:27 +0200)]
buildsys: better group and sort --bin arguments

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomove dump-catalog-shell-cli doc-helper to proxmox-backup-client crate
Thomas Lamprecht [Wed, 22 Sep 2021 14:25:07 +0000 (16:25 +0200)]
move dump-catalog-shell-cli doc-helper to proxmox-backup-client crate

it's only used for generating the docs for the interactive-shell
parts of the client.

Ideally we'd avoid that whole separate binary in the first place and
let the client dump it, but we'd need to have some more elaborate
"hide this command from the help/usage" mechanisms in the CLI
helper/formatter code to make that play out more nicely.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.0.10-1 v2.0.10
Thomas Lamprecht [Wed, 22 Sep 2021 09:36:42 +0000 (11:36 +0200)]
bump version to 2.0.10-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocargo: switch from proc-macro pin-project to declarative pin-project-lite
Thomas Lamprecht [Wed, 22 Sep 2021 09:15:38 +0000 (11:15 +0200)]
cargo: switch from proc-macro pin-project to declarative pin-project-lite

In our simple use cases they both should generate the same code, see
[0] for notable differences. While we cannot drop proc-macro due to
that switch, all of our dependencies that use pinning already use
pin-project-lite, so this allows us to drop a whole crate in general
while not loosing anything.

[0]: https://github.com/taiki-e/pin-project-lite#pin-project-vs-pin-project-lite

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: troubleshooting: reformat & adapt
Thomas Lamprecht [Wed, 22 Sep 2021 05:41:45 +0000 (07:41 +0200)]
docs: troubleshooting: reformat & adapt

Text-width should be 80 cc in the docs.

Avoid using relative paths in examples, they only confuse users as
one has less of a specific idea what the example may do. Rather use a
"descriptive" example path.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs/technical-overview: add troubleshooting section
Hannes Laimer [Mon, 20 Sep 2021 09:18:39 +0000 (11:18 +0200)]
docs/technical-overview: add troubleshooting section

2 years agodebug: api ls: make path optional and default to "/"
Thomas Lamprecht [Tue, 21 Sep 2021 13:11:36 +0000 (15:11 +0200)]
debug: api ls: make path optional and default to "/"

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: proxmox-backup-debug: add info about the 'api' subcommand
Dominik Csapak [Tue, 21 Sep 2021 10:11:18 +0000 (12:11 +0200)]
docs: proxmox-backup-debug: add info about the 'api' subcommand

and mention PROXMOX_DEBUG_API_CODE and that its dangerous.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: add proxmox-backup-debug to the list of command line tools
Dominik Csapak [Tue, 21 Sep 2021 10:11:17 +0000 (12:11 +0200)]
docs: add proxmox-backup-debug to the list of command line tools

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: make some workers log on CLI
Dominik Csapak [Tue, 21 Sep 2021 10:11:16 +0000 (12:11 +0200)]
api: make some workers log on CLI

some workers did not log when called via cli

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: add missing token list match_all property
Dominik Csapak [Tue, 21 Sep 2021 10:11:15 +0000 (12:11 +0200)]
api: add missing token list match_all property

to have the proper link between the token list and the sub routes
in the api, include the 'tokenname' property in the token listing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoproxmox-backup-debug: add 'api' subcommands
Dominik Csapak [Tue, 21 Sep 2021 10:11:14 +0000 (12:11 +0200)]
proxmox-backup-debug: add 'api' subcommands

this provides some generic api call mechanisms like pvesh/pmgsh.
by default it uses the https api on localhost (creating a token
if called as root, else requesting the root@pam password interactively)

this is mainly intended for debugging, but it is also useful for
situations where some api calls do not have an equivalent in a binary
and a user does not want to go through the api

not implemented are the http2 api calls (since it is a separate api an
it wouldn't be that easy to do)

there are a few quirks though, related to the 'ls' command:
i extract the 'child-link' from the property name of the
'match_all' statement of the router, but this does not
always match with the property from the relevant 'get' api call
so it fails there (e.g. /tape/drive )

this can be fixed in the respective api calls (e.g. by renaming
the parameter that comes from the path)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomove proxmox-backup-debug back to main crate
Dominik Csapak [Tue, 21 Sep 2021 10:11:13 +0000 (12:11 +0200)]
move proxmox-backup-debug back to main crate

we want to add something to it that needs access to the
proxmox_backup::api2 stuff, so it cannot live in a sub crate

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoserver: refactor abort_local_worker
Dominik Csapak [Tue, 21 Sep 2021 10:11:12 +0000 (12:11 +0200)]
server: refactor abort_local_worker

we'll need this outside the module

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorename pbs-systemd to proxmox-systemd
Dietmar Maurer [Tue, 21 Sep 2021 07:33:51 +0000 (09:33 +0200)]
rename pbs-systemd to proxmox-systemd

2 years agopbs-systemd: do not depend on pbs-tools
Dietmar Maurer [Tue, 21 Sep 2021 07:33:50 +0000 (09:33 +0200)]
pbs-systemd: do not depend on pbs-tools

Instead, copy a few line of nom helper code, and implement
a simple run_command helper.

2 years agoworker_state: move tasktype() code to src/api2/node/tasks.rs
Dietmar Maurer [Tue, 21 Sep 2021 05:58:54 +0000 (07:58 +0200)]
worker_state: move tasktype() code to src/api2/node/tasks.rs

Because this is API related code, and only used there.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuildsys: drop double-build hack to avoid linkage issues
Dietmar Maurer [Tue, 21 Sep 2021 05:58:53 +0000 (07:58 +0200)]
buildsys: drop double-build hack to avoid linkage issues

basically a (semantic) revert of commit
991be99c37c6f55f43a3d9a2c54edb2a8dc6d4f2 "buildsys: workaround
linkage issues from openid/curl build server stuff separate"

This is no longer required because we moved proxmox_restore_daemon
code into extra crate (previous commit)

Originally-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomove proxmox_restore_daemon code into extra crate
Dietmar Maurer [Tue, 21 Sep 2021 05:58:52 +0000 (07:58 +0200)]
move proxmox_restore_daemon code into extra crate

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomove src/server/rest.rs to proxmox-rest-server crate
Dietmar Maurer [Tue, 21 Sep 2021 05:58:51 +0000 (07:58 +0200)]
move src/server/rest.rs to proxmox-rest-server crate

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest server: cleanup auth-log handling
Dietmar Maurer [Tue, 21 Sep 2021 05:58:50 +0000 (07:58 +0200)]
rest server: cleanup auth-log handling

Handle auth logs the same way as access log.
- Configure with ApiConfig
- CommandoSocket command to reload auth-logs "api-auth-log-reopen"

Inside API calls, we now access the ApiConfig using the RestEnvironment.

The openid_login api now also logs failed logins and return http_err!(UNAUTHORIZED, ..)
on failed logins.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest server: do not use pbs_api_types::Authid
Dietmar Maurer [Tue, 21 Sep 2021 05:58:49 +0000 (07:58 +0200)]
rest server: do not use pbs_api_types::Authid

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest server: return UserInformation from ApiAuth::check_auth
Dietmar Maurer [Tue, 21 Sep 2021 05:58:48 +0000 (07:58 +0200)]
rest server: return UserInformation from ApiAuth::check_auth

This need impl UserInformation for Arc<CachedUserInfo> which is implemented
with proxmox 0.13.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomake get_index and ApiConfig property (callback)
Dietmar Maurer [Tue, 21 Sep 2021 05:58:47 +0000 (07:58 +0200)]
make get_index and ApiConfig property (callback)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorest server: simplify get_index() method signature
Dietmar Maurer [Tue, 21 Sep 2021 05:58:46 +0000 (07:58 +0200)]
rest server: simplify get_index() method signature

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomove normalize_uri_path and extract_cookie to proxmox-rest-server crate
Dietmar Maurer [Tue, 21 Sep 2021 05:58:45 +0000 (07:58 +0200)]
move normalize_uri_path and extract_cookie to proxmox-rest-server crate

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomove src/tools/compression.rs to proxmox-rest-server crate
Dietmar Maurer [Tue, 21 Sep 2021 05:58:44 +0000 (07:58 +0200)]
move src/tools/compression.rs to proxmox-rest-server crate

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomove src/server/formatter.rs to proxmox-rest-server crate
Dietmar Maurer [Tue, 21 Sep 2021 05:58:43 +0000 (07:58 +0200)]
move src/server/formatter.rs to proxmox-rest-server crate

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomove src/server/environment.rs to proxmox-rest-server crate
Dietmar Maurer [Tue, 21 Sep 2021 05:58:42 +0000 (07:58 +0200)]
move src/server/environment.rs to proxmox-rest-server crate

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomove src/tools/daemon.rs to proxmox-rest-server workspace
Dietmar Maurer [Tue, 21 Sep 2021 05:58:41 +0000 (07:58 +0200)]
move src/tools/daemon.rs to proxmox-rest-server workspace

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomove ApiConfig, FileLogger and CommandoSocket to proxmox-rest-server workspace
Dietmar Maurer [Tue, 21 Sep 2021 05:58:40 +0000 (07:58 +0200)]
move ApiConfig, FileLogger and CommandoSocket to proxmox-rest-server workspace

ApiConfig: avoid using  pbs_config::backup_user()
CommandoSocket: avoid using  pbs_config::backup_user()
FileLogger: avoid using  pbs_config::backup_user()
- use atomic_open_or_create_file()

Auth Trait: moved definitions to proxmox-rest-server/src/lib.rs
- removed CachedUserInfo patrameter
- return user as String (not Authid)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agostart new proxmox-rest-server workspace
Dietmar Maurer [Tue, 21 Sep 2021 05:58:39 +0000 (07:58 +0200)]
start new proxmox-rest-server workspace

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: disks/directory: add 'name' property to list of mounts
Dominik Csapak [Mon, 13 Sep 2021 14:18:27 +0000 (16:18 +0200)]
api: disks/directory: add 'name' property to list of mounts

so that we actually have the property that 'match_all' refers to for
the templated API path.

This is mostly for improving usage of the WIP pbs-shell, i.e., its
`ls` command, it has no other functional/semantic impact.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: disks/directory: factor out BASE_MOUNT_DIR path
Dominik Csapak [Mon, 13 Sep 2021 14:18:26 +0000 (16:18 +0200)]
api: disks/directory: factor out BASE_MOUNT_DIR path

will be reused in the next commit

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: nodes: rustfmt
Thomas Lamprecht [Wed, 15 Sep 2021 09:42:28 +0000 (11:42 +0200)]
api: nodes: rustfmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi2: nodes: add missing node list api call
Dominik Csapak [Thu, 9 Sep 2021 13:48:19 +0000 (15:48 +0200)]
api2: nodes: add missing node list api call

to have an api call for api path traversal

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agofix tests/worker-task-abort.rs - correctly spawn command socket
Dietmar Maurer [Tue, 14 Sep 2021 08:42:44 +0000 (10:42 +0200)]
fix tests/worker-task-abort.rs - correctly spawn command socket

And wait for the task.

Note: The test is still ignored (but works now when run a root)

2 years agoavoid type re-exports
Dietmar Maurer [Tue, 14 Sep 2021 06:35:43 +0000 (08:35 +0200)]
avoid type re-exports

2 years agomove src/tape/helpers/snapshot_reader.rs to src/backup/snapshot_reader.rs
Dietmar Maurer [Tue, 14 Sep 2021 05:42:06 +0000 (07:42 +0200)]
move src/tape/helpers/snapshot_reader.rs to src/backup/snapshot_reader.rs

2 years agofix refs in generated docs
Dietmar Maurer [Mon, 13 Sep 2021 11:40:20 +0000 (13:40 +0200)]
fix refs in generated docs

2 years agosplit tape code into new pbs_tape workspace
Dietmar Maurer [Mon, 13 Sep 2021 09:54:24 +0000 (11:54 +0200)]
split tape code into new pbs_tape workspace

2 years agobuildsys: cargo build: avoid redundant "--bin pxar" argument
Thomas Lamprecht [Mon, 13 Sep 2021 10:11:24 +0000 (12:11 +0200)]
buildsys: cargo build: avoid redundant "--bin pxar" argument

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix regression tests
Dietmar Maurer [Fri, 10 Sep 2021 10:45:06 +0000 (12:45 +0200)]
fix regression tests

2 years agomore api type cleanups: avoid re-exports
Dietmar Maurer [Fri, 10 Sep 2021 10:25:32 +0000 (12:25 +0200)]
more api type cleanups: avoid re-exports

2 years agoproxmox-tape: add 'force-media-set' also to cli
Dominik Csapak [Fri, 10 Sep 2021 07:41:57 +0000 (09:41 +0200)]
proxmox-tape: add 'force-media-set' also to cli

we have it in the api and gui, but the cli was missing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agomove PruneOptions to pbs_api_types workspace
Dietmar Maurer [Fri, 10 Sep 2021 07:21:27 +0000 (09:21 +0200)]
move PruneOptions to pbs_api_types workspace

2 years agomove datastore config to pbs_config workspace
Dietmar Maurer [Fri, 10 Sep 2021 06:40:58 +0000 (08:40 +0200)]
move datastore config to pbs_config workspace

2 years agomove user configuration to pbs_config workspace
Dietmar Maurer [Fri, 10 Sep 2021 04:53:53 +0000 (06:53 +0200)]
move user configuration to pbs_config workspace

Also moved memcom.rs and cached_user_info.rs

2 years agocleanup User configuration: use Updater
Dietmar Maurer [Thu, 9 Sep 2021 11:14:28 +0000 (13:14 +0200)]
cleanup User configuration: use Updater

2 years agomove acl to pbs_config workspaces, pbs_api_types cleanups
Dietmar Maurer [Thu, 9 Sep 2021 08:32:44 +0000 (10:32 +0200)]
move acl to pbs_config workspaces, pbs_api_types cleanups

2 years agomove token_shadow to pbs_config workspace
Dietmar Maurer [Wed, 8 Sep 2021 12:00:14 +0000 (14:00 +0200)]
move token_shadow to pbs_config workspace

Also moved out crypt.rs (libcrypt bindings) to pbs_tools workspace.

2 years agomove network config to pbs_config workspace
Dietmar Maurer [Wed, 8 Sep 2021 10:22:48 +0000 (12:22 +0200)]
move network config to pbs_config workspace

2 years agochanger config cleanup: use Updater
Dietmar Maurer [Wed, 8 Sep 2021 07:19:35 +0000 (09:19 +0200)]
changer config cleanup: use Updater

2 years agodrop proxmox-backup-debug package, use server package instead
Thomas Lamprecht [Wed, 8 Sep 2021 06:59:51 +0000 (08:59 +0200)]
drop proxmox-backup-debug package, use server package instead

The datastore/backup debug helpers should always be available, they
can help a lot in dire times, so making them available directly via
the server package (alongside the manager CLI tool) is nicer for the
user.

Additionally, building a package can be quite time consuming in this
repo, as some tools like dwarves and other debug symbol stuff has to
scan the quite big rust binaries. So dropping a binary package shaves
of a noticeable bit of build time too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agotape job cleanup: user Updater
Dietmar Maurer [Wed, 8 Sep 2021 06:55:25 +0000 (08:55 +0200)]
tape job cleanup: user Updater

2 years agoverify job cleanup: use Updater/flatten
Dietmar Maurer [Wed, 8 Sep 2021 06:40:32 +0000 (08:40 +0200)]
verify job cleanup: use Updater/flatten

2 years agosync job cleanup: use Updater/flatten
Dietmar Maurer [Wed, 8 Sep 2021 06:28:09 +0000 (08:28 +0200)]
sync job cleanup: use Updater/flatten

2 years agomove verify.rs to pbs_config workspace
Dietmar Maurer [Wed, 8 Sep 2021 06:01:07 +0000 (08:01 +0200)]
move verify.rs to pbs_config workspace

2 years agomove sync.rs to pbs_config workspace
Dietmar Maurer [Wed, 8 Sep 2021 04:57:23 +0000 (06:57 +0200)]
move sync.rs to pbs_config workspace

2 years agoremove dead code
Dietmar Maurer [Wed, 8 Sep 2021 04:34:44 +0000 (06:34 +0200)]
remove dead code

backup_user() and backup_group() are now in pbs_config workspace

2 years agobuildsys: set pkg-buildcfg version automatically
Wolfgang Bumiller [Tue, 7 Sep 2021 11:40:31 +0000 (13:40 +0200)]
buildsys: set pkg-buildcfg version automatically

the 'build' target now fixates the pbs-buildcfg version to
$(DEB_VERSION_UPSTREAM)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomoved tape_job.rs to pbs_config workspace
Dietmar Maurer [Tue, 7 Sep 2021 10:32:01 +0000 (12:32 +0200)]
moved tape_job.rs to pbs_config workspace

2 years agomove tape_encryption_keys.rs to pbs_config workspace
Dietmar Maurer [Tue, 7 Sep 2021 08:37:08 +0000 (10:37 +0200)]
move tape_encryption_keys.rs to pbs_config workspace

2 years agomoved key_derivation.rs from pbs_datastore to pbs-config/src/key_config.rs
Dietmar Maurer [Tue, 7 Sep 2021 07:22:14 +0000 (09:22 +0200)]
moved key_derivation.rs from pbs_datastore to pbs-config/src/key_config.rs

Also moved pbs-datastore/src/crypt_config.rs to pbs-tools/src/crypt_config.rs.
We do not want to depend on pbs-api-types there, so I use [u8;32] instead of
Fingerprint.

2 years agomove data_blob encode/decode from crypt_config.rs to data_blob.rs
Dietmar Maurer [Mon, 6 Sep 2021 09:48:08 +0000 (11:48 +0200)]
move data_blob encode/decode from crypt_config.rs to data_blob.rs

2 years agomove Kdf and KeyInfo to pbs_api_types workspace
Dietmar Maurer [Mon, 6 Sep 2021 08:19:29 +0000 (10:19 +0200)]
move Kdf and KeyInfo to pbs_api_types workspace

2 years agotape/inventory: fix the tape tests as user, by mocking the lock
Dominik Csapak [Mon, 6 Sep 2021 15:00:26 +0000 (17:00 +0200)]
tape/inventory: fix the tape tests as user, by mocking the lock

locking during the tests as regular user failed because we try to
chown to the backup user (which is not always possible).

Instead, do not lock at all, by implementing 'open_backup_lockfile' with
'create_mocked_lock'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopbs-config: add 'create_mocked_lock' helper
Dominik Csapak [Mon, 6 Sep 2021 15:00:25 +0000 (17:00 +0200)]
pbs-config: add 'create_mocked_lock' helper

by making the field an option and making it None in the mocked case
this function is only intended for testing and hidden from the docs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove media_pool config to pbs_config workspace
Dietmar Maurer [Mon, 6 Sep 2021 06:56:04 +0000 (08:56 +0200)]
move media_pool config to pbs_config workspace

2 years agozsh: fix completions
Oguz Bektas [Thu, 2 Sep 2021 11:48:23 +0000 (13:48 +0200)]
zsh: fix completions

seems like there was a typo in these from the beginning.

also fixes the wrong function name for proxmox-file-restore completion

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2 years agomove drive config to pbs_config workspace
Dietmar Maurer [Fri, 3 Sep 2021 07:10:18 +0000 (09:10 +0200)]
move drive config to pbs_config workspace

Also moved the tape type definitions to pbs_api_types.

2 years agoadd missing file pbs-api-types/src/remote.rs
Dietmar Maurer [Thu, 2 Sep 2021 15:36:13 +0000 (17:36 +0200)]
add missing file pbs-api-types/src/remote.rs

2 years agomove remote config into pbs-config workspace
Dietmar Maurer [Thu, 2 Sep 2021 12:25:15 +0000 (14:25 +0200)]
move remote config into pbs-config workspace

2 years agostart new pbs-config workspace
Dietmar Maurer [Thu, 2 Sep 2021 10:47:11 +0000 (12:47 +0200)]
start new pbs-config workspace

moved src/config/domains.rs

2 years agoadd proxmox-backup-debug debian package
Wolfgang Bumiller [Thu, 2 Sep 2021 08:32:29 +0000 (10:32 +0200)]
add proxmox-backup-debug debian package

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoanother import cleanup
Wolfgang Bumiller [Wed, 1 Sep 2021 12:37:11 +0000 (14:37 +0200)]
another import cleanup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agofixup imports in tests and examples
Wolfgang Bumiller [Wed, 1 Sep 2021 10:32:21 +0000 (12:32 +0200)]
fixup imports in tests and examples

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agosplit proxmox-file-restore into its own crate
Wolfgang Bumiller [Wed, 1 Sep 2021 10:21:51 +0000 (12:21 +0200)]
split proxmox-file-restore into its own crate

This also moves a couple of required utilities such as
logrotate and some file descriptor methods to pbs-tools.

Note that the logrotate usage and run-dir handling should be
improved to work as a regular user as this *should* (IMHO)
be a regular unprivileged command (including running
qemu given the kvm privileges...)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agosplit out proxmox-backup-debug binary
Wolfgang Bumiller [Tue, 31 Aug 2021 12:45:48 +0000 (14:45 +0200)]
split out proxmox-backup-debug binary

and introduce pbs_tools::cli module

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomore import cleanups
Wolfgang Bumiller [Tue, 31 Aug 2021 12:01:03 +0000 (14:01 +0200)]
more import cleanups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agofixup imports in debug binary
Wolfgang Bumiller [Tue, 31 Aug 2021 11:27:02 +0000 (13:27 +0200)]
fixup imports in debug binary

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoadd index recovery to pb-debug
Hannes Laimer [Mon, 30 Aug 2021 08:53:39 +0000 (10:53 +0200)]
add index recovery to pb-debug

Adds possibility to recover data from an index file. Options:
 - chunks: path to the directory where the chunks are saved
 - file: the index file that should be recovered(must be either .fidx or
   didx)
 - [opt] keyfile: path to a keyfile, if the data was encrypted, a keyfile is
   needed
 - [opt] skip-crc: boolean, if true, read chunks wont be verified with their
   crc-sum, increases the restore speed by a lot

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoadd file inspection to pb-debug
Hannes Laimer [Mon, 30 Aug 2021 08:53:38 +0000 (10:53 +0200)]
add file inspection to pb-debug

Adds possibility to inspect .blob, .fidx and .didx files. For index
files a list of the chunks referenced will be printed in addition to
some other information. .blob files can be decoded into file or directly
into stdout. Without decode the tool just prints the size and encryption
mode of the blob file. Options:
 - file: path to the file
 - [opt] decode: path to a file or stdout(-), if specidied, the file will be
   decoded into the specified location [only for blob files, no effect
   with index files]
 - [opt] keyfile: path to a keyfile, needed if decode is specified and the
   data was encrypted

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoadd chunk inspection to pb-debug
Hannes Laimer [Mon, 30 Aug 2021 08:53:37 +0000 (10:53 +0200)]
add chunk inspection to pb-debug

Adds possibility to inspect chunks and find indexes that reference the
chunk. Options:
 - chunk: path to the chunk file
 - [opt] decode: path to a file or to stdout(-), if specified, the
   chunk will be decoded into the specified location
 - [opt] digest: needed when searching for references, if set, it will
   be used for verification when decoding
 - [opt] keyfile: path to a keyfile, needed if decode is specified and
   the data was encrypted
 - [opt] reference-filter: path in which indexes that reference the
   chunk should be searched, can be a group, snapshot or the whole
   datastore, if not specified no references will be searched
 - [default=true] use-filename-as-digest: use chunk-filename as digest,
   if no digest is specified

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomake api2::helpers::list_dir_content a CatalogReader method
Wolfgang Bumiller [Tue, 31 Aug 2021 08:56:41 +0000 (10:56 +0200)]
make api2::helpers::list_dir_content a CatalogReader method

this is its natural place and everything required is already
part of the catalog module

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove some more API types
Wolfgang Bumiller [Tue, 31 Aug 2021 08:45:32 +0000 (10:45 +0200)]
move some more API types

ArchiveEntry -> pbs-datastore
RestoreDaemonStatus -> pbs-api-types

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: fix order of prune keep reasons
Dominik Csapak [Mon, 30 Aug 2021 08:30:09 +0000 (10:30 +0200)]
ui: fix order of prune keep reasons

two things wrong with the old code:
 * the sort function wants -1, 0 and 1 as a return value for a<b, a==b and a>b
   respectively, not a bool (which a < b returns)
 * we have to sort the newest backups first, since the first reason is
   'keep-last'. until now, we sorted the oldest backup first, resulting
   in the older backups getting the 'keep-last' reason

reported by a user in the forum:
https://forum.proxmox.com/threads/prune-ui-and-prune-schedule-simulator-dont-match.94944/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agocleanup proxmox_backup::backup module
Wolfgang Bumiller [Mon, 30 Aug 2021 09:49:22 +0000 (11:49 +0200)]
cleanup proxmox_backup::backup module

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoremote config: derive and use Updater
Dietmar Maurer [Thu, 12 Aug 2021 07:27:55 +0000 (09:27 +0200)]
remote config: derive and use Updater

Defined a new struct RemoteConfig (without name and password). This makes it
possible to bas64-encode the pasword in the config, but still allow plain
passwords with the API.

2 years agosplit out proxmox-backup-client binary
Wolfgang Bumiller [Thu, 26 Aug 2021 09:00:37 +0000 (11:00 +0200)]
split out proxmox-backup-client binary

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomove some API return types to pbs-api-types
Wolfgang Bumiller [Thu, 26 Aug 2021 11:17:55 +0000 (13:17 +0200)]
move some API return types to pbs-api-types

they'll be required by the api client

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoCargo.toml: drop features in 'patch' section
Wolfgang Bumiller [Thu, 26 Aug 2021 09:41:41 +0000 (11:41 +0200)]
Cargo.toml: drop features in 'patch' section

the features array does not need to be repeated here

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agotape: media_pool: derive and use Updater
Dietmar Maurer [Thu, 12 Aug 2021 07:04:16 +0000 (09:04 +0200)]
tape: media_pool: derive and use Updater

2 years agodrive config cleanup: derive and use Updater
Dietmar Maurer [Wed, 11 Aug 2021 11:56:18 +0000 (13:56 +0200)]
drive config cleanup: derive and use Updater

2 years agoopenid cleanup: derive and use Updater
Dietmar Maurer [Wed, 11 Aug 2021 11:22:45 +0000 (13:22 +0200)]
openid cleanup: derive and use Updater

2 years agomore Updatable -> UpdaterType fixups
Wolfgang Bumiller [Tue, 24 Aug 2021 14:12:58 +0000 (16:12 +0200)]
more Updatable -> UpdaterType fixups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>