feat(contacts): add feature flag to enable/disable exposition of users in address-book

This commit is contained in:
Edouard Vanbelle
2026-05-10 22:12:11 +02:00
parent 7e1484ec2c
commit ad711e18ea
3 changed files with 20 additions and 1 deletions
+10
View File
@@ -618,6 +618,9 @@ pub struct FeaturesConfig {
pub enable_trash: bool,
pub enable_search: bool,
pub enable_music: bool,
/// Expose other OxiCloud users as a read-only "system" address book
/// at GET /api/address-books. Set to false to hide the user directory.
pub expose_system_users: bool,
}
impl Default for FeaturesConfig {
@@ -629,6 +632,7 @@ impl Default for FeaturesConfig {
enable_trash: true, // Enable trash feature
enable_search: true, // Enable search feature
enable_music: true, // Enable music feature
expose_system_users: true, // Expose OxiCloud users as address book by default
}
}
}
@@ -948,6 +952,12 @@ impl AppConfig {
config.features.enable_music = val;
}
if let Ok(v) = env::var("OXICLOUD_EXPOSE_SYSTEM_USERS").map(|v| v.parse::<bool>())
&& let Ok(val) = v
{
config.features.expose_system_users = val;
}
// Storage limits
if let Ok(max_upload) = env::var("OXICLOUD_MAX_UPLOAD_SIZE").map(|v| v.parse::<usize>())
&& let Ok(val) = max_upload