From 3206b9835965b9025a1ad360445a993cd73f72f5 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 5 Nov 2021 16:20:00 +0100 Subject: [PATCH] attempt to fix flags --- ocis/pkg/command/webdav.go | 2 - proxy/pkg/config/mappings.go | 2 +- store/pkg/command/server.go | 2 - store/pkg/flagset/flagset.go | 107 ------------------- web/pkg/flagset/flagset.go | 194 ---------------------------------- webdav/pkg/command/server.go | 2 - webdav/pkg/flagset/flagset.go | 167 ----------------------------- 7 files changed, 1 insertion(+), 475 deletions(-) diff --git a/ocis/pkg/command/webdav.go b/ocis/pkg/command/webdav.go index b84453a516..22e58e944a 100644 --- a/ocis/pkg/command/webdav.go +++ b/ocis/pkg/command/webdav.go @@ -9,7 +9,6 @@ import ( "github.com/owncloud/ocis/ocis/pkg/register" "github.com/owncloud/ocis/webdav/pkg/command" svcconfig "github.com/owncloud/ocis/webdav/pkg/config" - "github.com/owncloud/ocis/webdav/pkg/flagset" "github.com/urfave/cli/v2" ) @@ -19,7 +18,6 @@ func WebDAVCommand(cfg *config.Config) *cli.Command { Name: "webdav", Usage: "Start webdav server", Category: "Extensions", - Flags: flagset.ServerWithConfig(cfg.WebDAV), Subcommands: []*cli.Command{ command.PrintVersion(cfg.WebDAV), }, diff --git a/proxy/pkg/config/mappings.go b/proxy/pkg/config/mappings.go index c09936d542..d5ed4bb3d8 100644 --- a/proxy/pkg/config/mappings.go +++ b/proxy/pkg/config/mappings.go @@ -123,7 +123,7 @@ func structMappings(cfg *Config) []mapping { Destination: &cfg.InsecureBackends, }, { - EnvVars: []string{"PROXY_OIDC_ISSUER"}, + EnvVars: []string{"PROXY_OIDC_ISSUER", "OCIS_URL"}, Destination: &cfg.OIDC.Issuer, }, { diff --git a/store/pkg/command/server.go b/store/pkg/command/server.go index 311ceb4535..1a25eafd36 100644 --- a/store/pkg/command/server.go +++ b/store/pkg/command/server.go @@ -9,7 +9,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/store/pkg/config" - "github.com/owncloud/ocis/store/pkg/flagset" "github.com/owncloud/ocis/store/pkg/metrics" "github.com/owncloud/ocis/store/pkg/server/debug" "github.com/owncloud/ocis/store/pkg/server/grpc" @@ -21,7 +20,6 @@ func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", Usage: "Start integrated server", - Flags: flagset.ServerWithConfig(cfg), Before: func(ctx *cli.Context) error { if err := ParseConfig(ctx, cfg); err != nil { diff --git a/store/pkg/flagset/flagset.go b/store/pkg/flagset/flagset.go index 1f9e5e7cd8..a2085be67d 100644 --- a/store/pkg/flagset/flagset.go +++ b/store/pkg/flagset/flagset.go @@ -1,9 +1,6 @@ package flagset import ( - "path" - - "github.com/owncloud/ocis/ocis-pkg/config/defaults" "github.com/owncloud/ocis/ocis-pkg/flags" "github.com/owncloud/ocis/store/pkg/config" "github.com/urfave/cli/v2" @@ -22,110 +19,6 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { } } -// ServerWithConfig applies cfg to the root flagset -func ServerWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - &cli.StringFlag{ - Name: "log-file", - Usage: "Enable log to file", - EnvVars: []string{"STORE_LOG_FILE", "OCIS_LOG_FILE"}, - Destination: &cfg.Log.File, - }, - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"STORE_TRACING_ENABLED", "OCIS_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: flags.OverrideDefaultString(cfg.Tracing.Type, "jaeger"), - Usage: "Tracing backend type", - EnvVars: []string{"STORE_TRACING_TYPE", "OCIS_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: flags.OverrideDefaultString(cfg.Tracing.Endpoint, ""), - Usage: "Endpoint for the agent", - EnvVars: []string{"STORE_TRACING_ENDPOINT", "OCIS_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: flags.OverrideDefaultString(cfg.Tracing.Collector, ""), - Usage: "Endpoint for the collector", - EnvVars: []string{"STORE_TRACING_COLLECTOR", "OCIS_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: flags.OverrideDefaultString(cfg.Tracing.Service, "store"), - Usage: "Service name for tracing", - EnvVars: []string{"STORE_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, - &cli.StringFlag{ - Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9464"), - Usage: "Address to bind debug server", - EnvVars: []string{"STORE_DEBUG_ADDR"}, - Destination: &cfg.Debug.Addr, - }, - &cli.StringFlag{ - Name: "debug-token", - Value: flags.OverrideDefaultString(cfg.Debug.Token, ""), - Usage: "Token to grant metrics access", - EnvVars: []string{"STORE_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"STORE_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"STORE_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - &cli.StringFlag{ - Name: "grpc-namespace", - Value: flags.OverrideDefaultString(cfg.Service.Namespace, "com.owncloud.api"), - Usage: "Set the base namespace for the grpc namespace", - EnvVars: []string{"STORE_GRPC_NAMESPACE"}, - Destination: &cfg.Service.Namespace, - }, - &cli.StringFlag{ - Name: "grpc-addr", - Value: flags.OverrideDefaultString(cfg.GRPC.Addr, "127.0.0.1:9460"), - Usage: "Address to bind grpc server", - EnvVars: []string{"STORE_GRPC_ADDR"}, - Destination: &cfg.GRPC.Addr, - }, - &cli.StringFlag{ - Name: "name", - Value: flags.OverrideDefaultString(cfg.Service.Name, "store"), - Usage: "Service name", - EnvVars: []string{"STORE_NAME"}, - Destination: &cfg.Service.Name, - }, - &cli.StringFlag{ - Name: "data-path", - Value: flags.OverrideDefaultString(cfg.Datapath, path.Join(defaults.BaseDataPath(), "store")), - Usage: "location of the store data path", - EnvVars: []string{"STORE_DATA_PATH"}, - Destination: &cfg.Datapath, - }, - &cli.StringFlag{ - Name: "extensions", - Usage: "Run specific extensions during supervised mode. This flag is set by the runtime", - }, - } -} - // ListStoreWithConfig applies the config to the list commands flags. func ListStoreWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{&cli.StringFlag{ diff --git a/web/pkg/flagset/flagset.go b/web/pkg/flagset/flagset.go index 2b3d77d1a8..f389805ae2 100644 --- a/web/pkg/flagset/flagset.go +++ b/web/pkg/flagset/flagset.go @@ -42,197 +42,3 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { }, } } - -// ServerWithConfig applies cfg to the root flagset -func ServerWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - &cli.StringFlag{ - Name: "log-file", - Usage: "Enable log to file", - EnvVars: []string{"WEB_LOG_FILE", "OCIS_LOG_FILE"}, - Destination: &cfg.Log.File, - }, - &cli.StringFlag{ - Name: "config-file", - Value: "", - Usage: "Path to config file", - EnvVars: []string{"WEB_CONFIG_FILE"}, - Destination: &cfg.File, - }, - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"WEB_TRACING_ENABLED", "OCIS_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: flags.OverrideDefaultString(cfg.Tracing.Type, "jaeger"), - Usage: "Tracing backend type", - EnvVars: []string{"WEB_TRACING_TYPE", "OCIS_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: flags.OverrideDefaultString(cfg.Tracing.Endpoint, ""), - Usage: "Endpoint for the agent", - EnvVars: []string{"WEB_TRACING_ENDPOINT", "OCIS_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: flags.OverrideDefaultString(cfg.Tracing.Collector, ""), - Usage: "Endpoint for the collector", - EnvVars: []string{"WEB_TRACING_COLLECTOR", "OCIS_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: flags.OverrideDefaultString(cfg.Tracing.Service, "web"), - Usage: "Service name for tracing", - EnvVars: []string{"WEB_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, - &cli.StringFlag{ - Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9104"), - Usage: "Address to bind debug server", - EnvVars: []string{"WEB_DEBUG_ADDR"}, - Destination: &cfg.Debug.Addr, - }, - &cli.StringFlag{ - Name: "debug-token", - Value: flags.OverrideDefaultString(cfg.Debug.Token, ""), - Usage: "Token to grant metrics access", - EnvVars: []string{"WEB_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"WEB_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"WEB_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - &cli.StringFlag{ - Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "127.0.0.1:9100"), - Usage: "Address to bind http server", - EnvVars: []string{"WEB_HTTP_ADDR"}, - Destination: &cfg.HTTP.Addr, - }, - &cli.StringFlag{ - Name: "http-root", - Value: flags.OverrideDefaultString(cfg.HTTP.Root, "/"), - Usage: "Root path of http server", - EnvVars: []string{"WEB_HTTP_ROOT"}, - Destination: &cfg.HTTP.Root, - }, - &cli.StringFlag{ - Name: "http-namespace", - Value: flags.OverrideDefaultString(cfg.HTTP.Namespace, "com.owncloud.web"), - Usage: "Set the base namespace for the http namespace", - EnvVars: []string{"WEB_NAMESPACE"}, - Destination: &cfg.HTTP.Namespace, - }, - &cli.IntFlag{ - Name: "http-cache-ttl", - Value: flags.OverrideDefaultInt(cfg.HTTP.CacheTTL, 604800), // 7 days - Usage: "Set the static assets caching duration in seconds", - EnvVars: []string{"WEB_CACHE_TTL"}, - Destination: &cfg.HTTP.CacheTTL, - }, - &cli.StringFlag{ - Name: "asset-path", - Value: flags.OverrideDefaultString(cfg.Asset.Path, ""), - Usage: "Path to custom assets", - EnvVars: []string{"WEB_ASSET_PATH"}, - Destination: &cfg.Asset.Path, - }, - &cli.StringFlag{ - Name: "web-config", - Value: flags.OverrideDefaultString(cfg.Web.Path, ""), - Usage: "Path to web config", - EnvVars: []string{"WEB_UI_CONFIG"}, - Destination: &cfg.Web.Path, - }, - &cli.StringFlag{ - Name: "web-config-server", - Value: flags.OverrideDefaultString(cfg.Web.Config.Server, "https://localhost:9200"), - Usage: "Configuration server URL", - EnvVars: []string{"WEB_UI_CONFIG_SERVER", "OCIS_URL"}, // WEB_UI_CONFIG_SERVER takes precedence over OCIS_URL - Destination: &cfg.Web.Config.Server, - }, - &cli.StringFlag{ - Name: "web-theme-server", - 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.ThemeServer, - }, - &cli.StringFlag{ - Name: "web-config-theme", - 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.ThemePath, - }, - &cli.StringFlag{ - Name: "web-config-version", - Value: flags.OverrideDefaultString(cfg.Web.Config.Version, "0.1.0"), - Usage: "Version", - EnvVars: []string{"WEB_UI_CONFIG_VERSION"}, - Destination: &cfg.Web.Config.Version, - }, - &cli.StringSliceFlag{ - Name: "web-config-app", - Value: cli.NewStringSlice("files", "search", "media-viewer", "external"), - Usage: `--web-config-app files [--web-config-app draw-io]`, - EnvVars: []string{"WEB_UI_CONFIG_APPS"}, - }, - &cli.StringFlag{ - Name: "oidc-metadata-url", - Value: flags.OverrideDefaultString(cfg.Web.Config.OpenIDConnect.MetadataURL, ""), - Usage: "OpenID Connect metadata URL, defaults to /.well-known/openid-configuration", - EnvVars: []string{"WEB_OIDC_METADATA_URL"}, - Destination: &cfg.Web.Config.OpenIDConnect.MetadataURL, - }, - &cli.StringFlag{ - Name: "oidc-authority", - Value: flags.OverrideDefaultString(cfg.Web.Config.OpenIDConnect.Authority, "https://localhost:9200"), - Usage: "OpenID Connect authority", // TODO rename to Issuer - EnvVars: []string{"WEB_OIDC_AUTHORITY", "OCIS_URL"}, // WEB_OIDC_AUTHORITY takes precedence over OCIS_URL - Destination: &cfg.Web.Config.OpenIDConnect.Authority, - }, - &cli.StringFlag{ - Name: "oidc-client-id", - Value: flags.OverrideDefaultString(cfg.Web.Config.OpenIDConnect.ClientID, "web"), - Usage: "OpenID Connect client ID", - EnvVars: []string{"WEB_OIDC_CLIENT_ID"}, - Destination: &cfg.Web.Config.OpenIDConnect.ClientID, - }, - &cli.StringFlag{ - Name: "oidc-response-type", - Value: flags.OverrideDefaultString(cfg.Web.Config.OpenIDConnect.ResponseType, "code"), - Usage: "OpenID Connect response type", - EnvVars: []string{"WEB_OIDC_RESPONSE_TYPE"}, - Destination: &cfg.Web.Config.OpenIDConnect.ResponseType, - }, - &cli.StringFlag{ - Name: "oidc-scope", - Value: flags.OverrideDefaultString(cfg.Web.Config.OpenIDConnect.Scope, "openid profile email"), - Usage: "OpenID Connect scope", - EnvVars: []string{"WEB_OIDC_SCOPE"}, - Destination: &cfg.Web.Config.OpenIDConnect.Scope, - }, - &cli.StringFlag{ - Name: "extensions", - Usage: "Run specific extensions during supervised mode. This flag is set by the runtime", - }, - } -} diff --git a/webdav/pkg/command/server.go b/webdav/pkg/command/server.go index c3dc2ea74d..fdcbbb9931 100644 --- a/webdav/pkg/command/server.go +++ b/webdav/pkg/command/server.go @@ -7,7 +7,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/ocis-pkg/sync" "github.com/owncloud/ocis/webdav/pkg/config" - "github.com/owncloud/ocis/webdav/pkg/flagset" "github.com/owncloud/ocis/webdav/pkg/metrics" "github.com/owncloud/ocis/webdav/pkg/server/debug" "github.com/owncloud/ocis/webdav/pkg/server/http" @@ -20,7 +19,6 @@ func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", Usage: "Start integrated server", - Flags: flagset.ServerWithConfig(cfg), Before: func(ctx *cli.Context) error { if cfg.HTTP.Root != "/" { cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/") diff --git a/webdav/pkg/flagset/flagset.go b/webdav/pkg/flagset/flagset.go index 7df00873cd..87fc458249 100644 --- a/webdav/pkg/flagset/flagset.go +++ b/webdav/pkg/flagset/flagset.go @@ -19,173 +19,6 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { } } -// ServerWithConfig applies cfg to the root flagset -func ServerWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - &cli.StringFlag{ - Name: "log-file", - Usage: "Enable log to file", - EnvVars: []string{"WEBDAV_LOG_FILE", "OCIS_LOG_FILE"}, - Destination: &cfg.Log.File, - }, - &cli.StringFlag{ - Name: "log-level", - Usage: "Set logging level", - EnvVars: []string{"WEBDAV_LOG_LEVEL", "OCIS_LOG_LEVEL"}, - Destination: &cfg.Log.Level, - }, - &cli.BoolFlag{ - Name: "log-pretty", - Usage: "Enable pretty logging", - EnvVars: []string{"WEBDAV_LOG_PRETTY", "OCIS_LOG_PRETTY"}, - Destination: &cfg.Log.Pretty, - }, - &cli.BoolFlag{ - Name: "log-color", - Usage: "Enable colored logging", - EnvVars: []string{"WEBDAV_LOG_COLOR", "OCIS_LOG_COLOR"}, - Destination: &cfg.Log.Color, - }, - &cli.StringFlag{ - Name: "config-file", - Value: "", - Usage: "Path to config file", - EnvVars: []string{"WEBDAV_CONFIG_FILE"}, - Destination: &cfg.File, - }, - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"WEBDAV_TRACING_ENABLED", "OCIS_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: flags.OverrideDefaultString(cfg.Tracing.Type, "jaeger"), - Usage: "Tracing backend type", - EnvVars: []string{"WEBDAV_TRACING_TYPE", "OCIS_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: flags.OverrideDefaultString(cfg.Tracing.Endpoint, ""), - Usage: "Endpoint for the agent", - EnvVars: []string{"WEBDAV_TRACING_ENDPOINT", "OCIS_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: flags.OverrideDefaultString(cfg.Tracing.Collector, ""), - Usage: "Endpoint for the collector", - EnvVars: []string{"WEBDAV_TRACING_COLLECTOR", "OCIS_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: flags.OverrideDefaultString(cfg.Tracing.Service, "webdav"), - Usage: "Service name for tracing", - EnvVars: []string{"WEBDAV_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, - &cli.StringFlag{ - Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9119"), - Usage: "Address to bind debug server", - EnvVars: []string{"WEBDAV_DEBUG_ADDR"}, - Destination: &cfg.Debug.Addr, - }, - &cli.StringFlag{ - Name: "debug-token", - Value: flags.OverrideDefaultString(cfg.Debug.Token, ""), - Usage: "Token to grant metrics access", - EnvVars: []string{"WEBDAV_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"WEBDAV_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"WEBDAV_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - &cli.StringFlag{ - Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "127.0.0.1:9115"), - Usage: "Address to bind http server", - EnvVars: []string{"WEBDAV_HTTP_ADDR"}, - Destination: &cfg.HTTP.Addr, - }, - &cli.StringFlag{ - Name: "http-namespace", - Value: flags.OverrideDefaultString(cfg.Service.Namespace, "com.owncloud.web"), - Usage: "Set the base namespace for service discovery", - EnvVars: []string{"WEBDAV_HTTP_NAMESPACE"}, - Destination: &cfg.Service.Namespace, - }, - &cli.StringSliceFlag{ - Name: "cors-allowed-origins", - Value: cli.NewStringSlice("*"), - Usage: "Set the allowed CORS origins", - EnvVars: []string{"WEBDAV_CORS_ALLOW_ORIGINS", "OCIS_CORS_ALLOW_ORIGINS"}, - }, - &cli.StringSliceFlag{ - Name: "cors-allowed-methods", - Value: cli.NewStringSlice("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"), - Usage: "Set the allowed CORS origins", - EnvVars: []string{"WEBDAV_CORS_ALLOW_METHODS", "OCIS_CORS_ALLOW_METHODS"}, - }, - &cli.StringSliceFlag{ - Name: "cors-allowed-headers", - Value: cli.NewStringSlice("Authorization", "Origin", "Content-Type", "Accept", "X-Requested-With"), - Usage: "Set the allowed CORS origins", - EnvVars: []string{"WEBDAV_CORS_ALLOW_HEADERS", "OCIS_CORS_ALLOW_HEADERS"}, - }, - &cli.BoolFlag{ - Name: "cors-allow-credentials", - Value: flags.OverrideDefaultBool(cfg.HTTP.CORS.AllowCredentials, true), - Usage: "Allow credentials for CORS", - EnvVars: []string{"WEBDAV_CORS_ALLOW_CREDENTIALS", "OCIS_CORS_ALLOW_CREDENTIALS"}, - }, - &cli.StringFlag{ - Name: "service-name", - Value: flags.OverrideDefaultString(cfg.Service.Name, "webdav"), - Usage: "Service name", - EnvVars: []string{"WEBDAV_SERVICE_NAME"}, - Destination: &cfg.Service.Name, - }, - &cli.StringFlag{ - Name: "http-root", - Value: flags.OverrideDefaultString(cfg.HTTP.Root, "/"), - Usage: "Root path of http server", - EnvVars: []string{"WEBDAV_HTTP_ROOT"}, - Destination: &cfg.HTTP.Root, - }, - &cli.StringFlag{ - Name: "ocis-public-url", - Value: flags.OverrideDefaultString(cfg.OcisPublicURL, "https://127.0.0.1:9200"), - Usage: "The domain under which oCIS is reachable", - EnvVars: []string{"OCIS_PUBLIC_URL", "OCIS_URL"}, - Destination: &cfg.OcisPublicURL, - }, - &cli.StringFlag{ - Name: "webdav-namespace", - Value: flags.OverrideDefaultString(cfg.WebdavNamespace, "/home"), - Usage: "Namespace prefix for the /webdav endpoint", - EnvVars: []string{"STORAGE_WEBDAV_NAMESPACE"}, - Destination: &cfg.WebdavNamespace, - }, - &cli.StringFlag{ - Name: "extensions", - Usage: "Run specific extensions during supervised mode. This flag is set by the runtime", - }, - } -} - // ListWebdavWithConfig applies the config to the list commands flagset. func ListWebdavWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{