Issue tokens to initialize VNC connections
This commit is contained in:
@ -15,6 +15,7 @@ use actix_web::{web, App, HttpServer};
|
||||
use light_openid::basic_state_manager::BasicStateManager;
|
||||
use std::time::Duration;
|
||||
use virtweb_backend::actors::libvirt_actor::LibVirtActor;
|
||||
use virtweb_backend::actors::vnc_tokens_actor::VNCTokensManager;
|
||||
use virtweb_backend::app_config::AppConfig;
|
||||
use virtweb_backend::constants;
|
||||
use virtweb_backend::constants::{
|
||||
@ -41,6 +42,8 @@ async fn main() -> std::io::Result<()> {
|
||||
.start(),
|
||||
));
|
||||
|
||||
let vnc_tokens = Data::new(VNCTokensManager::start());
|
||||
|
||||
log::info!("Start to listen on {}", AppConfig::get().listen_address);
|
||||
|
||||
let state_manager = Data::new(BasicStateManager::new());
|
||||
@ -78,6 +81,7 @@ async fn main() -> std::io::Result<()> {
|
||||
.wrap(session_mw)
|
||||
.wrap(cors)
|
||||
.app_data(state_manager.clone())
|
||||
.app_data(vnc_tokens.clone())
|
||||
.app_data(Data::new(RemoteIPConfig {
|
||||
proxy: AppConfig::get().proxy_ip.clone(),
|
||||
}))
|
||||
@ -157,6 +161,10 @@ async fn main() -> std::io::Result<()> {
|
||||
"/api/vm/{uid}/screenshot",
|
||||
web::get().to(vm_controller::screenshot),
|
||||
)
|
||||
.route(
|
||||
"/api/vm/{uid}/vnc_token",
|
||||
web::get().to(vm_controller::vnc_token),
|
||||
)
|
||||
})
|
||||
.bind(&AppConfig::get().listen_address)?
|
||||
.run()
|
||||
|
Reference in New Issue
Block a user