diff --git a/accounts/pkg/command/server.go b/accounts/pkg/command/server.go index 8fc613601a..9ca1112b4b 100644 --- a/accounts/pkg/command/server.go +++ b/accounts/pkg/command/server.go @@ -23,7 +23,6 @@ func Server(cfg *config.Config) *cli.Command { Usage: "Start ocis accounts service", Description: "uses an LDAP server as the storage backend", Before: func(ctx *cli.Context) error { - logger := NewLogger(cfg) if cfg.HTTP.Root != "/" { cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/") } @@ -32,17 +31,20 @@ func Server(cfg *config.Config) *cli.Command { // When running on single binary mode the before hook from the root command won't get called. We manually // call this before hook from ocis command, so the configuration can be loaded. - return ParseConfig(ctx, cfg) - if origins := ctx.StringSlice("cors-allowed-origins"); len(origins) != 0 { - cfg.HTTP.CORS.AllowedOrigins = origins + if err := ParseConfig(ctx, cfg); err != nil { + return err } - if methods := ctx.StringSlice("cors-allowed-methods"); len(methods) != 0 { - cfg.HTTP.CORS.AllowedMethods = methods - } - if headers := ctx.StringSlice("cors-allowed-headers"); len(headers) != 0 { - cfg.HTTP.CORS.AllowedOrigins = headers - } - logger.Debug().Str("service", "accounts").Msg("ignoring config file parsing when running supervised") + + // TODO(this is not in the cli context anymore) + //if origins := ctx.StringSlice("cors-allowed-origins"); len(origins) != 0 { + // cfg.HTTP.CORS.AllowedOrigins = origins + //} + //if methods := ctx.StringSlice("cors-allowed-methods"); len(methods) != 0 { + // cfg.HTTP.CORS.AllowedMethods = methods + //} + //if headers := ctx.StringSlice("cors-allowed-headers"); len(headers) != 0 { + // cfg.HTTP.CORS.AllowedOrigins = headers + //} return nil }, Action: func(c *cli.Context) error { diff --git a/graph/pkg/command/server.go b/graph/pkg/command/server.go index 91ca8960a4..5e788db151 100644 --- a/graph/pkg/command/server.go +++ b/graph/pkg/command/server.go @@ -22,15 +22,15 @@ func Server(cfg *config.Config) *cli.Command { Usage: "Start integrated server", Flags: flagset.ServerWithConfig(cfg), Before: func(ctx *cli.Context) error { - logger := NewLogger(cfg) if cfg.HTTP.Root != "/" { cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/") } // When running on single binary mode the before hook from the root command won't get called. We manually // call this before hook from ocis command, so the configuration can be loaded. - return ParseConfig(ctx, cfg) - logger.Debug().Str("service", "graph").Msg("ignoring config file parsing when running supervised") + if err := ParseConfig(ctx, cfg); err != nil { + return err + } return nil }, Action: func(c *cli.Context) error {