Move default configs to root level
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user