Skip to content

Commit

Permalink
fix config parsing in unsupervised mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed Apr 19, 2022
1 parent d13afd5 commit 45f49ae
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 110 deletions.
10 changes: 3 additions & 7 deletions ocis/pkg/command/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/accounts/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// AccountsCommand is the entrypoint for the accounts command.
func AccountsCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: cfg.Accounts.Service.Name,
Usage: subcommandDescription(cfg.Accounts.Service.Name),
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: cfg.Accounts.Service.Name,
Usage: subcommandDescription(cfg.Accounts.Service.Name),
Category: "extensions",
Subcommands: command.GetCommands(cfg.Accounts),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/audit/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// AuditCommand is the entrypoint for the audit command.
func AuditCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "audit",
Usage: "start audit service",
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: cfg.Audit.Service.Name,
Usage: subcommandDescription(cfg.Audit.Service.Name),
Category: "extensions",
Subcommands: command.GetCommands(cfg.Audit),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/glauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/glauth/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// GLAuthCommand is the entrypoint for the glauth command.
func GLAuthCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: cfg.GLAuth.Service.Name,
Usage: subcommandDescription(cfg.GLAuth.Service.Name),
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: cfg.GLAuth.Service.Name,
Usage: subcommandDescription(cfg.GLAuth.Service.Name),
Category: "extensions",
Subcommands: command.GetCommands(cfg.GLAuth),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/graph/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// GraphCommand is the entrypoint for the graph command.
func GraphCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: cfg.Graph.Service.Name,
Usage: subcommandDescription(cfg.Graph.Service.Name),
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: cfg.Graph.Service.Name,
Usage: subcommandDescription(cfg.Graph.Service.Name),
Category: "extensions",
Subcommands: command.GetCommands(cfg.Graph),
}
}
Expand Down
4 changes: 0 additions & 4 deletions ocis/pkg/command/graphexplorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package command
import (
"github.com/owncloud/ocis/extensions/graph-explorer/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)
Expand All @@ -14,9 +13,6 @@ func GraphExplorerCommand(cfg *config.Config) *cli.Command {
Name: cfg.GraphExplorer.Service.Name,
Usage: subcommandDescription(cfg.GraphExplorer.Service.Name),
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Subcommands: command.GetCommands(cfg.GraphExplorer),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/idm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/idm/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// IDMCommand is the entrypoint for the idm server command.
func IDMCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "idm",
Usage: "idm extension commands",
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: "idm",
Usage: "idm extension commands",
Category: "extensions",
Subcommands: command.GetCommands(cfg.IDM),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/idp.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/idp/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// IDPCommand is the entrypoint for the idp command.
func IDPCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: cfg.IDP.Service.Name,
Usage: subcommandDescription(cfg.IDP.Service.Name),
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: cfg.IDP.Service.Name,
Usage: subcommandDescription(cfg.IDP.Service.Name),
Category: "extensions",
Subcommands: command.GetCommands(cfg.IDP),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/natsserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/nats/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// NatsServerCommand is the entrypoint for the nats server command.
func NatsServerCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "nats-server",
Usage: "start nats server",
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: "nats-server",
Usage: "start nats server",
Category: "extensions",
Subcommands: command.GetCommands(cfg.Nats),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/notifications/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// NatsServerCommand is the entrypoint for the nats server command.
func NotificationsCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "notifications",
Usage: "start notifications service",
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: "notifications",
Usage: "start notifications service",
Category: "extensions",
Subcommands: command.GetCommands(cfg.Notifications),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/ocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/ocs/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// OCSCommand is the entrypoint for the ocs command.
func OCSCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: cfg.OCS.Service.Name,
Usage: subcommandDescription(cfg.OCS.Service.Name),
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: cfg.OCS.Service.Name,
Usage: subcommandDescription(cfg.OCS.Service.Name),
Category: "extensions",
Subcommands: command.GetCommands(cfg.OCS),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/proxy/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// ProxyCommand is the entry point for the proxy command.
func ProxyCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: cfg.Proxy.Service.Name,
Usage: subcommandDescription(cfg.Proxy.Service.Name),
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: cfg.Proxy.Service.Name,
Usage: subcommandDescription(cfg.Proxy.Service.Name),
Category: "extensions",
Subcommands: command.GetCommands(cfg.Proxy),
}
}
Expand Down
2 changes: 1 addition & 1 deletion ocis/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func Server(cfg *config.Config) *cli.Command {
&cli.StringFlag{
Name: "config-file",
Value: cfg.ConfigFile,
Usage: "config file to be loaded by the extension",
Usage: "config file to be loaded by the oCIS runtime",
Destination: &cfg.ConfigFile,
},
},
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/settings/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// SettingsCommand is the entry point for the settings command.
func SettingsCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: cfg.Settings.Service.Name,
Usage: subcommandDescription(cfg.Settings.Service.Name),
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: cfg.Settings.Service.Name,
Usage: subcommandDescription(cfg.Settings.Service.Name),
Category: "extensions",
Subcommands: command.GetCommands(cfg.Settings),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package command
import (
"github.com/owncloud/ocis/extensions/store/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)
Expand All @@ -12,12 +11,9 @@ import (
func StoreCommand(cfg *config.Config) *cli.Command {

return &cli.Command{
Name: cfg.Store.Service.Name,
Usage: subcommandDescription(cfg.Store.Service.Name),
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: cfg.Store.Service.Name,
Usage: subcommandDescription(cfg.Store.Service.Name),
Category: "extensions",
Subcommands: command.GetCommands(cfg.Store),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/thumbnails.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/thumbnails/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// ThumbnailsCommand is the entrypoint for the thumbnails command.
func ThumbnailsCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: cfg.Thumbnails.Service.Name,
Usage: subcommandDescription(cfg.Thumbnails.Service.Name),
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: cfg.Thumbnails.Service.Name,
Usage: subcommandDescription(cfg.Thumbnails.Service.Name),
Category: "extensions",
Subcommands: command.GetCommands(cfg.Thumbnails),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ package command
import (
"github.com/owncloud/ocis/extensions/web/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)

// WebCommand is the entrypoint for the web command.
func WebCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: cfg.Web.Service.Name,
Usage: subcommandDescription(cfg.Web.Service.Name),
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: cfg.Web.Service.Name,
Usage: subcommandDescription(cfg.Web.Service.Name),
Category: "extensions",
Subcommands: command.GetCommands(cfg.Web),
}
}
Expand Down
10 changes: 3 additions & 7 deletions ocis/pkg/command/webdav.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package command
import (
"github.com/owncloud/ocis/extensions/webdav/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/parser"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)
Expand All @@ -12,12 +11,9 @@ import (
func WebDAVCommand(cfg *config.Config) *cli.Command {

return &cli.Command{
Name: cfg.WebDAV.Service.Name,
Usage: subcommandDescription(cfg.WebDAV.Service.Name),
Category: "extensions",
Before: func(ctx *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: cfg.WebDAV.Service.Name,
Usage: subcommandDescription(cfg.WebDAV.Service.Name),
Category: "extensions",
Subcommands: command.GetCommands(cfg.WebDAV),
}
}
Expand Down

0 comments on commit 45f49ae

Please sign in to comment.