* Adding search files api

* Fixing golangci-lint

* Adding bulk-indexing and improving a bit the name indexing for bleve and elasticsearch

* Add content extraction config migration

* Fixing a problem with document extraction

* Unapplying certain changes moved to other PR

* Fixing tests

* Making extract content app migration a private method

* Addressing PR review comments

* Addressing PR review comments

* Adding feature flag

* Removing debug string

* Fixing imports

* Fixing linting errors

* Do not migrate the config if the feature flag is not enabled

* Fix tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Jesús Espino
2021-02-26 07:41:05 +01:00
коммит произвёл GitHub
родитель 074a8e5fd9
Коммит 85293fcf41
13 изменённых файлов: 648 добавлений и 4 удалений

Просмотреть файл

@@ -335,6 +335,7 @@ type ServiceSettings struct {
PostEditTimeLimit *int `access:"user_management_permissions"`
TimeBetweenUserTypingUpdatesMilliseconds *int64 `access:"experimental,write_restrictable,cloud_restrictable"`
EnablePostSearch *bool `access:"write_restrictable,cloud_restrictable"`
EnableFileSearch *bool `access:"write_restrictable"`
MinimumHashtagLength *int `access:"environment,write_restrictable,cloud_restrictable"`
EnableUserTypingMessages *bool `access:"experimental,write_restrictable,cloud_restrictable"`
EnableChannelViewedMessages *bool `access:"experimental,write_restrictable,cloud_restrictable"`
@@ -537,6 +538,10 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
s.EnablePostSearch = NewBool(true)
}
if s.EnableFileSearch == nil {
s.EnableFileSearch = NewBool(true)
}
if s.MinimumHashtagLength == nil {
s.MinimumHashtagLength = NewInt(3)
}
@@ -1353,6 +1358,8 @@ type FileSettings struct {
DriverName *string `access:"environment,write_restrictable,cloud_restrictable"`
Directory *string `access:"environment,write_restrictable,cloud_restrictable"`
EnablePublicLink *bool `access:"site,cloud_restrictable"`
ExtractContent *bool `access:"environment,write_restrictable"`
ArchiveRecursion *bool `access:"environment,write_restrictable"`
PublicLinkSalt *string `access:"site,cloud_restrictable"` // telemetry: none
InitialFont *string `access:"environment,cloud_restrictable"` // telemetry: none
AmazonS3AccessKeyId *string `access:"environment,write_restrictable,cloud_restrictable"` // telemetry: none
@@ -1396,6 +1403,14 @@ func (s *FileSettings) SetDefaults(isUpdate bool) {
s.EnablePublicLink = NewBool(false)
}
if s.ExtractContent == nil {
s.ExtractContent = NewBool(false)
}
if s.ArchiveRecursion == nil {
s.ArchiveRecursion = NewBool(false)
}
if isUpdate {
// When updating an existing configuration, ensure link salt has been specified.
if s.PublicLinkSalt == nil || *s.PublicLinkSalt == "" {