Create release docker image

This commit is contained in:
2024-05-06 21:27:07 +02:00
parent d63d3ecebc
commit 1c0ba90b8e
8 changed files with 171 additions and 4 deletions

View File

@ -11,9 +11,7 @@ use actix_web::{web, App, HttpServer};
use light_openid::basic_state_manager::BasicStateManager;
use remote_backend::app_config::AppConfig;
use remote_backend::constants;
use remote_backend::controllers::{
auth_controller, server_controller, sys_info_controller, vm_controller,
};
use remote_backend::controllers::{auth_controller, server_controller, static_controller, sys_info_controller, vm_controller};
use remote_backend::middlewares::auth_middleware::AuthChecker;
use std::time::Duration;
@ -61,6 +59,7 @@ async fn main() -> std::io::Result<()> {
.app_data(Data::new(RemoteIPConfig {
proxy: AppConfig::get().proxy_ip.clone(),
}))
// Server routes
.route(
"/api/server/config",
web::get().to(server_controller::config),
@ -81,6 +80,7 @@ async fn main() -> std::io::Result<()> {
"/api/auth/sign_out",
web::get().to(auth_controller::sign_out),
)
// VM routes
.route("/api/vm/list", web::get().to(vm_controller::list))
.route("/api/vm/{uid}/state", web::get().to(vm_controller::state))
.route("/api/vm/{uid}/start", web::get().to(vm_controller::start))
@ -99,6 +99,7 @@ async fn main() -> std::io::Result<()> {
"/api/vm/{uid}/screenshot",
web::get().to(vm_controller::screenshot),
)
// Sys info routes
.route(
"/api/sysinfo/config",
web::get().to(sys_info_controller::config),
@ -107,6 +108,12 @@ async fn main() -> std::io::Result<()> {
"/api/sysinfo/status",
web::get().to(sys_info_controller::status),
)
// Static assets
.route("/", web::get().to(static_controller::root_index))
.route(
"/{tail:.*}",
web::get().to(static_controller::serve_static_content),
)
})
.bind(&AppConfig::get().listen_address)?
.run()