move config validation into a separate function

This commit is contained in:
Willy Kloucek
2022-04-28 11:10:39 +02:00
parent df53c2a545
commit 3054875a05
64 changed files with 189 additions and 101 deletions
@@ -1,7 +1,6 @@
package defaults
import (
"log"
"path"
"github.com/owncloud/ocis/extensions/thumbnails/pkg/config"
@@ -10,10 +9,8 @@ import (
func FullDefaultConfig() *config.Config {
cfg := DefaultConfig()
EnsureDefaults(cfg)
Sanitize(cfg)
return cfg
}
@@ -76,8 +73,6 @@ func EnsureDefaults(cfg *config.Config) {
if cfg.Thumbnail.TransferSecret == "" && cfg.Commons != nil && cfg.Commons.TransferSecret != "" {
cfg.Thumbnail.TransferSecret = cfg.Commons.TransferSecret
} else if cfg.TransferSecret == "" {
log.Fatalf("reva transfer secret is not set up properly, bailing out (%s)", cfg.Service.Name)
}
}