Add local-files feature to disable local storage scanning
Some checks failed
BotServer CI/CD / build (push) Has been cancelled

- Without local-files feature: only MinIO/Drive is used as bot source
- With local-files feature: scans /opt/gbo/data for bots (default behavior)
- Bucket filtering (gbo-*) only active when local-files is NOT enabled
- LocalFileMonitor and ConfigWatcher only start with local-files feature
This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-08 18:29:48 -03:00
parent b4a82b6c06
commit 62d0da3923
3 changed files with 8 additions and 1 deletions

View file

@ -25,6 +25,8 @@ external_sync = ["automation", "drive", "cache"]
scripting = ["dep:rhai"]
automation = ["scripting", "dep:cron"]
drive = ["dep:aws-config", "dep:aws-sdk-s3", "dep:aws-smithy-async", "dep:pdf-extract"]
# local-files: Enables local file monitoring (scans /opt/gbo/data for bots)
# Without this feature, only MinIO/Drive is used as bot source
local-files = ["dep:notify"]
cache = ["dep:redis"]
directory = ["rbac"]

View file

@ -345,7 +345,9 @@ pub async fn list_buckets(
.filter_map(|b| {
b.name().map(|name| {
let name_str = name.to_string();
// Only include buckets that start with "gbo-"
// Only include buckets that start with "gbo-" when local-files is NOT enabled
// This ensures only MinIO-sourced bots are used in cloud/gateway mode
#[cfg(not(feature = "local-files"))]
if !name_str.starts_with("gbo-") {
return None;
}

View file

@ -893,9 +893,12 @@ pub async fn start_background_services(
#[cfg(feature = "drive")]
start_drive_monitors(app_state.clone(), pool).await;
// Local file monitoring only enabled when local-files feature is present
#[cfg(feature = "local-files")]
start_local_file_monitor(app_state.clone()).await;
// ConfigWatcher only enabled when local-files feature is present
#[cfg(feature = "local-files")]
start_config_watcher(app_state.clone()).await;
}