mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-05 19:59:37 -06:00
fix log inheritance for accounts
This commit is contained in:
@@ -5,9 +5,7 @@ package command
|
||||
|
||||
import (
|
||||
"github.com/owncloud/ocis/accounts/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/accounts/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/version"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
@@ -30,33 +28,13 @@ func AccountsCommand(cfg *config.Config) *cli.Command {
|
||||
return ParseConfig(ctx, cfg)
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.Server(configureAccounts(cfg))
|
||||
cfg.Accounts.Log = cfg.Log
|
||||
origCmd := command.Server(cfg.Accounts)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func configureAccounts(cfg *config.Config) *svcconfig.Config {
|
||||
cfg.Accounts.Log.Level = cfg.Log.Level
|
||||
cfg.Accounts.Log.Pretty = cfg.Log.Pretty
|
||||
cfg.Accounts.Log.Color = cfg.Log.Color
|
||||
cfg.Accounts.Server.Version = version.String
|
||||
|
||||
if cfg.Tracing.Enabled {
|
||||
cfg.Accounts.Tracing.Enabled = cfg.Tracing.Enabled
|
||||
cfg.Accounts.Tracing.Type = cfg.Tracing.Type
|
||||
cfg.Accounts.Tracing.Endpoint = cfg.Tracing.Endpoint
|
||||
cfg.Accounts.Tracing.Collector = cfg.Tracing.Collector
|
||||
}
|
||||
|
||||
if cfg.TokenManager.JWTSecret != "" {
|
||||
cfg.Accounts.TokenManager.JWTSecret = cfg.TokenManager.JWTSecret
|
||||
cfg.Accounts.Repo.CS3.JWTSecret = cfg.TokenManager.JWTSecret
|
||||
}
|
||||
|
||||
return cfg.Accounts
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(AccountsCommand)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user