file-restore-daemon: add binary with virtio-vsock API server
Implements the base of a small daemon to run within a file-restore VM. The binary spawns an API server on a virtio-vsock socket, listening for connections from the host. This happens mostly manually via the standard Unix socket API, since tokio/hyper do not have support for vsock built in. Once we have the accept'ed file descriptor, we can create a UnixStream and use our tower service implementation for that. The binary is deliberately not installed in the usual $PATH location, since it shouldn't be executed on the host by a user anyway. For now, only the API calls 'status' and 'stop' are implemented, to demonstrate and test proxmox::api functionality. Authorization is provided via a custom ApiAuth only checking a header value against a static /ticket file. Since the REST server implementation uses the log!() macro, we can redirect its output to stdout by registering env_logger as the logging target. env_logger is already in our dependency tree via zstd/bindgen. Signed-off-by: Stefan Reiter <s.reiter@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
26858dba84
commit
dd9cef56fc
5
src/bin/proxmox_restore_daemon/mod.rs
Normal file
5
src/bin/proxmox_restore_daemon/mod.rs
Normal file
@ -0,0 +1,5 @@
|
||||
///! File restore VM related functionality
|
||||
mod api;
|
||||
pub use api::*;
|
||||
|
||||
pub mod auth;
|
Reference in New Issue
Block a user