From cd876c2131678ae51928240107f602cf8be1f725 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Tue, 19 Jul 2022 16:15:24 +0200 Subject: [PATCH] Add config for setting search_min_length capability This adds the "search_min_length" setting to the frontend service which allows to set the search_min_length capabilty which is e.g. used by web. Partial: #547 --- services/frontend/pkg/config/config.go | 1 + services/frontend/pkg/revaconfig/config.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/services/frontend/pkg/config/config.go b/services/frontend/pkg/config/config.go index 3d8cef6b100..d6855a926df 100644 --- a/services/frontend/pkg/config/config.go +++ b/services/frontend/pkg/config/config.go @@ -32,6 +32,7 @@ type Config struct { UploadHTTPMethodOverride string `yaml:"upload_http_method_override" env:"FRONTEND_UPLOAD_HTTP_METHOD_OVERRIDE" desc:"Advise TUS to replace PATCH requests by POST requests."` DefaultUploadProtocol string `yaml:"default_upload_protocol" env:"FRONTEND_DEFAULT_UPLOAD_PROTOCOL" desc:"The default upload protocol to use in the frontend (e.g. tus)."` EnableResharing bool `yaml:"enable_resharing" env:"FRONTEND_ENABLE_RESHARING" desc:"Enables the support for resharing in the frontend."` + SearchMinLength int `yaml:"search_min_length" env:"FRONTEND_SEARCH_MIN_LENGTH" desc:"Minimum number of characters to enter before starting a search for Sharees"` PublicURL string `yaml:"public_url" env:"OCIS_URL;FRONTEND_PUBLIC_URL" desc:"The public facing URL of the oCIS frontend."` diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go index 7b13c3bfb32..16a94e06f91 100644 --- a/services/frontend/pkg/revaconfig/config.go +++ b/services/frontend/pkg/revaconfig/config.go @@ -165,7 +165,7 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} { "share_with_group_members_only": true, "share_with_membership_groups_only": true, "default_permissions": 22, - "search_min_length": 3, + "search_min_length": cfg.SearchMinLength, "public": map[string]interface{}{ "alias": true, "enabled": true,