diff --git a/go.mod b/go.mod index a9416812c72..415c3348722 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/blevesearch/bleve/v2 v2.3.4 github.com/coreos/go-oidc/v3 v3.4.0 github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d - github.com/cs3org/reva/v2 v2.10.1-0.20220922122450-24859d43f4b7 + github.com/cs3org/reva/v2 v2.10.1-0.20220922135544-ed2be2adc599 github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index 670c5b70be9..ef6abd9a289 100644 --- a/go.sum +++ b/go.sum @@ -296,6 +296,8 @@ github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d h1:toyZ7IsXlUdEP github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/cs3org/reva/v2 v2.10.1-0.20220922122450-24859d43f4b7 h1:A9Eg7+sM4uq65Cd9wBcCy7gwwUbtUiQJcmY89xExBcM= github.com/cs3org/reva/v2 v2.10.1-0.20220922122450-24859d43f4b7/go.mod h1:r0WPc8zRN0Uir7irndh/RE1Q3J5MHpLUpOyM/WyN9ZI= +github.com/cs3org/reva/v2 v2.10.1-0.20220922135544-ed2be2adc599 h1:Rqlfn1lCXYP/OsCoe48i2BfHFuy6aOq2iR2LT3QkPPw= +github.com/cs3org/reva/v2 v2.10.1-0.20220922135544-ed2be2adc599/go.mod h1:r0WPc8zRN0Uir7irndh/RE1Q3J5MHpLUpOyM/WyN9ZI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= diff --git a/services/ocdav/pkg/command/server.go b/services/ocdav/pkg/command/server.go index 5037e5fe3e9..6c697507334 100644 --- a/services/ocdav/pkg/command/server.go +++ b/services/ocdav/pkg/command/server.go @@ -63,6 +63,7 @@ func Server(cfg *config.Config) *cli.Command { ocdav.MachineAuthAPIKey(cfg.MachineAuthAPIKey), ocdav.Events(cfg.Events.Endpoint, cfg.Events.Cluster), ocdav.Broker(broker.NoOp{}), + ocdav.ForceRescan(cfg.ForceRescanPeriod, cfg.PollingTimeout), // ocdav.FavoriteManager() // FIXME needs a proper persistence implementation https://github.com/owncloud/ocis/issues/1228 // ocdav.LockSystem(), // will default to the CS3 lock system // ocdav.TLSConfig() // tls config for the http server diff --git a/services/ocdav/pkg/config/config.go b/services/ocdav/pkg/config/config.go index 0399b81b8f1..e8bc52d9661 100644 --- a/services/ocdav/pkg/config/config.go +++ b/services/ocdav/pkg/config/config.go @@ -38,6 +38,9 @@ type Config struct { Status Status `yaml:"-"` Events Events `yaml:"events"` + + ForceRescanPeriod string `yaml:"force_rescan_period" env:"FORCE_RESCAN_PERIOD" desc:"The time period after which a file needs to be rescanned before it can be downloaded, use: [s, m or h]. Example: 24h. 0 means rescan on every download. Leave empty for no rescanning."` + PollingTimeout string `yaml:"polling_timeout" env:"STAT_POLLING_TIMEOUT" desc:"[Advanced configuration] The timeout after which the server errors when a rescan has not finished, use: [s, m or h]. Example: 1m. Mandatory when FORCE_RESCAN_PERIOD is set, unused when not set."` } type Tracing struct { Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;OCDAV_TRACING_ENABLED" desc:"Activates tracing."` diff --git a/services/ocdav/pkg/config/defaults/defaultconfig.go b/services/ocdav/pkg/config/defaults/defaultconfig.go index a4f0397e9b7..a8d59bbe693 100644 --- a/services/ocdav/pkg/config/defaults/defaultconfig.go +++ b/services/ocdav/pkg/config/defaults/defaultconfig.go @@ -56,6 +56,7 @@ func DefaultConfig() *config.Config { Endpoint: "127.0.0.1:9233", Cluster: "ocis-cluster", }, + PollingTimeout: "2m", } }