Commit Graph

3385 Commits

Author SHA1 Message Date
Dietmar Maurer
fc2253b3e8 add systemd escape_unit and unescape_unit 2021-09-23 12:04:15 +02:00
Dietmar Maurer
59c7c360e8 use UPID and systemd helpers from proxmox 0.13.4 2021-09-23 12:01:43 +02:00
Dietmar Maurer
eb1f23c588 use UPID and systemd helpers from proxmox 0.13.4 2021-09-23 12:01:43 +02:00
Dietmar Maurer
ecb6b64f18 src/server/worker_task.rs: Avoid using pbs-api-type::Authid
Because we want to move worker_task.rs into proxmox-rest-server crate.
2021-09-23 11:59:25 +02:00
Fabian Grünbichler
0999494564 schema: add extra info to array parameters
it's not immediately obvious that they can be specified more than once
otherwise.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-22 07:58:52 +02:00
Fabian Grünbichler
5f5a5194de schema: print item type-text instead of <array>
this is only used for CLI synopsis/usage strings, the API viewer already
prints the full type text in a correct format. the old variant was also
rather misleading, since on the CLI we don't pass in an array, but each
item as its own parameter.

noticed this while working on the pull/sync filtering series, but it
affects quite a lot of stuff, among other things the Updater and
Deleteable CLI, e.g. from `man proxmox-backup-manager`:

>       --delete <array>
>                     List of properties to delete.

vs.

>       --delete disable|validation-delay
>                     List of properties to delete.

But some of them might only have <string> as the item type text,
which is not much nicer but also not really worse.

The whole "List of .." is confusing anyway, but not easily solvable,
since the description is used for
- API dump/viewer (where it is a list/array of ..)
- usage message/man pages (where it's a parameter that gives a single
  element, but it might be passed in multiple times to construct an
  array)

Also, for some common occurrences, the item description is too
generic, and it's not possible to override the description for
external types with the current api macro.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
 [ Thomas: Added more context that was in the diffstat of the path ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-22 07:56:09 +02:00
Dietmar Maurer
3d428713c5 rename pbs-systemd to proxmox-systemd 2021-09-21 10:06:27 +02:00
Dietmar Maurer
1d60abf9f1 move src/server/rest.rs to proxmox-rest-server crate
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
1eb2dd5dac 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>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
7c1bd58a8a 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>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
48b7a61a21 rest server: do not use pbs_api_types::Authid
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
2ea6f8d01d 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>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
efeccc11cc make get_index and ApiConfig property (callback)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
3d73529460 rest server: simplify get_index() method signature
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
cc67441662 move normalize_uri_path and extract_cookie to proxmox-rest-server crate
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
fbe0de85d0 move src/tools/compression.rs to proxmox-rest-server crate
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
dc28aa1ae7 move src/server/formatter.rs to proxmox-rest-server crate
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
ba04dfb9b2 move src/server/environment.rs to proxmox-rest-server crate
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
51d84f9847 move src/tools/daemon.rs to proxmox-rest-server workspace
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
ca7a26166f 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>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
2e426f9df2 start new proxmox-rest-server workspace
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-21 08:46:41 +02:00
Dietmar Maurer
3cd221c163 bump proxmox version to 0.13.3-1 2021-09-21 06:45:28 +02:00
Dietmar Maurer
b6b9118ce3 atomic_open_or_create_file: add support for OFlag::O_EXCL 2021-09-20 08:24:44 +02:00
Dietmar Maurer
b46a0720ae atomic_open_or_create_file: catch unsupported flag OFlag::O_DIRECTORY 2021-09-20 08:13:28 +02:00
Dietmar Maurer
c7e1a1f3c8 update proxmox/debian/control 2021-09-20 08:12:18 +02:00
Dietmar Maurer
297a076478 bump proxmox version to 0.13.2-1 2021-09-16 11:03:27 +02:00
Dietmar Maurer
fb2b7a4e93 impl <T: UserInformation> UserInformation for std::sync::Arc<T> 2021-09-16 10:21:50 +02:00
Dominik Csapak
254ef7ff82 proxmox: generate_usage_str: don't require static lifetimes
this prevents us from using it under certain conditions and it's
actually not necessary, so drop them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-09-15 08:09:24 +02:00
Dietmar Maurer
c983a1d623 avoid type re-exports 2021-09-14 08:35:43 +02:00
Dietmar Maurer
a4e56bff60 more api type cleanups: avoid re-exports 2021-09-10 12:25:32 +02:00
Dietmar Maurer
441b34e46e more api type cleanups: avoid re-exports 2021-09-10 12:25:32 +02:00
Dietmar Maurer
908d87f6cb more api type cleanups: avoid re-exports 2021-09-10 12:25:32 +02:00
Dietmar Maurer
157d9a45e1 move PruneOptions to pbs_api_types workspace 2021-09-10 09:21:27 +02:00
Dietmar Maurer
086536e3fa move datastore config to pbs_config workspace 2021-09-10 08:40:58 +02:00
Dietmar Maurer
bc6ad1dfce move user configuration to pbs_config workspace
Also moved memcom.rs and cached_user_info.rs
2021-09-10 07:09:04 +02:00
Dietmar Maurer
99ac07d906 cleanup User configuration: use Updater 2021-09-09 13:14:28 +02:00
Dietmar Maurer
d48f612bec move acl to pbs_config workspaces, pbs_api_types cleanups 2021-09-09 10:50:08 +02:00
Dietmar Maurer
db1012b5aa move network config to pbs_config workspace 2021-09-08 12:22:48 +02:00
Dietmar Maurer
56d4dc1034 changer config cleanup: use Updater 2021-09-08 09:29:01 +02:00
Dietmar Maurer
3d9b2c8fd5 tape job cleanup: user Updater 2021-09-08 08:55:55 +02:00
Dietmar Maurer
5f13dcc5fc verify job cleanup: use Updater/flatten 2021-09-08 08:40:32 +02:00
Dietmar Maurer
7760d5679c sync job cleanup: use Updater/flatten 2021-09-08 08:28:09 +02:00
Dietmar Maurer
7240e6374b moved tape_job.rs to pbs_config workspace 2021-09-07 12:40:15 +02:00
Dietmar Maurer
8fe018cfd8 move Kdf and KeyInfo to pbs_api_types workspace 2021-09-07 09:59:59 +02:00
Dietmar Maurer
28e668ddf3 move drive config to pbs_config workspace
Also moved the tape type definitions to pbs_api_types.
2021-09-03 09:10:18 +02:00
Dietmar Maurer
1c30b9da92 add missing file pbs-api-types/src/remote.rs 2021-09-02 17:36:13 +02:00
Dietmar Maurer
6b977533d6 move remote config into pbs-config workspace 2021-09-02 14:25:15 +02:00
Dietmar Maurer
80f7bf3822 start new pbs-config workspace
moved src/config/domains.rs
2021-09-02 12:58:20 +02:00
Dietmar Maurer
93dfd7d8e9 start new pbs-config workspace
moved src/config/domains.rs
2021-09-02 12:58:20 +02:00
Dietmar Maurer
3fc017a570 start new pbs-config workspace
moved src/config/domains.rs
2021-09-02 12:58:20 +02:00