Skip to content

Commit

Permalink
fix search service startup
Browse files Browse the repository at this point in the history
Signed-off-by: jkoberg <jkoberg@owncloud.com>
  • Loading branch information
kobergj committed Nov 23, 2023
1 parent fea8e45 commit bd546a6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-search-service-init.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix search service start

The `search` service would sometimes not start correctly because config values are overwritten by default configuration.

https://github.com/owncloud/ocis/pull/7795
2 changes: 1 addition & 1 deletion ocis-pkg/config/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func DefaultConfig() *Config {
Postprocessing: postprocessing.DefaultConfig(),
Policies: policies.DefaultConfig(),
Proxy: proxy.DefaultConfig(),
Search: search.FullDefaultConfig(),
Search: search.DefaultConfig(),
Settings: settings.DefaultConfig(),
Sharing: sharing.DefaultConfig(),
SSE: sse.DefaultConfig(),
Expand Down
4 changes: 4 additions & 0 deletions services/search/pkg/config/parser/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"

ociscfg "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
"github.com/owncloud/ocis/v2/services/search/pkg/config"
"github.com/owncloud/ocis/v2/services/search/pkg/config/defaults"

Expand Down Expand Up @@ -33,5 +34,8 @@ func ParseConfig(cfg *config.Config) error {
}

func Validate(cfg *config.Config) error {
if cfg.TokenManager.JWTSecret == "" {
return shared.MissingJWTTokenError(cfg.Service.Name)
}
return nil
}

0 comments on commit bd546a6

Please sign in to comment.