Merge pull request #3796 from wkloucek/unify-ocis-commands

unify ocis subcommands
This commit is contained in:
Willy Kloucek
2022-05-16 09:46:32 +02:00
committed by GitHub
34 changed files with 88 additions and 44 deletions
@@ -0,0 +1,8 @@
Bugfix: Fix the `ocis search` command
We've fixed the behavior for `ocis search`, which didn't show further help when not all secrets have been configured.
It also was not possible to start the search service standalone from the oCIS binary without configuring all oCIS secrets,
even they were not needed by the search service.
https://github.com/owncloud/ocis/pull/3796
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/app-provider/pkg/command" "github.com/owncloud/ocis/v2/extensions/app-provider/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func AppProviderCommand(cfg *config.Config) *cli.Command { func AppProviderCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.AppProvider.Service.Name, Name: cfg.AppProvider.Service.Name,
Usage: subcommandDescription(cfg.AppProvider.Service.Name), Usage: helper.SubcommandDescription(cfg.AppProvider.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/app-registry/pkg/command" "github.com/owncloud/ocis/v2/extensions/app-registry/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func AppRegistryCommand(cfg *config.Config) *cli.Command { func AppRegistryCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.AppRegistry.Service.Name, Name: cfg.AppRegistry.Service.Name,
Usage: subcommandDescription(cfg.AppRegistry.Service.Name), Usage: helper.SubcommandDescription(cfg.AppRegistry.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+4 -3
View File
@@ -6,15 +6,16 @@ import (
"github.com/owncloud/ocis/v2/extensions/audit/pkg/command" "github.com/owncloud/ocis/v2/extensions/audit/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
// AuditCommand is the entrypoint for the audit command. // AuditCommand is the entrypoint for the Audit command.
func AuditCommand(cfg *config.Config) *cli.Command { func AuditCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: "audit", Name: cfg.Audit.Service.Name,
Usage: "start audit service", Usage: helper.SubcommandDescription(cfg.Audit.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/auth-basic/pkg/command" "github.com/owncloud/ocis/v2/extensions/auth-basic/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func AuthBasicCommand(cfg *config.Config) *cli.Command { func AuthBasicCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.AuthBasic.Service.Name, Name: cfg.AuthBasic.Service.Name,
Usage: subcommandDescription(cfg.AuthBasic.Service.Name), Usage: helper.SubcommandDescription(cfg.AuthBasic.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/auth-bearer/pkg/command" "github.com/owncloud/ocis/v2/extensions/auth-bearer/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func AuthBearerCommand(cfg *config.Config) *cli.Command { func AuthBearerCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.AuthBearer.Service.Name, Name: cfg.AuthBearer.Service.Name,
Usage: subcommandDescription(cfg.AuthBearer.Service.Name), Usage: helper.SubcommandDescription(cfg.AuthBearer.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/auth-machine/pkg/command" "github.com/owncloud/ocis/v2/extensions/auth-machine/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func AuthMachineCommand(cfg *config.Config) *cli.Command { func AuthMachineCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.AuthMachine.Service.Name, Name: cfg.AuthMachine.Service.Name,
Usage: subcommandDescription(cfg.AuthMachine.Service.Name), Usage: helper.SubcommandDescription(cfg.AuthMachine.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/frontend/pkg/command" "github.com/owncloud/ocis/v2/extensions/frontend/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func FrontendCommand(cfg *config.Config) *cli.Command { func FrontendCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Frontend.Service.Name, Name: cfg.Frontend.Service.Name,
Usage: subcommandDescription(cfg.Frontend.Service.Name), Usage: helper.SubcommandDescription(cfg.Frontend.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/gateway/pkg/command" "github.com/owncloud/ocis/v2/extensions/gateway/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func GatewayCommand(cfg *config.Config) *cli.Command { func GatewayCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Gateway.Service.Name, Name: cfg.Gateway.Service.Name,
Usage: subcommandDescription(cfg.Gateway.Service.Name), Usage: helper.SubcommandDescription(cfg.Gateway.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/graph-explorer/pkg/command" "github.com/owncloud/ocis/v2/extensions/graph-explorer/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func GraphExplorerCommand(cfg *config.Config) *cli.Command { func GraphExplorerCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.GraphExplorer.Service.Name, Name: cfg.GraphExplorer.Service.Name,
Usage: subcommandDescription(cfg.GraphExplorer.Service.Name), Usage: helper.SubcommandDescription(cfg.GraphExplorer.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/graph/pkg/command" "github.com/owncloud/ocis/v2/extensions/graph/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func GraphCommand(cfg *config.Config) *cli.Command { func GraphCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Graph.Service.Name, Name: cfg.Graph.Service.Name,
Usage: subcommandDescription(cfg.Graph.Service.Name), Usage: helper.SubcommandDescription(cfg.Graph.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/groups/pkg/command" "github.com/owncloud/ocis/v2/extensions/groups/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func GroupsCommand(cfg *config.Config) *cli.Command { func GroupsCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Groups.Service.Name, Name: cfg.Groups.Service.Name,
Usage: subcommandDescription(cfg.Groups.Service.Name), Usage: helper.SubcommandDescription(cfg.Groups.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
@@ -1,9 +1,9 @@
package command package helper
import ( import (
"fmt" "fmt"
) )
func subcommandDescription(serviceName string) string { func SubcommandDescription(serviceName string) string {
return fmt.Sprintf("%s extension commands", serviceName) return fmt.Sprintf("%s extension commands", serviceName)
} }
+4 -3
View File
@@ -6,15 +6,16 @@ import (
"github.com/owncloud/ocis/v2/extensions/idm/pkg/command" "github.com/owncloud/ocis/v2/extensions/idm/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
// IDMCommand is the entrypoint for the idm server command. // IDMCommand is the entrypoint for the idm command.
func IDMCommand(cfg *config.Config) *cli.Command { func IDMCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: "idm", Name: cfg.IDM.Service.Name,
Usage: "idm extension commands", Usage: helper.SubcommandDescription(cfg.IDM.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/idp/pkg/command" "github.com/owncloud/ocis/v2/extensions/idp/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func IDPCommand(cfg *config.Config) *cli.Command { func IDPCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.IDP.Service.Name, Name: cfg.IDP.Service.Name,
Usage: subcommandDescription(cfg.IDP.Service.Name), Usage: helper.SubcommandDescription(cfg.IDP.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/nats/pkg/command" "github.com/owncloud/ocis/v2/extensions/nats/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func NatsCommand(cfg *config.Config) *cli.Command { func NatsCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Nats.Service.Name, Name: cfg.Nats.Service.Name,
Usage: subcommandDescription(cfg.Nats.Service.Name), Usage: helper.SubcommandDescription(cfg.Nats.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+4 -3
View File
@@ -6,15 +6,16 @@ import (
"github.com/owncloud/ocis/v2/extensions/notifications/pkg/command" "github.com/owncloud/ocis/v2/extensions/notifications/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
// NatsServerCommand is the entrypoint for the nats server command. // NotificationsCommand is the entrypoint for the notifications command.
func NotificationsCommand(cfg *config.Config) *cli.Command { func NotificationsCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: "notifications", Name: cfg.Notifications.Service.Name,
Usage: "start notifications service", Usage: helper.SubcommandDescription(cfg.Notifications.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/ocdav/pkg/command" "github.com/owncloud/ocis/v2/extensions/ocdav/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func OCDavCommand(cfg *config.Config) *cli.Command { func OCDavCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.OCDav.Service.Name, Name: cfg.OCDav.Service.Name,
Usage: subcommandDescription(cfg.OCDav.Service.Name), Usage: helper.SubcommandDescription(cfg.OCDav.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/ocs/pkg/command" "github.com/owncloud/ocis/v2/extensions/ocs/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func OCSCommand(cfg *config.Config) *cli.Command { func OCSCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.OCS.Service.Name, Name: cfg.OCS.Service.Name,
Usage: subcommandDescription(cfg.OCS.Service.Name), Usage: helper.SubcommandDescription(cfg.OCS.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/proxy/pkg/command" "github.com/owncloud/ocis/v2/extensions/proxy/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func ProxyCommand(cfg *config.Config) *cli.Command { func ProxyCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Proxy.Service.Name, Name: cfg.Proxy.Service.Name,
Usage: subcommandDescription(cfg.Proxy.Service.Name), Usage: helper.SubcommandDescription(cfg.Proxy.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+1 -1
View File
@@ -15,7 +15,7 @@ func Execute() error {
app := clihelper.DefaultApp(&cli.App{ app := clihelper.DefaultApp(&cli.App{
Name: "ocis", Name: "ocis",
Usage: "ownCloud Infinite Scale Stack", Usage: "ownCloud Infinite Scale",
}) })
for _, fn := range register.Commands { for _, fn := range register.Commands {
+10 -3
View File
@@ -1,9 +1,12 @@
package command package command
import ( import (
"fmt"
"github.com/owncloud/ocis/v2/extensions/search/pkg/command" "github.com/owncloud/ocis/v2/extensions/search/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -12,10 +15,14 @@ import (
func SearchCommand(cfg *config.Config) *cli.Command { func SearchCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Search.Service.Name, Name: cfg.Search.Service.Name,
Usage: subcommandDescription(cfg.Search.Service.Name), Usage: helper.SubcommandDescription(cfg.Search.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(ctx *cli.Context) error { Before: func(c *cli.Context) error {
return parser.ParseConfig(cfg) if err := parser.ParseConfig(cfg); err != nil {
fmt.Printf("%v", err)
}
cfg.Search.Commons = cfg.Commons
return nil
}, },
Subcommands: command.GetCommands(cfg.Search), Subcommands: command.GetCommands(cfg.Search),
} }
+3 -3
View File
@@ -17,11 +17,11 @@ func Server(cfg *config.Config) *cli.Command {
Usage: "start a fullstack server (runtime and all extensions in supervised mode)", Usage: "start a fullstack server (runtime and all extensions in supervised mode)",
Category: "fullstack", Category: "fullstack",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
err := parser.ParseConfig(cfg) if err := parser.ParseConfig(cfg); err != nil {
if err != nil {
fmt.Printf("%v", err) fmt.Printf("%v", err)
return err
} }
return err return nil
}, },
Action: func(c *cli.Context) error { Action: func(c *cli.Context) error {
r := runtime.New(cfg) r := runtime.New(cfg)
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/settings/pkg/command" "github.com/owncloud/ocis/v2/extensions/settings/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func SettingsCommand(cfg *config.Config) *cli.Command { func SettingsCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Settings.Service.Name, Name: cfg.Settings.Service.Name,
Usage: subcommandDescription(cfg.Settings.Service.Name), Usage: helper.SubcommandDescription(cfg.Settings.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/sharing/pkg/command" "github.com/owncloud/ocis/v2/extensions/sharing/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func SharingCommand(cfg *config.Config) *cli.Command { func SharingCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Sharing.Service.Name, Name: cfg.Sharing.Service.Name,
Usage: subcommandDescription(cfg.Sharing.Service.Name), Usage: helper.SubcommandDescription(cfg.Sharing.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/storage-publiclink/pkg/command" "github.com/owncloud/ocis/v2/extensions/storage-publiclink/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func StoragePublicLinkCommand(cfg *config.Config) *cli.Command { func StoragePublicLinkCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.StoragePublicLink.Service.Name, Name: cfg.StoragePublicLink.Service.Name,
Usage: subcommandDescription(cfg.StoragePublicLink.Service.Name), Usage: helper.SubcommandDescription(cfg.StoragePublicLink.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/storage-shares/pkg/command" "github.com/owncloud/ocis/v2/extensions/storage-shares/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func StorageSharesCommand(cfg *config.Config) *cli.Command { func StorageSharesCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.StorageShares.Service.Name, Name: cfg.StorageShares.Service.Name,
Usage: subcommandDescription(cfg.StorageShares.Service.Name), Usage: helper.SubcommandDescription(cfg.StorageShares.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/storage-system/pkg/command" "github.com/owncloud/ocis/v2/extensions/storage-system/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func StorageSystemCommand(cfg *config.Config) *cli.Command { func StorageSystemCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.StorageSystem.Service.Name, Name: cfg.StorageSystem.Service.Name,
Usage: subcommandDescription(cfg.StorageSystem.Service.Name), Usage: helper.SubcommandDescription(cfg.StorageSystem.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/storage-users/pkg/command" "github.com/owncloud/ocis/v2/extensions/storage-users/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func StorageUsersCommand(cfg *config.Config) *cli.Command { func StorageUsersCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.StorageUsers.Service.Name, Name: cfg.StorageUsers.Service.Name,
Usage: subcommandDescription(cfg.StorageUsers.Service.Name), Usage: helper.SubcommandDescription(cfg.StorageUsers.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/store/pkg/command" "github.com/owncloud/ocis/v2/extensions/store/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -15,7 +16,7 @@ func StoreCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Store.Service.Name, Name: cfg.Store.Service.Name,
Usage: subcommandDescription(cfg.Store.Service.Name), Usage: helper.SubcommandDescription(cfg.Store.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/thumbnails/pkg/command" "github.com/owncloud/ocis/v2/extensions/thumbnails/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func ThumbnailsCommand(cfg *config.Config) *cli.Command { func ThumbnailsCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Thumbnails.Service.Name, Name: cfg.Thumbnails.Service.Name,
Usage: subcommandDescription(cfg.Thumbnails.Service.Name), Usage: helper.SubcommandDescription(cfg.Thumbnails.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/users/pkg/command" "github.com/owncloud/ocis/v2/extensions/users/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func UsersCommand(cfg *config.Config) *cli.Command { func UsersCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Users.Service.Name, Name: cfg.Users.Service.Name,
Usage: subcommandDescription(cfg.Users.Service.Name), Usage: helper.SubcommandDescription(cfg.Users.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/web/pkg/command" "github.com/owncloud/ocis/v2/extensions/web/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -14,7 +15,7 @@ import (
func WebCommand(cfg *config.Config) *cli.Command { func WebCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.Web.Service.Name, Name: cfg.Web.Service.Name,
Usage: subcommandDescription(cfg.Web.Service.Name), Usage: helper.SubcommandDescription(cfg.Web.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/owncloud/ocis/v2/extensions/webdav/pkg/command" "github.com/owncloud/ocis/v2/extensions/webdav/pkg/command"
"github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@@ -15,7 +16,7 @@ func WebDAVCommand(cfg *config.Config) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: cfg.WebDAV.Service.Name, Name: cfg.WebDAV.Service.Name,
Usage: subcommandDescription(cfg.WebDAV.Service.Name), Usage: helper.SubcommandDescription(cfg.WebDAV.Service.Name),
Category: "extensions", Category: "extensions",
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil { if err := parser.ParseConfig(cfg); err != nil {