feat: implement Nginx service with upstream management and configuration generation

This commit is contained in:
GW_MC
2025-12-29 15:21:02 +08:00
parent 814f76291c
commit 238c3db92b
15 changed files with 661 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
pub mod agent_client;
pub mod auth;
pub mod nginx;
pub mod server_state;
pub mod settings;
@@ -15,6 +16,7 @@ use crate::{
authentication::{AuthenticationServiceImpl, strategies::password::PasswordStrategy},
user::{UserService, UserServiceImpl},
},
nginx::NginxService,
server_state::{ServerStateService, ServerStateStore},
settings::{SettingsService, SettingsStore},
},
@@ -28,6 +30,8 @@ pub struct AppService {
pub user: ServiceState<dyn UserService>,
pub server_state: ServiceState<dyn ServerStateStore>,
#[allow(dead_code)]
pub nginx: ServiceState<NginxService>,
#[allow(dead_code)]
pub agent_client: ServiceState<agent_client::AgentService>,
}
@@ -47,6 +51,7 @@ pub fn get_app_service(
)),
},
user: Arc::new(UserServiceImpl::new(db_connection.clone())),
nginx: Arc::new(NginxService::new(db_connection.clone())),
agent_client: Arc::new(agent_client::AgentService::new(Configuration::from(
settings.agent.clone(),
))),