Rename konnectd to IDP
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/idp/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/idp/pkg/config"
|
||||
"github.com/owncloud/ocis/idp/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
)
|
||||
|
||||
// IDPCommand is the entrypoint for the idp command.
|
||||
func IDPCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "idp",
|
||||
Usage: "Start idp server",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.ServerWithConfig(cfg.IDP),
|
||||
Subcommands: []*cli.Command{
|
||||
command.PrintVersion(cfg.IDP),
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
idpCommand := command.Server(configureIDP(cfg))
|
||||
|
||||
if err := idpCommand.Before(c); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return cli.HandleAction(idpCommand.Action, c)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func configureIDP(cfg *config.Config) *svcconfig.Config {
|
||||
cfg.IDP.Log.Level = cfg.Log.Level
|
||||
cfg.IDP.Log.Pretty = cfg.Log.Pretty
|
||||
cfg.IDP.Log.Color = cfg.Log.Color
|
||||
cfg.IDP.HTTP.TLS = false
|
||||
cfg.IDP.Service.Version = version.String
|
||||
|
||||
if cfg.Tracing.Enabled {
|
||||
cfg.IDP.Tracing.Enabled = cfg.Tracing.Enabled
|
||||
cfg.IDP.Tracing.Type = cfg.Tracing.Type
|
||||
cfg.IDP.Tracing.Endpoint = cfg.Tracing.Endpoint
|
||||
cfg.IDP.Tracing.Collector = cfg.Tracing.Collector
|
||||
}
|
||||
|
||||
return cfg.IDP
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(IDPCommand)
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/konnectd/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis/konnectd/pkg/config"
|
||||
"github.com/owncloud/ocis/konnectd/pkg/flagset"
|
||||
"github.com/owncloud/ocis/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/version"
|
||||
)
|
||||
|
||||
// KonnectdCommand is the entrypoint for the konnectd command.
|
||||
func KonnectdCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "konnectd",
|
||||
Usage: "Start konnectd server",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.ServerWithConfig(cfg.Konnectd),
|
||||
Subcommands: []*cli.Command{
|
||||
command.PrintVersion(cfg.Konnectd),
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
konnectdCommand := command.Server(configureKonnectd(cfg))
|
||||
|
||||
if err := konnectdCommand.Before(c); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return cli.HandleAction(konnectdCommand.Action, c)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func configureKonnectd(cfg *config.Config) *svcconfig.Config {
|
||||
cfg.Konnectd.Log.Level = cfg.Log.Level
|
||||
cfg.Konnectd.Log.Pretty = cfg.Log.Pretty
|
||||
cfg.Konnectd.Log.Color = cfg.Log.Color
|
||||
cfg.Konnectd.HTTP.TLS = false
|
||||
cfg.Konnectd.Service.Version = version.String
|
||||
|
||||
if cfg.Tracing.Enabled {
|
||||
cfg.Konnectd.Tracing.Enabled = cfg.Tracing.Enabled
|
||||
cfg.Konnectd.Tracing.Type = cfg.Tracing.Type
|
||||
cfg.Konnectd.Tracing.Endpoint = cfg.Tracing.Endpoint
|
||||
cfg.Konnectd.Tracing.Collector = cfg.Tracing.Collector
|
||||
}
|
||||
|
||||
return cfg.Konnectd
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(KonnectdCommand)
|
||||
}
|
||||
Reference in New Issue
Block a user