330 Commits

Author SHA1 Message Date
Dietmar Maurer
3e2c83471a api2: update for latest proxmox-api changes
- rename ApiFuture into ApiResponseFuture
- impl. ApiHandler::Async
2019-12-16 10:01:51 +01:00
Wolfgang Bumiller
9717c1b4eb update a chunk of stuff to the hyper release
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-12-13 11:24:41 +01:00
Dietmar Maurer
4e1e7b8738 src/server/formatter.rs: impl. new result attribute "active" 2019-12-07 15:29:42 +01:00
Dietmar Maurer
51ea723de3 rename ApiHandler::Async into ApiHandler::AsyncHttp 2019-11-23 09:03:21 +01:00
Dietmar Maurer
764bdf54cf src/server/rest.rs: simplify code 2019-11-22 18:44:14 +01:00
Dietmar Maurer
fe73df5be1 src/server/rest.rs: rename get_request_parameters_async to get_request_parameters 2019-11-22 17:24:16 +01:00
Dietmar Maurer
ac5b1c2805 src/server/rest.rs - only pass ObjectSchema to get_request_parameters_async() 2019-11-22 17:22:07 +01:00
Dietmar Maurer
b0e1e693d9 src/server/rest.rs: cleanup async code 2019-11-22 13:02:05 +01:00
Dietmar Maurer
4759ecac59 move src/api_schema/config.rs -> src/server/config.rs 2019-11-22 09:23:03 +01:00
Wolfgang Bumiller
ac21864dcf api/compat: drop more compat imports from api_schema.rs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 14:36:28 +01:00
Wolfgang Bumiller
13f6a30f52 api/compat: drop api_handler submodule
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 14:18:41 +01:00
Wolfgang Bumiller
92ffe68022 api: BoxFut -> ApiFuture
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 14:16:37 +01:00
Wolfgang Bumiller
4da0705cc4 move api schema into proxmox::api crate
And leave some compat imports in api_schema.rs to get it to
build with minimal changes.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 14:14:54 +01:00
Dietmar Maurer
3de9361d12 use const api definitions 2019-11-21 13:32:09 +01:00
Dietmar Maurer
40acfdf04c avoid some clippy warnings 2019-10-26 11:42:05 +02:00
Dietmar Maurer
d26fde6986 avoid some clippy warnings 2019-10-25 18:44:51 +02:00
Wolfgang Bumiller
00d669295f clippy: use write_all in file logger
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-11 13:56:09 +02:00
Wolfgang Bumiller
5d6ebfb8dc update to tokio 0.2.0-alpha.4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-02 15:21:26 +02:00
Wolfgang Bumiller
149b9d997f src/server/state.rs: update to tokio alpha.2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-02 15:21:26 +02:00
Wolfgang Bumiller
a19a6f1b37 src/server/rest.rs: use tokio::timer::delay
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-02 15:21:26 +02:00
Wolfgang Bumiller
9b7434ba15 src/tools/daemon.rs: switch to async
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-02 15:21:26 +02:00
Wolfgang Bumiller
6e35cda060 src/server/state.rs: switch to async
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-02 15:21:26 +02:00
Wolfgang Bumiller
df52ba5e45 src/server/rest.rs: switch to async
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-02 15:21:26 +02:00
Wolfgang Bumiller
3a1a7cbdfc src/server/h2service.rs: switch to async
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-02 15:21:26 +02:00
Wolfgang Bumiller
a079f39b40 src/server/command_socket.rs: switch to async
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-02 15:21:26 +02:00
Dietmar Maurer
0c3f5449d7 use new proxmox::tools::nodename 2019-08-03 17:06:23 +02:00
Dietmar Maurer
465990e139 update to nix 0.14, use code from proxmox:tools 2019-08-03 13:05:38 +02:00
Dietmar Maurer
fd40d69ae0 src/server/rest.rs: avoid unwrap 2019-07-03 12:00:43 +02:00
Dietmar Maurer
4ca8acb083 src/server/rest.rs: log peer address, use hyper MakeService 2019-07-03 11:54:35 +02:00
Wolfgang Bumiller
744903f874 daemon: remove last use of tools::read/write
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-07-01 10:39:13 +02:00
Dietmar Maurer
206d63a20b file download: avoid unnecessary copy 2019-06-28 07:07:52 +02:00
Dietmar Maurer
319e42552b src/server/h2service.rs: implement generic h2 service 2019-06-26 17:38:33 +02:00
Wolfgang Bumiller
a99f7ec987 tree-wide: use 'dyn' for all trait objects
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-06-07 13:13:48 +02:00
Dietmar Maurer
e8a799cf06 src/server/rest.rs: correctly verify json parameters 2019-05-24 09:10:59 +02:00
Dietmar Maurer
4dd886d9a7 src/server/rest.rs: improve error handling 2019-05-23 08:15:32 +02:00
Dietmar Maurer
27c2183ef4 src/server/rest.rs: do not log 1xx status codes as errors 2019-05-14 06:23:22 +02:00
Dietmar Maurer
3bbbece6a2 handle_async_api_request: put rpcenv into a Box
So that we can pass rpcenv into futures.
2019-05-09 18:01:24 +02:00
Dietmar Maurer
d5901112de src/server/formatter.rs: further cleanups and renaming ... 2019-05-09 13:28:26 +02:00
Dietmar Maurer
5b91995837 src/server/formatter.rs: rename format_result to format_data
To avoid confusions with Rust Result type.
2019-05-09 13:15:15 +02:00
Dietmar Maurer
1b61b80482 src/api2/admin/datastore/backup.rs: implement upload chunk 2019-05-09 13:06:09 +02:00
Dietmar Maurer
66f849d272 rc/api2/admin/datastore/h2upload.rs: implement BackupEnvironment
To pass arbitrary information/state to api methods.
2019-05-08 11:26:54 +02:00
Dietmar Maurer
010e7b80a8 src/server/rest.rs: use generics to pass RpcEnvironment 2019-05-08 11:09:01 +02:00
Dietmar Maurer
19b33e55af src/server/rest.rs: make handle_(a)sync_api_request public 2019-05-07 11:23:52 +02:00
Dietmar Maurer
16b5c3c80b RestEnvironment: derive Clone 2019-05-07 11:09:18 +02:00
Dietmar Maurer
e53d4dadaa move normalize_path to tools::normalize_uri_path 2019-05-07 09:44:34 +02:00
Dietmar Maurer
83f663b7a3 src/server/state.rs: use new BroadcastData helper 2019-04-30 10:21:48 +02:00
Wolfgang Bumiller
88aaa1841a use double-fork for reload
To ensure the new process' parent is pid 1, so systemd won't
complain about supervising a process it does not own.

Fixes the following log spam on reloads:
Apr 25 10:50:54 deb-dev systemd[1]: proxmox-backup.service: Supervising process 1625 which is not our child. We'll most likely not notice when it exits.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-25 11:02:12 +00:00
Wolfgang Bumiller
30150eef0f use service Type=notify
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-25 11:01:33 +00:00
Wolfgang Bumiller
efd898a71c tools/daemon: add sd_notify wrapper
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-25 11:01:28 +00:00
Wolfgang Bumiller
e6bdfe0674 api_schema: allow generic api handler functions
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-16 11:22:23 +02:00