Fix all compilation issues.

This commit is contained in:
Florian THIERRY
2026-07-14 13:55:41 +02:00
parent c24df944c5
commit f8fd59b01a
28 changed files with 752 additions and 284 deletions
+24 -23
View File
@@ -11,9 +11,9 @@ use std::fs::File;
use std::io::{BufReader, Error};
use std::path::Path;
use std::sync::Arc;
use surveillant_systeme_exposition::init;
use surveillant_systeme_exposition::video::video_format_content_type_mapper::map_to_content_type;
use surveillant_systeme_infrastructure::video::video_format_detector::get_content_type;
use lumiere_exposition::init;
use lumiere_exposition::video::video_format_content_type_mapper::map_to_content_type;
use lumiere_infrastructure::video::video_format_detector::get_content_type;
use tokio_cron_scheduler::{Job, JobScheduler};
#[actix_web::main]
@@ -31,35 +31,36 @@ async fn main() -> std::io::Result<()> {
let application_context = ApplicationContext::init()?;
let tls_config = init_tls_configuration()?;
// let tls_config = init_tls_configuration()?;
let server = HttpServer::new(
move || App::new().configure(init)
.app_data(web::Data::new(Arc::new(application_context.user_service.clone())))
)
.bind_rustls_0_23(("0.0.0.0", 19000), tls_config)
.bind("0.0.0.0:19000")
// .bind_rustls_0_23(("0.0.0.0", 19000), tls_config)
.expect("Unable to start server");
server.run().await
}
fn init_tls_configuration() -> Result<ServerConfig, Error> {
let mut certs_file = BufReader::new(File::open("./certs/lumiere.crt")?);
let mut key_file = BufReader::new(File::open("./certs/lumiere.key")?);
let tls_certs = rustls_pemfile::certs(&mut certs_file)
.collect::<Result<Vec<_>, _>>().expect("Unable to read the TLS certificate…");
let tls_key = rustls_pemfile::pkcs8_private_keys(&mut key_file)
.next()
.unwrap()
.expect("Unable to read the private key for TLS configuration…");
let tls_config = rustls::ServerConfig::builder()
.with_no_client_auth()
.with_single_cert(tls_certs, rustls::pki_types::PrivateKeyDer::Pkcs8(tls_key))
.unwrap();
Ok(tls_config)
}
// fn init_tls_configuration() -> Result<ServerConfig, Error> {
// let mut certs_file = BufReader::new(File::open("./certs/lumiere.crt")?);
// let mut key_file = BufReader::new(File::open("./certs/lumiere.key")?);
//
// let tls_certs = rustls_pemfile::certs(&mut certs_file)
// .collect::<Result<Vec<_>, _>>().expect("Unable to read the TLS certificate…");
// let tls_key = rustls_pemfile::pkcs8_private_keys(&mut key_file)
// .next()
// .unwrap()
// .expect("Unable to read the private key for TLS configuration…");
//
// let tls_config = rustls::ServerConfig::builder()
// .with_no_client_auth()
// .with_single_cert(tls_certs, rustls::pki_types::PrivateKeyDer::Pkcs8(tls_key))
// .unwrap();
//
// Ok(tls_config)
// }
fn check_all_variables_are_set() {