add onlyoffice to new config scheme

This commit is contained in:
A.Unger
2021-03-12 16:54:41 +01:00
parent e132be0db6
commit df3d563aac

View File

@@ -2,6 +2,7 @@ package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/onlyoffice/pkg/config"
)
@@ -41,7 +42,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "debug-addr",
Value: "0.0.0.0:9224",
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9224"),
Usage: "Address to debug endpoint",
EnvVars: []string{"ONLYOFFICE_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
@@ -60,42 +61,42 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "tracing-type",
Value: "jaeger",
Value: flags.OverrideDefaultString(cfg.Tracing.Type, "jaeger"),
Usage: "Tracing backend type",
EnvVars: []string{"ONLYOFFICE_TRACING_TYPE"},
Destination: &cfg.Tracing.Type,
},
&cli.StringFlag{
Name: "tracing-endpoint",
Value: "",
Value: flags.OverrideDefaultString(cfg.Tracing.Endpoint, ""),
Usage: "Endpoint for the agent",
EnvVars: []string{"ONLYOFFICE_TRACING_ENDPOINT"},
Destination: &cfg.Tracing.Endpoint,
},
&cli.StringFlag{
Name: "tracing-collector",
Value: "",
Value: flags.OverrideDefaultString(cfg.Tracing.Collector, ""),
Usage: "Endpoint for the collector",
EnvVars: []string{"ONLYOFFICE_TRACING_COLLECTOR"},
Destination: &cfg.Tracing.Collector,
},
&cli.StringFlag{
Name: "tracing-service",
Value: "onlyoffice",
Value: flags.OverrideDefaultString(cfg.Tracing.Service, "onlyoffice"),
Usage: "Service name for tracing",
EnvVars: []string{"ONLYOFFICE_TRACING_SERVICE"},
Destination: &cfg.Tracing.Service,
},
&cli.StringFlag{
Name: "debug-addr",
Value: "0.0.0.0:9224",
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9224"),
Usage: "Address to bind debug server",
EnvVars: []string{"ONLYOFFICE_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
},
&cli.StringFlag{
Name: "debug-token",
Value: "",
Value: flags.OverrideDefaultString(cfg.Debug.Token, ""),
Usage: "Token to grant metrics access",
EnvVars: []string{"ONLYOFFICE_DEBUG_TOKEN"},
Destination: &cfg.Debug.Token,
@@ -114,35 +115,35 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "http-addr",
Value: "0.0.0.0:9220",
Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "0.0.0.0:9220"),
Usage: "Address to bind http server",
EnvVars: []string{"ONLYOFFICE_HTTP_ADDR"},
Destination: &cfg.HTTP.Addr,
},
&cli.StringFlag{
Name: "http-namespace",
Value: "com.owncloud.web",
Value: flags.OverrideDefaultString(cfg.HTTP.Namespace, "com.owncloud.web"),
Usage: "Set the base namespace for the http namespace",
EnvVars: []string{"ONLYOFFICE_HTTP_NAMESPACE"},
Destination: &cfg.HTTP.Namespace,
},
&cli.StringFlag{
Name: "http-root",
Value: "/",
Value: flags.OverrideDefaultString(cfg.HTTP.Root, "/"),
Usage: "Root path of http server",
EnvVars: []string{"ONLYOFFICE_HTTP_ROOT"},
Destination: &cfg.HTTP.Root,
},
&cli.IntFlag{
Name: "http-cache-ttl",
Value: 604800, // 7 days
Value: flags.OverrideDefaultInt(cfg.HTTP.CacheTTL, 604800), // 7 days
Usage: "Set the static assets caching duration in seconds",
EnvVars: []string{"ONLYOFFICE_CACHE_TTL"},
Destination: &cfg.HTTP.CacheTTL,
},
&cli.StringFlag{
Name: "asset-path",
Value: "",
Value: flags.OverrideDefaultString(cfg.Asset.Path, ""),
Usage: "Path to custom assets",
EnvVars: []string{"ONLYOFFICE_ASSET_PATH"},
Destination: &cfg.Asset.Path,