removed all flagset packages
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncloud/ocis/glauth/pkg/config"
|
"github.com/owncloud/ocis/glauth/pkg/config"
|
||||||
"github.com/owncloud/ocis/glauth/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +13,9 @@ func Health(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "health",
|
Name: "health",
|
||||||
Usage: "Check health status",
|
Usage: "Check health status",
|
||||||
Flags: flagset.HealthWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
logger := NewLogger(cfg)
|
logger := NewLogger(cfg)
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package flagset
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/owncloud/ocis/glauth/pkg/config"
|
|
||||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HealthWithConfig applies cfg to the root flagset
|
|
||||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "debug-addr",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9129"),
|
|
||||||
Usage: "Address to debug endpoint",
|
|
||||||
EnvVars: []string{"GLAUTH_DEBUG_ADDR"},
|
|
||||||
Destination: &cfg.Debug.Addr,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncloud/ocis/graph-explorer/pkg/config"
|
"github.com/owncloud/ocis/graph-explorer/pkg/config"
|
||||||
"github.com/owncloud/ocis/graph-explorer/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +13,9 @@ func Health(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "health",
|
Name: "health",
|
||||||
Usage: "Check health status",
|
Usage: "Check health status",
|
||||||
Flags: flagset.HealthWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
logger := NewLogger(cfg)
|
logger := NewLogger(cfg)
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package flagset
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/owncloud/ocis/graph-explorer/pkg/config"
|
|
||||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HealthWithConfig applies cfg to the root flagset
|
|
||||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "debug-addr",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9136"),
|
|
||||||
Usage: "Address to debug endpoint",
|
|
||||||
EnvVars: []string{"GRAPH_EXPLORER_DEBUG_ADDR"},
|
|
||||||
Destination: &cfg.Debug.Addr,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncloud/ocis/graph/pkg/config"
|
"github.com/owncloud/ocis/graph/pkg/config"
|
||||||
"github.com/owncloud/ocis/graph/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +13,9 @@ func Health(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "health",
|
Name: "health",
|
||||||
Usage: "Check health status",
|
Usage: "Check health status",
|
||||||
Flags: flagset.HealthWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
logger := NewLogger(cfg)
|
logger := NewLogger(cfg)
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package flagset
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/owncloud/ocis/graph/pkg/config"
|
|
||||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HealthWithConfig applies cfg to the root flagset
|
|
||||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "debug-addr",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9124"),
|
|
||||||
Usage: "Address to debug endpoint",
|
|
||||||
EnvVars: []string{"GRAPH_DEBUG_ADDR"},
|
|
||||||
Destination: &cfg.Debug.Addr,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncloud/ocis/idp/pkg/config"
|
"github.com/owncloud/ocis/idp/pkg/config"
|
||||||
"github.com/owncloud/ocis/idp/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +13,9 @@ func Health(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "health",
|
Name: "health",
|
||||||
Usage: "Check health status",
|
Usage: "Check health status",
|
||||||
Flags: flagset.HealthWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
logger := NewLogger(cfg)
|
logger := NewLogger(cfg)
|
||||||
|
|
||||||
|
|||||||
@@ -20,26 +20,14 @@ func Server(cfg *config.Config) *cli.Command {
|
|||||||
Name: "server",
|
Name: "server",
|
||||||
Usage: "Start integrated server",
|
Usage: "Start integrated server",
|
||||||
Before: func(ctx *cli.Context) error {
|
Before: func(ctx *cli.Context) error {
|
||||||
if cfg.HTTP.Root != "/" {
|
|
||||||
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
|
|
||||||
}
|
|
||||||
|
|
||||||
//if len(ctx.StringSlice("trusted-proxy")) > 0 {
|
|
||||||
// cfg.IDP.TrustedProxy = ctx.StringSlice("trusted-proxy")
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//if len(ctx.StringSlice("allow-scope")) > 0 {
|
|
||||||
// cfg.IDP.AllowScope = ctx.StringSlice("allow-scope")
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//if len(ctx.StringSlice("signing-private-key")) > 0 {
|
|
||||||
// cfg.IDP.SigningPrivateKeyFiles = ctx.StringSlice("signing-private-key")
|
|
||||||
//}
|
|
||||||
|
|
||||||
if err := ParseConfig(ctx, cfg); err != nil {
|
if err := ParseConfig(ctx, cfg); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cfg.HTTP.Root != "/" {
|
||||||
|
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
tw "github.com/olekukonko/tablewriter"
|
tw "github.com/olekukonko/tablewriter"
|
||||||
"github.com/owncloud/ocis/idp/pkg/config"
|
"github.com/owncloud/ocis/idp/pkg/config"
|
||||||
"github.com/owncloud/ocis/idp/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -17,7 +16,9 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "version",
|
Name: "version",
|
||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListIDPWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
package flagset
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/owncloud/ocis/idp/pkg/config"
|
|
||||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HealthWithConfig applies cfg to the root flagset
|
|
||||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "debug-addr",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9134"),
|
|
||||||
Usage: "Address to debug endpoint",
|
|
||||||
EnvVars: []string{"IDP_DEBUG_ADDR"},
|
|
||||||
Destination: &cfg.Debug.Addr,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListIDPWithConfig applies the config to the list commands flags
|
|
||||||
func ListIDPWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{&cli.StringFlag{
|
|
||||||
Name: "http-namespace",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Service.Namespace, "com.owncloud.web"),
|
|
||||||
Usage: "Set the base namespace for service discovery",
|
|
||||||
EnvVars: []string{"IDP_HTTP_NAMESPACE"},
|
|
||||||
Destination: &cfg.Service.Namespace,
|
|
||||||
},
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "name",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Service.Name, "idp"),
|
|
||||||
Usage: "Service name",
|
|
||||||
EnvVars: []string{"IDP_NAME"},
|
|
||||||
Destination: &cfg.Service.Name,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncloud/ocis/ocs/pkg/config"
|
"github.com/owncloud/ocis/ocs/pkg/config"
|
||||||
"github.com/owncloud/ocis/ocs/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +13,9 @@ func Health(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "health",
|
Name: "health",
|
||||||
Usage: "Check health status",
|
Usage: "Check health status",
|
||||||
Flags: flagset.HealthWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
logger := NewLogger(cfg)
|
logger := NewLogger(cfg)
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
tw "github.com/olekukonko/tablewriter"
|
tw "github.com/olekukonko/tablewriter"
|
||||||
"github.com/owncloud/ocis/ocs/pkg/config"
|
"github.com/owncloud/ocis/ocs/pkg/config"
|
||||||
"github.com/owncloud/ocis/ocs/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -17,7 +16,9 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "version",
|
Name: "version",
|
||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListOcsWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
package flagset
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
|
||||||
"github.com/owncloud/ocis/ocs/pkg/config"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HealthWithConfig applies cfg to the root flagset
|
|
||||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "debug-addr",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9114"),
|
|
||||||
Usage: "Address to debug endpoint",
|
|
||||||
EnvVars: []string{"OCS_DEBUG_ADDR"},
|
|
||||||
Destination: &cfg.Debug.Addr,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListOcsWithConfig applies the config to the list commands flagset.
|
|
||||||
func ListOcsWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "http-namespace",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Service.Namespace, "com.owncloud.web"),
|
|
||||||
Usage: "Set the base namespace for the http namespace",
|
|
||||||
EnvVars: []string{"OCS_NAMESPACE"},
|
|
||||||
Destination: &cfg.Service.Namespace,
|
|
||||||
},
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "name",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Service.Name, "ocs"),
|
|
||||||
Usage: "Service name",
|
|
||||||
EnvVars: []string{"OCS_NAME"},
|
|
||||||
Destination: &cfg.Service.Name,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
tw "github.com/olekukonko/tablewriter"
|
tw "github.com/olekukonko/tablewriter"
|
||||||
"github.com/owncloud/ocis/proxy/pkg/config"
|
"github.com/owncloud/ocis/proxy/pkg/config"
|
||||||
"github.com/owncloud/ocis/proxy/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -17,7 +16,9 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "version",
|
Name: "version",
|
||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListProxyWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
package flagset
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
|
||||||
"github.com/owncloud/ocis/proxy/pkg/config"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ListProxyWithConfig applies the config to the list commands flags.
|
|
||||||
func ListProxyWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "service-namespace",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.OIDC.Issuer, "com.owncloud.web"),
|
|
||||||
Usage: "Set the base namespace for the service namespace",
|
|
||||||
EnvVars: []string{"PROXY_SERVICE_NAMESPACE"},
|
|
||||||
Destination: &cfg.Service.Namespace,
|
|
||||||
},
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "service-name",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Service.Name, "proxy"),
|
|
||||||
Usage: "Service name",
|
|
||||||
EnvVars: []string{"PROXY_SERVICE_NAME"},
|
|
||||||
Destination: &cfg.Service.Name,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncloud/ocis/settings/pkg/config"
|
"github.com/owncloud/ocis/settings/pkg/config"
|
||||||
"github.com/owncloud/ocis/settings/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +13,9 @@ func Health(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "health",
|
Name: "health",
|
||||||
Usage: "Check health status",
|
Usage: "Check health status",
|
||||||
Flags: flagset.HealthWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
logger := NewLogger(cfg)
|
logger := NewLogger(cfg)
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
tw "github.com/olekukonko/tablewriter"
|
tw "github.com/olekukonko/tablewriter"
|
||||||
"github.com/owncloud/ocis/settings/pkg/config"
|
"github.com/owncloud/ocis/settings/pkg/config"
|
||||||
"github.com/owncloud/ocis/settings/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -17,7 +16,9 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "version",
|
Name: "version",
|
||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListSettingsWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.GRPC.Namespace + "." + cfg.Service.Name)
|
services, err := reg.GetService(cfg.GRPC.Namespace + "." + cfg.Service.Name)
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
package flagset
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
|
||||||
"github.com/owncloud/ocis/settings/pkg/config"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HealthWithConfig applies cfg to the root flagset
|
|
||||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "debug-addr",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9194"),
|
|
||||||
Usage: "Address to debug endpoint",
|
|
||||||
EnvVars: []string{"SETTINGS_DEBUG_ADDR"},
|
|
||||||
Destination: &cfg.Debug.Addr,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListSettingsWithConfig applies list command flags to cfg
|
|
||||||
func ListSettingsWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "grpc-namespace",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.GRPC.Namespace, "com.owncloud.api"),
|
|
||||||
Usage: "Set the base namespace for the grpc namespace",
|
|
||||||
EnvVars: []string{"SETTINGS_GRPC_NAMESPACE"},
|
|
||||||
Destination: &cfg.GRPC.Namespace,
|
|
||||||
},
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "name",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Service.Name, "settings"),
|
|
||||||
Usage: "service name",
|
|
||||||
EnvVars: []string{"SETTINGS_NAME"},
|
|
||||||
Destination: &cfg.Service.Name,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncloud/ocis/store/pkg/config"
|
"github.com/owncloud/ocis/store/pkg/config"
|
||||||
"github.com/owncloud/ocis/store/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +13,9 @@ func Health(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "health",
|
Name: "health",
|
||||||
Usage: "Check health status",
|
Usage: "Check health status",
|
||||||
Flags: flagset.HealthWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
logger := NewLogger(cfg)
|
logger := NewLogger(cfg)
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
tw "github.com/olekukonko/tablewriter"
|
tw "github.com/olekukonko/tablewriter"
|
||||||
"github.com/owncloud/ocis/store/pkg/config"
|
"github.com/owncloud/ocis/store/pkg/config"
|
||||||
"github.com/owncloud/ocis/store/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -17,7 +16,9 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "version",
|
Name: "version",
|
||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListStoreWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
package flagset
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
|
||||||
"github.com/owncloud/ocis/store/pkg/config"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HealthWithConfig applies cfg to the root flagset
|
|
||||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "debug-addr",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9464"),
|
|
||||||
Usage: "Address to debug endpoint",
|
|
||||||
EnvVars: []string{"STORE_DEBUG_ADDR"},
|
|
||||||
Destination: &cfg.Debug.Addr,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListStoreWithConfig applies the config to the list commands flags.
|
|
||||||
func ListStoreWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{&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: "name",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Service.Name, "store"),
|
|
||||||
Usage: "Service name",
|
|
||||||
EnvVars: []string{"STORE_NAME"},
|
|
||||||
Destination: &cfg.Service.Name,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncloud/ocis/thumbnails/pkg/config"
|
"github.com/owncloud/ocis/thumbnails/pkg/config"
|
||||||
"github.com/owncloud/ocis/thumbnails/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +13,9 @@ func Health(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "health",
|
Name: "health",
|
||||||
Usage: "Check health status",
|
Usage: "Check health status",
|
||||||
Flags: flagset.HealthWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
logger := NewLogger(cfg)
|
logger := NewLogger(cfg)
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
tw "github.com/olekukonko/tablewriter"
|
tw "github.com/olekukonko/tablewriter"
|
||||||
"github.com/owncloud/ocis/thumbnails/pkg/config"
|
"github.com/owncloud/ocis/thumbnails/pkg/config"
|
||||||
"github.com/owncloud/ocis/thumbnails/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -17,7 +16,9 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "version",
|
Name: "version",
|
||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListThumbnailsWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.Server.Namespace + "." + cfg.Server.Name)
|
services, err := reg.GetService(cfg.Server.Namespace + "." + cfg.Server.Name)
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
package flagset
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
|
||||||
|
|
||||||
"github.com/owncloud/ocis/thumbnails/pkg/config"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HealthWithConfig applies cfg to the root flagset
|
|
||||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "debug-addr",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9189"),
|
|
||||||
Usage: "Address to debug endpoint",
|
|
||||||
EnvVars: []string{"THUMBNAILS_DEBUG_ADDR"},
|
|
||||||
Destination: &cfg.Debug.Addr,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListThumbnailsWithConfig applies the config to the flagset for listing thumbnails services.
|
|
||||||
func ListThumbnailsWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "grpc-name",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Server.Name, "thumbnails"),
|
|
||||||
Usage: "Name of the service",
|
|
||||||
EnvVars: []string{"THUMBNAILS_GRPC_NAME"},
|
|
||||||
Destination: &cfg.Server.Name,
|
|
||||||
},
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "grpc-namespace",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Server.Namespace, "com.owncloud.api"),
|
|
||||||
Usage: "Set the base namespace for the grpc namespace",
|
|
||||||
EnvVars: []string{"THUMBNAILS_GRPC_NAMESPACE"},
|
|
||||||
Destination: &cfg.Server.Namespace,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncloud/ocis/web/pkg/config"
|
"github.com/owncloud/ocis/web/pkg/config"
|
||||||
"github.com/owncloud/ocis/web/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +13,9 @@ func Health(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "health",
|
Name: "health",
|
||||||
Usage: "Check health status",
|
Usage: "Check health status",
|
||||||
Flags: flagset.HealthWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
logger := NewLogger(cfg)
|
logger := NewLogger(cfg)
|
||||||
|
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
package flagset
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
|
||||||
"github.com/owncloud/ocis/web/pkg/config"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
// RootWithConfig applies cfg to the root flagset
|
|
||||||
func RootWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "log-level",
|
|
||||||
Usage: "Set logging level",
|
|
||||||
EnvVars: []string{"OCIS_LOG_LEVEL", "WEB_LOG_LEVEL"},
|
|
||||||
Destination: &cfg.Log.Level,
|
|
||||||
},
|
|
||||||
&cli.BoolFlag{
|
|
||||||
Name: "log-pretty",
|
|
||||||
Usage: "Enable pretty logging",
|
|
||||||
EnvVars: []string{"OCIS_LOG_PRETTY", "WEB_LOG_PRETTY"},
|
|
||||||
Destination: &cfg.Log.Pretty,
|
|
||||||
},
|
|
||||||
&cli.BoolFlag{
|
|
||||||
Name: "log-color",
|
|
||||||
Usage: "Enable colored logging",
|
|
||||||
EnvVars: []string{"OCIS_LOG_COLOR", "WEB_LOG_COLOR"},
|
|
||||||
Destination: &cfg.Log.Color,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// HealthWithConfig applies cfg to the root flagset
|
|
||||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "debug-addr",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9104"),
|
|
||||||
Usage: "Address to debug endpoint",
|
|
||||||
EnvVars: []string{"WEB_DEBUG_ADDR"},
|
|
||||||
Destination: &cfg.Debug.Addr,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncloud/ocis/webdav/pkg/config"
|
"github.com/owncloud/ocis/webdav/pkg/config"
|
||||||
"github.com/owncloud/ocis/webdav/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +13,9 @@ func Health(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "health",
|
Name: "health",
|
||||||
Usage: "Check health status",
|
Usage: "Check health status",
|
||||||
Flags: flagset.HealthWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
logger := NewLogger(cfg)
|
logger := NewLogger(cfg)
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
tw "github.com/olekukonko/tablewriter"
|
tw "github.com/olekukonko/tablewriter"
|
||||||
"github.com/owncloud/ocis/webdav/pkg/config"
|
"github.com/owncloud/ocis/webdav/pkg/config"
|
||||||
"github.com/owncloud/ocis/webdav/pkg/flagset"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -17,7 +16,9 @@ func PrintVersion(cfg *config.Config) *cli.Command {
|
|||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "version",
|
Name: "version",
|
||||||
Usage: "Print the versions of the running instances",
|
Usage: "Print the versions of the running instances",
|
||||||
Flags: flagset.ListWebdavWithConfig(cfg),
|
Before: func(c *cli.Context) error {
|
||||||
|
return ParseConfig(c, cfg)
|
||||||
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
reg := registry.GetRegistry()
|
reg := registry.GetRegistry()
|
||||||
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name)
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
package flagset
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
|
||||||
"github.com/owncloud/ocis/webdav/pkg/config"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HealthWithConfig applies cfg to the root flagset
|
|
||||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "debug-addr",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9119"),
|
|
||||||
Usage: "Address to debug endpoint",
|
|
||||||
EnvVars: []string{"WEBDAV_DEBUG_ADDR"},
|
|
||||||
Destination: &cfg.Debug.Addr,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListWebdavWithConfig applies the config to the list commands flagset.
|
|
||||||
func ListWebdavWithConfig(cfg *config.Config) []cli.Flag {
|
|
||||||
return []cli.Flag{
|
|
||||||
&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.StringFlag{
|
|
||||||
Name: "service-name",
|
|
||||||
Value: flags.OverrideDefaultString(cfg.Service.Name, "webdav"),
|
|
||||||
Usage: "Service name",
|
|
||||||
EnvVars: []string{"WEBDAV_SERVICE_NAME"},
|
|
||||||
Destination: &cfg.Service.Name,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user