Move default configs to root level

This commit is contained in:
Benedikt Kulmann
2020-11-11 17:12:14 +01:00
parent dc61b11850
commit 15df700b27
6 changed files with 55 additions and 32 deletions
+7
View File
@@ -44,6 +44,13 @@ func configureAccounts(cfg *config.Config) *svcconfig.Config {
cfg.Accounts.Log.Color = cfg.Log.Color
cfg.Accounts.Server.Version = version.String
// TODO: we need tracing on the accounts service as well. when we have it, apply default config from OCIS here.
if cfg.TokenManager.JWTSecret != "" {
cfg.Accounts.TokenManager.JWTSecret = cfg.TokenManager.JWTSecret
cfg.Accounts.Repo.CS3.JWTSecret = cfg.TokenManager.JWTSecret
}
return cfg.Accounts
}
+6 -3
View File
@@ -4,12 +4,12 @@ package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/owncloud/ocis/ocis/pkg/version"
"github.com/owncloud/ocis/ocs/pkg/command"
svcconfig "github.com/owncloud/ocis/ocs/pkg/config"
"github.com/owncloud/ocis/ocs/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// OCSCommand is the entrypoint for the ocs command.
@@ -48,10 +48,13 @@ func configureOCS(cfg *config.Config) *svcconfig.Config {
cfg.OCS.Tracing.Service = cfg.Tracing.Service
}
if cfg.TokenManager.JWTSecret != "" {
cfg.OCS.TokenManager.JWTSecret = cfg.TokenManager.JWTSecret
}
return cfg.OCS
}
func init() {
register.AddCommand(OCSCommand)
}
+2 -2
View File
@@ -48,8 +48,8 @@ func configureProxy(cfg *config.Config) *svcconfig.Config {
cfg.Proxy.Tracing.Service = cfg.Tracing.Service
}
if cfg.Storage.Reva.JWTSecret != "" {
cfg.Proxy.TokenManager.JWTSecret = cfg.Storage.Reva.JWTSecret
if cfg.TokenManager.JWTSecret != "" {
cfg.Proxy.TokenManager.JWTSecret = cfg.TokenManager.JWTSecret
}
return cfg.Proxy
+2 -2
View File
@@ -48,8 +48,8 @@ func configureSettings(cfg *config.Config) *svcconfig.Config {
cfg.Settings.Tracing.Service = cfg.Tracing.Service
}
if cfg.Storage.Reva.JWTSecret != "" {
cfg.Settings.TokenManager.JWTSecret = cfg.Storage.Reva.JWTSecret
if cfg.TokenManager.JWTSecret != "" {
cfg.Settings.TokenManager.JWTSecret = cfg.TokenManager.JWTSecret
}
return cfg.Settings