From 4067ae9493876f6534052fbee3ee1d78700579ae Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 16 Dec 2021 19:24:07 +0100 Subject: [PATCH] switch glauth to struct tag based env config --- accounts/pkg/command/root.go | 4 +- glauth/pkg/command/health.go | 3 +- glauth/pkg/command/root.go | 46 ++++---- glauth/pkg/command/server.go | 9 +- glauth/pkg/config/config.go | 95 +++++++++------- glauth/pkg/config/mappings.go | 167 ---------------------------- glauth/pkg/logging/logging.go | 17 +++ graph-explorer/pkg/config/config.go | 2 +- graph/pkg/config/config.go | 2 +- ocs/pkg/command/root.go | 4 +- proxy/pkg/config/config.go | 2 +- settings/pkg/config/config.go | 4 +- store/pkg/config/config.go | 2 +- thumbnails/pkg/config/config.go | 2 +- web/pkg/config/config.go | 4 +- webdav/pkg/config/config.go | 4 +- 16 files changed, 120 insertions(+), 247 deletions(-) delete mode 100644 glauth/pkg/config/mappings.go create mode 100644 glauth/pkg/logging/logging.go diff --git a/accounts/pkg/command/root.go b/accounts/pkg/command/root.go index 502ddb74a..298aa399a 100644 --- a/accounts/pkg/command/root.go +++ b/accounts/pkg/command/root.go @@ -77,12 +77,12 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error { // load all env variables relevant to the config in the current context. envCfg := config.Config{} - if err := envdecode.Decode(&envCfg); err != nil { + if err := envdecode.Decode(&envCfg); err != nil && err.Error() != "none of the target fields were set from environment variables" { return err } // merge environment variable config on top of the current config - if err := mergo.Merge(cfg, envCfg, mergo.WithOverride); err != nil && err.Error() != "none of the target fields were set from environment variables" { + if err := mergo.Merge(cfg, envCfg, mergo.WithOverride); err != nil { return err } diff --git a/glauth/pkg/command/health.go b/glauth/pkg/command/health.go index 1ee1362ec..1cd0eac23 100644 --- a/glauth/pkg/command/health.go +++ b/glauth/pkg/command/health.go @@ -5,6 +5,7 @@ import ( "net/http" "github.com/owncloud/ocis/glauth/pkg/config" + "github.com/owncloud/ocis/glauth/pkg/logging" "github.com/urfave/cli/v2" ) @@ -17,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { return ParseConfig(c, cfg) }, Action: func(c *cli.Context) error { - logger := NewLogger(cfg) + logger := logging.Configure(cfg.Service.Name, cfg.Log) resp, err := http.Get( fmt.Sprintf( diff --git a/glauth/pkg/command/root.go b/glauth/pkg/command/root.go index 77270bf41..7fdf54a1f 100644 --- a/glauth/pkg/command/root.go +++ b/glauth/pkg/command/root.go @@ -4,14 +4,13 @@ import ( "context" "os" + "github.com/imdario/mergo" "github.com/owncloud/ocis/glauth/pkg/config" ociscfg "github.com/owncloud/ocis/ocis-pkg/config" - "github.com/owncloud/ocis/ocis-pkg/log" - oclog "github.com/owncloud/ocis/ocis-pkg/log" - "github.com/owncloud/ocis/ocis-pkg/shared" "github.com/owncloud/ocis/ocis-pkg/version" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" + "github.com/wkloucek/envdecode" ) // Execute is the entry point for the ocis-glauth command. @@ -50,34 +49,37 @@ func Execute(cfg *config.Config) error { return app.Run(os.Args) } -// NewLogger initializes a service-specific logger instance. -func NewLogger(cfg *config.Config) log.Logger { - return oclog.LoggerFromConfig("glauth", *cfg.Log) -} - // ParseConfig loads glauth configuration from known paths. func ParseConfig(c *cli.Context, cfg *config.Config) error { - conf, err := ociscfg.BindSourcesToStructs("glauth", cfg) + _, err := ociscfg.BindSourcesToStructs("accounts", cfg) if err != nil { return err } // provide with defaults for shared logging, since we need a valid destination address for BindEnv. - if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil { - cfg.Log = &shared.Log{ - Level: cfg.Commons.Log.Level, - Pretty: cfg.Commons.Log.Pretty, - Color: cfg.Commons.Log.Color, - File: cfg.Commons.Log.File, - } - } else if cfg.Log == nil && cfg.Commons == nil { - cfg.Log = &shared.Log{} - } + //if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil { + // cfg.Log = &shared.Log{ + // Level: cfg.Commons.Log.Level, + // Pretty: cfg.Commons.Log.Pretty, + // Color: cfg.Commons.Log.Color, + // File: cfg.Commons.Log.File, + // } + //} else if cfg.Log == nil && cfg.Commons == nil { + // cfg.Log = &shared.Log{} + //} // load all env variables relevant to the config in the current context. - conf.LoadOSEnv(config.GetEnv(cfg), false) - bindings := config.StructMappings(cfg) - return ociscfg.BindEnv(conf, bindings) + envCfg := config.Config{} + if err := envdecode.Decode(&envCfg); err != nil && err.Error() != "none of the target fields were set from environment variables" { + return err + } + + // merge environment variable config on top of the current config + if err := mergo.Merge(cfg, envCfg, mergo.WithOverride); err != nil { + return err + } + + return nil } // SutureService allows for the glauth command to be embedded and supervised by a suture supervisor tree. diff --git a/glauth/pkg/command/server.go b/glauth/pkg/command/server.go index 6dcad7f03..e5f88b394 100644 --- a/glauth/pkg/command/server.go +++ b/glauth/pkg/command/server.go @@ -7,6 +7,7 @@ import ( "github.com/oklog/run" accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0" "github.com/owncloud/ocis/glauth/pkg/config" + "github.com/owncloud/ocis/glauth/pkg/logging" "github.com/owncloud/ocis/glauth/pkg/metrics" "github.com/owncloud/ocis/glauth/pkg/server/debug" "github.com/owncloud/ocis/glauth/pkg/server/glauth" @@ -30,9 +31,9 @@ func Server(cfg *config.Config) *cli.Command { return nil }, Action: func(c *cli.Context) error { - logger := NewLogger(cfg) - - if err := tracing.Configure(cfg); err != nil { + logger := logging.Configure(cfg.Service.Name, cfg.Log) + err := tracing.Configure(cfg) + if err != nil { return err } @@ -47,7 +48,7 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() - metrics.BuildInfo.WithLabelValues(cfg.Version).Set(1) + metrics.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1) { diff --git a/glauth/pkg/config/config.go b/glauth/pkg/config/config.go index f5dd39401..19850fdc3 100644 --- a/glauth/pkg/config/config.go +++ b/glauth/pkg/config/config.go @@ -11,69 +11,88 @@ import ( // Debug defines the available debug configuration. type Debug struct { - Addr string `ocisConfig:"addr"` - Token string `ocisConfig:"token"` - Pprof bool `ocisConfig:"pprof"` - Zpages bool `ocisConfig:"zpages"` + Addr string `ocisConfig:"addr" env:"GLAUTH_DEBUG_ADDR"` + Token string `ocisConfig:"token" env:"GLAUTH_DEBUG_TOKEN"` + Pprof bool `ocisConfig:"pprof" env:"GLAUTH_DEBUG_PPROF"` + Zpages bool `ocisConfig:"zpages" env:"GLAUTH_DEBUG_ZPAGES"` } // Service defines the available service configuration. type Service struct { - Name string `ocisConfig:"name"` - Version string `ocisConfig:"version"` + Name string + Version string } // Tracing defines the available tracing configuration. type Tracing struct { - Enabled bool `ocisConfig:"enabled"` - Type string `ocisConfig:"type"` - Endpoint string `ocisConfig:"endpoint"` - Collector string `ocisConfig:"collector"` - Service string `ocisConfig:"service"` + Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;GLAUTH_TRACING_ENABLED"` + Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;GLAUTH_TRACING_TYPE"` + Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;GLAUTH_TRACING_ENDPOINT"` + Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;GLAUTH_TRACING_COLLECTOR"` + Service string `ocisConfig:"service" env:"GLAUTH_TRACING_SERVICE"` // TODO: +} + +// Log defines the available log configuration. +type Log struct { + Level string `mapstructure:"level" env:"OCIS_LOG_LEVEL;GLAUTH_LOG_LEVEL"` + Pretty bool `mapstructure:"pretty" env:"OCIS_LOG_PRETTY;GLAUTH_LOG_PRETTY"` + Color bool `mapstructure:"color" env:"OCIS_LOG_COLOR;GLAUTH_LOG_COLOR"` + File string `mapstructure:"file" env:"OCIS_LOG_FILE;GLAUTH_LOG_FILE"` } // Ldap defined the available LDAP configuration. type Ldap struct { - Enabled bool `ocisConfig:"enabled"` - Addr string `ocisConfig:"addr"` - Namespace string `ocisConfig:"namespace"` + Enabled bool `ocisConfig:"enabled" env:"GLAUTH_LDAP_ENABLED"` + Addr string `ocisConfig:"addr" env:"GLAUTH_LDAP_ADDR"` + Namespace string } // Ldaps defined the available LDAPS configuration. type Ldaps struct { - Enabled bool `ocisConfig:"enabled"` - Addr string `ocisConfig:"addr"` - Namespace string `ocisConfig:"namespace"` - Cert string `ocisConfig:"cert"` - Key string `ocisConfig:"key"` + Enabled bool `ocisConfig:"enabled" env:"GLAUTH_LDAPS_ENABLED"` + Addr string `ocisConfig:"addr" env:"GLAUTH_LDAPS_ADDR"` + Namespace string + Cert string `ocisConfig:"cert" env:"GLAUTH_LDAPS_CERT"` + Key string `ocisConfig:"key" env:"GLAUTH_LDAPS_KEY"` } // Backend defined the available backend configuration. type Backend struct { - Datastore string `ocisConfig:"datastore"` - BaseDN string `ocisConfig:"base_dn"` - Insecure bool `ocisConfig:"insecure"` - NameFormat string `ocisConfig:"name_format"` - GroupFormat string `ocisConfig:"group_format"` - Servers []string `ocisConfig:"servers"` - SSHKeyAttr string `ocisConfig:"ssh_key_attr"` - UseGraphAPI bool `ocisConfig:"use_graph_api"` + Datastore string `ocisConfig:"datastore" env:"GLAUTH_BACKEND_DATASTORE"` + BaseDN string `ocisConfig:"base_dn" env:"GLAUTH_BACKEND_BASEDN"` + Insecure bool `ocisConfig:"insecure" env:"GLAUTH_BACKEND_INSECURE"` + NameFormat string `ocisConfig:"name_format" env:"GLAUTH_BACKEND_NAME_FORMAT"` + GroupFormat string `ocisConfig:"group_format" env:"GLAUTH_BACKEND_GROUP_FORMAT"` + Servers []string `ocisConfig:"servers"` //TODO: how to configure this via env? + SSHKeyAttr string `ocisConfig:"ssh_key_attr" env:"GLAUTH_BACKEND_SSH_KEY_ATTR"` + UseGraphAPI bool `ocisConfig:"use_graph_api" env:"GLAUTH_BACKEND_USE_GRAPHAPI"` +} + +// FallbackBackend defined the available fallback backend configuration. +type FallbackBackend struct { + Datastore string `ocisConfig:"datastore" env:"GLAUTH_FALLBACK_DATASTORE"` + BaseDN string `ocisConfig:"base_dn" env:"GLAUTH_FALLBACK_BASEDN"` + Insecure bool `ocisConfig:"insecure" env:"GLAUTH_FALLBACK_INSECURE"` + NameFormat string `ocisConfig:"name_format" env:"GLAUTH_FALLBACK_NAME_FORMAT"` + GroupFormat string `ocisConfig:"group_format" env:"GLAUTH_FALLBACK_GROUP_FORMAT"` + Servers []string `ocisConfig:"servers"` //TODO: how to configure this via env? + SSHKeyAttr string `ocisConfig:"ssh_key_attr" env:"GLAUTH_FALLBACK_SSH_KEY_ATTR"` + UseGraphAPI bool `ocisConfig:"use_graph_api" env:"GLAUTH_FALLBACK_USE_GRAPHAPI"` } // Config combines all available configuration parts. type Config struct { *shared.Commons - Log *shared.Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` - Service Service `ocisConfig:"service"` - Tracing Tracing `ocisConfig:"tracing"` - Ldap Ldap `ocisConfig:"ldap"` - Ldaps Ldaps `ocisConfig:"ldaps"` - Backend Backend `ocisConfig:"backend"` - Fallback Backend `ocisConfig:"fallback"` - Version string `ocisConfig:"version"` - RoleBundleUUID string `ocisConfig:"role_bundle_uuid"` + Log Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` + Service Service `ocisConfig:"service"` + Tracing Tracing `ocisConfig:"tracing"` + Ldap Ldap `ocisConfig:"ldap"` + Ldaps Ldaps `ocisConfig:"ldaps"` + Backend Backend `ocisConfig:"backend"` + Fallback FallbackBackend `ocisConfig:"fallback"` + RoleBundleUUID string `ocisConfig:"role_bundle_uuid" env:"GLAUTH_ROLE_BUNDLE_ID"` Context context.Context Supervised bool @@ -118,7 +137,7 @@ func DefaultConfig() *Config { SSHKeyAttr: "sshPublicKey", UseGraphAPI: true, }, - Fallback: Backend{ + Fallback: FallbackBackend{ Datastore: "", BaseDN: "dc=ocis,dc=test", Insecure: false, diff --git a/glauth/pkg/config/mappings.go b/glauth/pkg/config/mappings.go deleted file mode 100644 index 4867fc9ea..000000000 --- a/glauth/pkg/config/mappings.go +++ /dev/null @@ -1,167 +0,0 @@ -package config - -import "github.com/owncloud/ocis/ocis-pkg/shared" - -// GetEnv fetches a list of known env variables for this extension. It is to be used by gookit, as it provides a list -// with all the environment variables an extension supports. -func GetEnv(cfg *Config) []string { - var r = make([]string, len(structMappings(cfg))) - for i := range structMappings(cfg) { - r = append(r, structMappings(cfg)[i].EnvVars...) - } - - return r -} - -// StructMappings binds a set of environment variables to a destination on cfg. Iterating over this set and editing the -// Destination value of a binding will alter the original value, as it is a pointer to its memory address. This lets -// us propagate changes easier. -func StructMappings(cfg *Config) []shared.EnvBinding { - return structMappings(cfg) -} - -// structMappings binds a set of environment variables to a destination on cfg. -func structMappings(cfg *Config) []shared.EnvBinding { - return []shared.EnvBinding{ - { - EnvVars: []string{"OCIS_LOG_LEVEL", "GLAUTH_LOG_LEVEL"}, - Destination: &cfg.Log.Level, - }, - { - EnvVars: []string{"OCIS_LOG_PRETTY", "GLAUTH_LOG_PRETTY"}, - Destination: &cfg.Log.Pretty, - }, - { - EnvVars: []string{"OCIS_LOG_COLOR", "GLAUTH_LOG_COLOR"}, - Destination: &cfg.Log.Color, - }, - { - EnvVars: []string{"OCIS_LOG_FILE", "GLAUTH_LOG_FILE"}, - Destination: &cfg.Log.File, - }, - { - EnvVars: []string{"GLAUTH_CONFIG_FILE"}, - Destination: &cfg.File, - }, - { - EnvVars: []string{"OCIS_TRACING_ENABLED", "GLAUTH_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - { - EnvVars: []string{"OCIS_TRACING_TYPE", "GLAUTH_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - { - EnvVars: []string{"OCIS_TRACING_ENDPOINT", "GLAUTH_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - { - EnvVars: []string{"OCIS_TRACING_COLLECTOR", "GLAUTH_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - { - EnvVars: []string{"GLAUTH_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, - { - EnvVars: []string{"GLAUTH_DEBUG_ADDR"}, - Destination: &cfg.Debug.Addr, - }, - { - EnvVars: []string{"GLAUTH_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - { - EnvVars: []string{"GLAUTH_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - { - EnvVars: []string{"GLAUTH_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - { - EnvVars: []string{"GLAUTH_ROLE_BUNDLE_ID"}, - Destination: &cfg.RoleBundleUUID, - }, - { - EnvVars: []string{"GLAUTH_LDAP_ADDR"}, - Destination: &cfg.Ldap.Addr, - }, - { - EnvVars: []string{"GLAUTH_LDAP_ENABLED"}, - Destination: &cfg.Ldap.Enabled, - }, - { - EnvVars: []string{"GLAUTH_LDAPS_ADDR"}, - Destination: &cfg.Ldaps.Addr, - }, - { - EnvVars: []string{"GLAUTH_LDAPS_ENABLED"}, - Destination: &cfg.Ldaps.Enabled, - }, - { - EnvVars: []string{"GLAUTH_LDAPS_CERT"}, - Destination: &cfg.Ldaps.Cert, - }, - { - EnvVars: []string{"GLAUTH_LDAPS_KEY"}, - Destination: &cfg.Ldaps.Key, - }, - { - EnvVars: []string{"GLAUTH_BACKEND_BASEDN"}, - Destination: &cfg.Backend.BaseDN, - }, - { - EnvVars: []string{"GLAUTH_BACKEND_NAME_FORMAT"}, - Destination: &cfg.Backend.NameFormat, - }, - { - EnvVars: []string{"GLAUTH_BACKEND_GROUP_FORMAT"}, - Destination: &cfg.Backend.GroupFormat, - }, - { - EnvVars: []string{"GLAUTH_BACKEND_SSH_KEY_ATTR"}, - Destination: &cfg.Backend.SSHKeyAttr, - }, - { - EnvVars: []string{"GLAUTH_BACKEND_DATASTORE"}, - Destination: &cfg.Backend.Datastore, - }, - { - EnvVars: []string{"GLAUTH_BACKEND_INSECURE"}, - Destination: &cfg.Backend.Insecure, - }, - { - EnvVars: []string{"GLAUTH_BACKEND_USE_GRAPHAPI"}, - Destination: &cfg.Backend.UseGraphAPI, - }, - { - EnvVars: []string{"GLAUTH_FALLBACK_BASEDN"}, - Destination: &cfg.Fallback.BaseDN, - }, - { - EnvVars: []string{"GLAUTH_FALLBACK_NAME_FORMAT"}, - Destination: &cfg.Fallback.NameFormat, - }, - { - EnvVars: []string{"GLAUTH_FALLBACK_GROUP_FORMAT"}, - Destination: &cfg.Fallback.GroupFormat, - }, - { - EnvVars: []string{"GLAUTH_FALLBACK_SSH_KEY_ATTR"}, - Destination: &cfg.Fallback.SSHKeyAttr, - }, - { - EnvVars: []string{"GLAUTH_FALLBACK_DATASTORE"}, - Destination: &cfg.Fallback.Datastore, - }, - { - EnvVars: []string{"GLAUTH_FALLBACK_INSECURE"}, - Destination: &cfg.Fallback.Insecure, - }, - { - EnvVars: []string{"GLAUTH_FALLBACK_USE_GRAPHAPI"}, - Destination: &cfg.Fallback.UseGraphAPI, - }, - } -} diff --git a/glauth/pkg/logging/logging.go b/glauth/pkg/logging/logging.go new file mode 100644 index 000000000..2dd2f1cd4 --- /dev/null +++ b/glauth/pkg/logging/logging.go @@ -0,0 +1,17 @@ +package logging + +import ( + "github.com/owncloud/ocis/glauth/pkg/config" + "github.com/owncloud/ocis/ocis-pkg/log" +) + +// LoggerFromConfig initializes a service-specific logger instance. +func Configure(name string, cfg config.Log) log.Logger { + return log.NewLogger( + log.Name(name), + log.Level(cfg.Level), + log.Pretty(cfg.Pretty), + log.Color(cfg.Color), + log.File(cfg.File), + ) +} diff --git a/graph-explorer/pkg/config/config.go b/graph-explorer/pkg/config/config.go index 0fcacecf4..f03e4f83e 100644 --- a/graph-explorer/pkg/config/config.go +++ b/graph-explorer/pkg/config/config.go @@ -18,7 +18,7 @@ type Debug struct { type HTTP struct { Addr string `ocisConfig:"addr"` Root string `ocisConfig:"root"` - Namespace string `ocisConfig:"namespace"` + Namespace string } // Service defines the available service configuration. diff --git a/graph/pkg/config/config.go b/graph/pkg/config/config.go index 5a113d20d..d7b233f52 100644 --- a/graph/pkg/config/config.go +++ b/graph/pkg/config/config.go @@ -17,7 +17,7 @@ type Debug struct { // HTTP defines the available http configuration. type HTTP struct { Addr string `ocisConfig:"addr"` - Namespace string `ocisConfig:"namespace"` + Namespace string Root string `ocisConfig:"root"` } diff --git a/ocs/pkg/command/root.go b/ocs/pkg/command/root.go index a74c904a7..be8d34ea1 100644 --- a/ocs/pkg/command/root.go +++ b/ocs/pkg/command/root.go @@ -86,12 +86,12 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error { // load all env variables relevant to the config in the current context. envCfg := config.Config{} - if err := envdecode.Decode(&envCfg); err != nil { + if err := envdecode.Decode(&envCfg); err != nil && err.Error() != "none of the target fields were set from environment variables" { return err } // merge environment variable config on top of the current config - if err := mergo.Merge(cfg, envCfg, mergo.WithOverride); err != nil && err.Error() != "none of the target fields were set from environment variables" { + if err := mergo.Merge(cfg, envCfg, mergo.WithOverride); err != nil { return err } diff --git a/proxy/pkg/config/config.go b/proxy/pkg/config/config.go index 5193d5a65..f9f93cc02 100644 --- a/proxy/pkg/config/config.go +++ b/proxy/pkg/config/config.go @@ -28,7 +28,7 @@ type Debug struct { type HTTP struct { Addr string `ocisConfig:"addr"` Root string `ocisConfig:"root"` - Namespace string `ocisConfig:"namespace"` + Namespace string TLSCert string `ocisConfig:"tls_cert"` TLSKey string `ocisConfig:"tls_key"` TLS bool `ocisConfig:"tls"` diff --git a/settings/pkg/config/config.go b/settings/pkg/config/config.go index 4b46a8da8..d07229723 100644 --- a/settings/pkg/config/config.go +++ b/settings/pkg/config/config.go @@ -28,7 +28,7 @@ type CORS struct { // HTTP defines the available http configuration. type HTTP struct { Addr string `ocisConfig:"addr"` - Namespace string `ocisConfig:"namespace"` + Namespace string Root string `ocisConfig:"root"` CacheTTL int `ocisConfig:"cache_ttl"` CORS CORS `ocisConfig:"cors"` @@ -37,7 +37,7 @@ type HTTP struct { // GRPC defines the available grpc configuration. type GRPC struct { Addr string `ocisConfig:"addr"` - Namespace string `ocisConfig:"namespace"` + Namespace string } // Service provides configuration options for the service diff --git a/store/pkg/config/config.go b/store/pkg/config/config.go index cdb9d23be..a804e7faf 100644 --- a/store/pkg/config/config.go +++ b/store/pkg/config/config.go @@ -20,7 +20,7 @@ type Debug struct { type GRPC struct { Addr string `ocisConfig:"addr"` Root string `ocisConfig:"root"` - Namespace string `ocisConfig:"namespace"` + Namespace string } // Service defines the available service configuration. diff --git a/thumbnails/pkg/config/config.go b/thumbnails/pkg/config/config.go index 3270e2e58..16b2fa6d1 100644 --- a/thumbnails/pkg/config/config.go +++ b/thumbnails/pkg/config/config.go @@ -19,7 +19,7 @@ type Debug struct { // GRPC defines the available grpc configuration. type GRPC struct { Addr string `ocisConfig:"addr"` - Namespace string `ocisConfig:"namespace"` + Namespace string } // Service provides configuration options for the service diff --git a/web/pkg/config/config.go b/web/pkg/config/config.go index 222c93cd2..0cfd317fc 100644 --- a/web/pkg/config/config.go +++ b/web/pkg/config/config.go @@ -18,8 +18,8 @@ type Debug struct { type HTTP struct { Addr string `ocisConfig:"addr"` Root string `ocisConfig:"root"` - Namespace string `ocisConfig:"namespace"` - CacheTTL int `ocisConfig:"cache_ttl"` + Namespace string + CacheTTL int `ocisConfig:"cache_ttl"` } // Service defines the available service configuration. diff --git a/webdav/pkg/config/config.go b/webdav/pkg/config/config.go index 158ee8859..9614439d6 100644 --- a/webdav/pkg/config/config.go +++ b/webdav/pkg/config/config.go @@ -26,8 +26,8 @@ type CORS struct { type HTTP struct { Addr string `ocisConfig:"addr"` Root string `ocisConfig:"root"` - Namespace string `ocisConfig:"namespace"` - CORS CORS `ocisConfig:"cors"` + Namespace string + CORS CORS `ocisConfig:"cors"` } // Service defines the available service configuration.