From 9f2831634de4f88be7b37104b7250f2a870bc2c3 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 14 Oct 2021 17:01:43 +0200 Subject: [PATCH] fix invalid `json:"omit"` added in owncloud/ocis#2437 --- web/pkg/config/config.go | 8 ++++---- web/pkg/flagset/flagset.go | 8 ++++---- web/pkg/service/v0/service.go | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/web/pkg/config/config.go b/web/pkg/config/config.go index 76a1c085a5..64a03838bd 100644 --- a/web/pkg/config/config.go +++ b/web/pkg/config/config.go @@ -43,8 +43,6 @@ type Asset struct { // WebConfig defines the available web configuration for a dynamically rendered config.json. type WebConfig struct { Server string `json:"server,omitempty"` - ThemeServer string `json:"omit"` // only used to build Theme - ThemePath string `json:"omit"` // only used to build Theme Theme string `json:"theme,omitempty"` Version string `json:"version,omitempty"` // TODO what is version used for? OpenIDConnect OIDC `json:"openIdConnect,omitempty"` @@ -84,8 +82,10 @@ type ExternalAppConfig struct { // Web defines the available web configuration. type Web struct { - Path string - Config WebConfig + Path string + ThemeServer string // used to build Theme in WebConfig + ThemePath string // used to build Theme in WebConfig + Config WebConfig } // Config combines all available configuration parts. diff --git a/web/pkg/flagset/flagset.go b/web/pkg/flagset/flagset.go index f75ce92138..2b3d77d1a8 100644 --- a/web/pkg/flagset/flagset.go +++ b/web/pkg/flagset/flagset.go @@ -170,17 +170,17 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "web-theme-server", - Value: flags.OverrideDefaultString(cfg.Web.Config.ThemeServer, "https://localhost:9200"), + Value: flags.OverrideDefaultString(cfg.Web.ThemeServer, "https://localhost:9200"), Usage: "Theme server URL", EnvVars: []string{"WEB_UI_THEME_SERVER", "OCIS_URL"}, // WEB_UI_THEME_SERVER takes precedence over OCIS_URL - Destination: &cfg.Web.Config.ThemeServer, + Destination: &cfg.Web.ThemeServer, }, &cli.StringFlag{ Name: "web-config-theme", - Value: flags.OverrideDefaultString(cfg.Web.Config.ThemePath, "/themes/owncloud/theme.json"), + Value: flags.OverrideDefaultString(cfg.Web.ThemePath, "/themes/owncloud/theme.json"), Usage: "Theme path on the theme server", EnvVars: []string{"WEB_UI_THEME_PATH"}, - Destination: &cfg.Web.Config.ThemePath, + Destination: &cfg.Web.ThemePath, }, &cli.StringFlag{ Name: "web-config-version", diff --git a/web/pkg/service/v0/service.go b/web/pkg/service/v0/service.go index 7a8a32e530..49b78d1445 100644 --- a/web/pkg/service/v0/service.go +++ b/web/pkg/service/v0/service.go @@ -71,10 +71,10 @@ func (p Web) getPayload() (payload []byte, err error) { } // build theme url - if themeServer, err := url.Parse(p.config.Web.Config.ThemeServer); err == nil { - p.config.Web.Config.Theme = themeServer.String() + p.config.Web.Config.ThemePath + if themeServer, err := url.Parse(p.config.Web.ThemeServer); err == nil { + p.config.Web.Config.Theme = themeServer.String() + p.config.Web.ThemePath } else { - p.config.Web.Config.Theme = p.config.Web.Config.ThemePath + p.config.Web.Config.Theme = p.config.Web.ThemePath } if p.config.Web.Config.ExternalApps == nil {