configuring backend topology
This commit is contained in:
+22
-1
@@ -281,7 +281,7 @@ impl Default for FeaturesConfig {
|
||||
Self {
|
||||
enable_auth: true, // Enable authentication by default
|
||||
enable_user_storage_quotas: false,
|
||||
enable_file_sharing: false,
|
||||
enable_file_sharing: true, // Enable file sharing by default
|
||||
enable_trash: true, // Enable trash feature
|
||||
enable_search: true, // Enable search feature
|
||||
}
|
||||
@@ -412,6 +412,27 @@ impl AppConfig {
|
||||
}
|
||||
}
|
||||
|
||||
if let Ok(enable_file_sharing) = env::var("OXICLOUD_ENABLE_FILE_SHARING")
|
||||
.map(|v| v.parse::<bool>()) {
|
||||
if let Ok(val) = enable_file_sharing {
|
||||
config.features.enable_file_sharing = val;
|
||||
}
|
||||
}
|
||||
|
||||
if let Ok(enable_trash) = env::var("OXICLOUD_ENABLE_TRASH")
|
||||
.map(|v| v.parse::<bool>()) {
|
||||
if let Ok(val) = enable_trash {
|
||||
config.features.enable_trash = val;
|
||||
}
|
||||
}
|
||||
|
||||
if let Ok(enable_search) = env::var("OXICLOUD_ENABLE_SEARCH")
|
||||
.map(|v| v.parse::<bool>()) {
|
||||
if let Ok(val) = enable_search {
|
||||
config.features.enable_search = val;
|
||||
}
|
||||
}
|
||||
|
||||
config
|
||||
}
|
||||
|
||||
|
||||
@@ -239,6 +239,7 @@ impl AppServiceFactory {
|
||||
i18n_service,
|
||||
trash_service,
|
||||
search_service,
|
||||
share_service: None, // No share service by default
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -281,6 +282,7 @@ pub struct ApplicationServices {
|
||||
pub i18n_service: Arc<I18nApplicationService>,
|
||||
pub trash_service: Option<Arc<dyn TrashUseCase>>,
|
||||
pub search_service: Option<Arc<dyn SearchUseCase>>,
|
||||
pub share_service: Option<Arc<dyn crate::application::ports::share_ports::ShareUseCase>>,
|
||||
}
|
||||
|
||||
/// Contenedor para servicios de autenticación
|
||||
@@ -300,6 +302,7 @@ pub struct AppState {
|
||||
pub db_pool: Option<Arc<PgPool>>,
|
||||
pub auth_service: Option<AuthServices>,
|
||||
pub trash_service: Option<Arc<dyn TrashUseCase>>,
|
||||
pub share_service: Option<Arc<dyn crate::application::ports::share_ports::ShareUseCase>>,
|
||||
}
|
||||
|
||||
impl Default for AppState {
|
||||
@@ -768,6 +771,7 @@ impl Default for AppState {
|
||||
i18n_service: Arc::new(DummyI18nApplicationService::dummy()),
|
||||
trash_service: None, // No trash service in minimal mode
|
||||
search_service: Some(Arc::new(DummySearchUseCase) as Arc<dyn crate::application::ports::inbound::SearchUseCase>),
|
||||
share_service: None, // No share service in minimal mode
|
||||
};
|
||||
|
||||
// Return a minimal app state
|
||||
@@ -778,6 +782,7 @@ impl Default for AppState {
|
||||
db_pool: None,
|
||||
auth_service: None,
|
||||
trash_service: None,
|
||||
share_service: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -795,6 +800,7 @@ impl AppState {
|
||||
db_pool: None,
|
||||
auth_service: None,
|
||||
trash_service: None,
|
||||
share_service: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -812,4 +818,9 @@ impl AppState {
|
||||
self.trash_service = Some(trash_service);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_share_service(mut self, share_service: Arc<dyn crate::application::ports::share_ports::ShareUseCase>) -> Self {
|
||||
self.share_service = Some(share_service);
|
||||
self
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user