diff --git a/pkg/command/server.go b/pkg/command/server.go index 77c75d7388..ba06fbfee2 100644 --- a/pkg/command/server.go +++ b/pkg/command/server.go @@ -135,7 +135,7 @@ func Server(cfg *config.Config) cli.Command { server, err := http.Server( http.Logger(logger), http.Context(ctx), - http.Namespace(cfg.Phoenix.Namespace), + http.Namespace(cfg.HTTP.Namespace), http.Config(cfg), http.Metrics(metrics), http.Flags(flagset.RootWithConfig(cfg)), diff --git a/pkg/config/config.go b/pkg/config/config.go index 0f330f7eec..e3f050497b 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -17,8 +17,9 @@ type Debug struct { // HTTP defines the available http configuration. type HTTP struct { - Addr string - Root string + Addr string + Root string + Namespace string } // Tracing defines the available tracing configuration. @@ -37,8 +38,7 @@ type Asset struct { // Phoenix defines the available phoenic configuration. type Phoenix struct { - Path string - Namespace string + Path string } // Config combines all available configuration parts. diff --git a/pkg/flagset/flagset.go b/pkg/flagset/flagset.go index 80c93fa133..455ddd090e 100644 --- a/pkg/flagset/flagset.go +++ b/pkg/flagset/flagset.go @@ -127,6 +127,13 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { EnvVar: "PHOENIX_HTTP_ROOT", Destination: &cfg.HTTP.Root, }, + &cli.StringFlag{ + Name: "http-namespace", + Value: "com.owncloud.web", + Usage: "Set the base namespace for the http namespace", + EnvVar: "PHOENIX_NAMESPACE", + Destination: &cfg.HTTP.Namespace, + }, &cli.StringFlag{ Name: "asset-path", Value: "", @@ -141,12 +148,5 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { EnvVar: "PHOENIX_WEB_CONFIG", Destination: &cfg.Phoenix.Path, }, - &cli.StringFlag{ - Name: "http-namespace", - Value: "com.owncloud.web", - Usage: "Set the base namespace for the http namespace", - EnvVar: "PHOENIX_NAMESPACE", - Destination: &cfg.Phoenix.Namespace, - }, } }