From 69e594ace57bd36aa2c006c74a15d30f3fe3298a Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Tue, 24 Dec 2019 11:41:42 +0100 Subject: [PATCH 1/2] move namespace option under HTTP --- pkg/config/config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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. From 4155720666ab7aac0358c7b72d3b20e4b86fdfc1 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Tue, 24 Dec 2019 11:43:18 +0100 Subject: [PATCH 2/2] update refs to config.Phoenix.Namespace --- pkg/command/server.go | 2 +- pkg/flagset/flagset.go | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) 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/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, - }, } }