From e246d6d6136960fae9f016d8c440cf61af387f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Thu, 7 May 2026 08:27:27 +0200 Subject: [PATCH] Make the ScanFS option configurable via env var --- services/storage-users/pkg/config/config.go | 1 + services/storage-users/pkg/config/defaults/defaultconfig.go | 1 + services/storage-users/pkg/revaconfig/user.go | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/services/storage-users/pkg/config/config.go b/services/storage-users/pkg/config/config.go index b5aa33824b..ca22650946 100644 --- a/services/storage-users/pkg/config/config.go +++ b/services/storage-users/pkg/config/config.go @@ -204,6 +204,7 @@ type PosixDriver struct { EnableFSRevisions bool `yaml:"enable_fs_revisions" env:"STORAGE_USERS_POSIX_ENABLE_FS_REVISIONS" desc:"Allow for generating revisions from changes done to the local storage. Note: This doubles the number of bytes stored on disk because a copy of the current revision is stored to be turned into a revision later." introductionVersion:"1.0.0"` + ScanFS bool `yaml:"scan_fs" env:"STORAGE_USERS_POSIX_SCAN_FS" desc:"Scan the filesystem at startup for changes and update the metadata accordingly." introductionVersion:"%%NEXT%%"` WatchFS bool `yaml:"watch_fs" env:"STORAGE_USERS_POSIX_WATCH_FS" desc:"Enable the filesystem watcher to detect changes to the filesystem. This is used to detect changes to the filesystem and update the metadata accordingly." introductionVersion:"2.0.0"` WatchType string `yaml:"watch_type" env:"STORAGE_USERS_POSIX_WATCH_TYPE" desc:"Type of the watcher to use for getting notified about changes to the filesystem. Currently available options are 'inotifywait' (default), 'cephfs', 'gpfswatchfolder' and 'gpfsfileauditlogging'." introductionVersion:"1.0.0"` WatchPath string `yaml:"watch_path" env:"STORAGE_USERS_POSIX_WATCH_PATH" desc:"Path to the watch directory/file. Only applies to the 'gpfsfileauditlogging' and 'inotifywait' watcher, in which case it is the path of the file audit log file/base directory to watch." introductionVersion:"1.0.0"` diff --git a/services/storage-users/pkg/config/defaults/defaultconfig.go b/services/storage-users/pkg/config/defaults/defaultconfig.go index 541d56d20a..cf015f275e 100644 --- a/services/storage-users/pkg/config/defaults/defaultconfig.go +++ b/services/storage-users/pkg/config/defaults/defaultconfig.go @@ -151,6 +151,7 @@ func DefaultConfig() *config.Config { PermissionsEndpoint: "eu.opencloud.api.settings", AsyncUploads: true, ScanDebounceDelay: 1 * time.Second, + ScanFS: true, WatchFS: false, EnableFSRevisions: false, InotifyStatsFrequency: 5 * time.Minute, diff --git a/services/storage-users/pkg/revaconfig/user.go b/services/storage-users/pkg/revaconfig/user.go index 8f3668f432..8ec5dd6b74 100644 --- a/services/storage-users/pkg/revaconfig/user.go +++ b/services/storage-users/pkg/revaconfig/user.go @@ -15,7 +15,7 @@ func StorageProviderDrivers(cfg *config.Config) map[string]any { "owncloudsql": OwnCloudSQL(cfg), "decomposed": DecomposedNoEvents(cfg), "decomposeds3": DecomposedS3NoEvents(cfg), - "posix": Posix(cfg, true, cfg.Drivers.Posix.WatchFS), + "posix": Posix(cfg, cfg.Drivers.Posix.ScanFS, cfg.Drivers.Posix.WatchFS), "ocis": Decomposed(cfg), // deprecated: use decomposed "s3ng": DecomposedS3NoEvents(cfg), // deprecated: use decomposeds3