gbserver/src/main.rs
Rodrigo Rodriguez (Pragmatismo) c75095505b
Some checks failed
GBCI / build (push) Failing after 8m43s
Implement email, meeting, proxy, and webmail services with LXC containers
- Added email service setup script to configure Stalwart Mail in a container.
- Created meeting service script to install and configure LiveKit with TURN server.
- Developed proxy service script to set up Caddy as a reverse proxy.
- Implemented webmail service script to deploy Roundcube with PHP support.
- Established system service files for each service to manage their lifecycle.
- Configured persistent storage for logs, data, and configuration for all services.
- Added integration tests for email listing and file upload functionalities.
- Updated prompt guidelines for consistent directory structure and user management.
2025-06-19 23:16:57 -03:00

38 lines
1.1 KiB
Rust

use actix_web::{middleware, web, App, HttpServer};
use gbserver::{init_minio, upload_file, AppConfig, AppState};
use tracing_subscriber::fmt::format::FmtSpan;
use dotenv::dotenv;
#[actix_web::main]
async fn main() -> std::io::Result<()> {
dotenv().ok();
// Initialize tracing
tracing_subscriber::fmt()
.with_span_events(FmtSpan::CLOSE)
.init();
// log::set_max_level(LevelFilter::Info);
let config = AppConfig::from_env();
let minio_client = init_minio(&config).await.expect("Failed to initialize Minio");
let app_state = web::Data::new(AppState {
config: Some(config.clone()),
minio_client: Some(minio_client),
});
// Start HTTP server
HttpServer::new(move || {
App::new()
.wrap(middleware::Logger::default())
.wrap(middleware::Compress::default())
.app_data(app_state.clone())
.service(upload_file) // Uncomment and import or define upload_file below
})
.bind((config.server.host.clone(), config.server.port))?
.run()
.await
}