mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-12 22:39:34 -05:00
ensure commands for all services
This commit is contained in:
@@ -10,11 +10,11 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StorageAppProviderCommand is the entrypoint for the reva-app-provider command.
|
||||
func StorageAppProviderCommand(cfg *config.Config) *cli.Command {
|
||||
// AppProviderCommand is the entrypoint for the app provider command.
|
||||
func AppProviderCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-app-provider",
|
||||
Usage: "start storage app-provider service",
|
||||
Name: cfg.AppProvider.Service.Name,
|
||||
Usage: subcommandDescription(cfg.AppProvider.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
@@ -24,13 +24,10 @@ func StorageAppProviderCommand(cfg *config.Config) *cli.Command {
|
||||
cfg.AppProvider.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.AppProvider(cfg.AppProvider)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.AppProvider),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageAppProviderCommand)
|
||||
register.AddCommand(AppProviderCommand)
|
||||
}
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StorageAuthBasicCommand is the entrypoint for the reva-auth-basic command.
|
||||
func StorageAuthBasicCommand(cfg *config.Config) *cli.Command {
|
||||
// AuthBasicCommand is the entrypoint for the AuthBasic command.
|
||||
func AuthBasicCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-auth-basic",
|
||||
Usage: "start storage auth-basic service",
|
||||
Name: cfg.AuthBasic.Service.Name,
|
||||
Usage: subcommandDescription(cfg.AuthBasic.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
@@ -24,13 +24,10 @@ func StorageAuthBasicCommand(cfg *config.Config) *cli.Command {
|
||||
cfg.AuthBasic.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.AuthBasic(cfg.AuthBasic)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.AuthBasic),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageAuthBasicCommand)
|
||||
register.AddCommand(AuthBasicCommand)
|
||||
}
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StorageAuthBearerCommand is the entrypoint for the reva-auth-bearer command.
|
||||
func StorageAuthBearerCommand(cfg *config.Config) *cli.Command {
|
||||
// AuthBearerCommand is the entrypoint for the AuthBearer command.
|
||||
func AuthBearerCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-auth-bearer",
|
||||
Usage: "Start storage auth-bearer service",
|
||||
Name: cfg.AuthBearer.Service.Name,
|
||||
Usage: subcommandDescription(cfg.AuthBearer.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
@@ -24,13 +24,10 @@ func StorageAuthBearerCommand(cfg *config.Config) *cli.Command {
|
||||
cfg.AuthBearer.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.AuthBearer(cfg.AuthBearer)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.AuthBearer),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageAuthBearerCommand)
|
||||
register.AddCommand(AuthBearerCommand)
|
||||
}
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StorageAuthMachineCommand is the entrypoint for the reva-auth-machine command.
|
||||
func StorageAuthMachineCommand(cfg *config.Config) *cli.Command {
|
||||
// AuthMachineCommand is the entrypoint for the AuthMachine command.
|
||||
func AuthMachineCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-auth-machine",
|
||||
Usage: "start storage auth-machine service",
|
||||
Name: cfg.AuthMachine.Service.Name,
|
||||
Usage: subcommandDescription(cfg.AuthMachine.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
@@ -24,13 +24,10 @@ func StorageAuthMachineCommand(cfg *config.Config) *cli.Command {
|
||||
cfg.AuthMachine.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.AuthMachine(cfg.AuthMachine)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.AuthMachine),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageAuthMachineCommand)
|
||||
register.AddCommand(AuthMachineCommand)
|
||||
}
|
||||
@@ -2,21 +2,8 @@ package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func handleOriginalAction(c *cli.Context, cmd *cli.Command) error {
|
||||
|
||||
if cmd.Before != nil {
|
||||
if err := cmd.Before(c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return cli.HandleAction(cmd.Action, c)
|
||||
}
|
||||
|
||||
func subcommandDescription(serviceName string) string {
|
||||
return fmt.Sprintf("%s extension commands", serviceName)
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StorageFrontendCommand is the entrypoint for the reva-frontend command.
|
||||
func StorageFrontendCommand(cfg *config.Config) *cli.Command {
|
||||
// FrontendCommand is the entrypoint for the Frontend command.
|
||||
func FrontendCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-frontend",
|
||||
Usage: "start storage frontend",
|
||||
Name: cfg.Frontend.Service.Name,
|
||||
Usage: subcommandDescription(cfg.Frontend.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
@@ -24,13 +24,10 @@ func StorageFrontendCommand(cfg *config.Config) *cli.Command {
|
||||
cfg.Frontend.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.Frontend(cfg.Frontend)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Frontend),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageFrontendCommand)
|
||||
register.AddCommand(FrontendCommand)
|
||||
}
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StorageGatewayCommand is the entrypoint for the reva-gateway command.
|
||||
func StorageGatewayCommand(cfg *config.Config) *cli.Command {
|
||||
// GatewayCommand is the entrypoint for the Gateway command.
|
||||
func GatewayCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-gateway",
|
||||
Usage: "start storage gateway",
|
||||
Name: cfg.Gateway.Service.Name,
|
||||
Usage: subcommandDescription(cfg.Gateway.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
@@ -24,13 +24,10 @@ func StorageGatewayCommand(cfg *config.Config) *cli.Command {
|
||||
cfg.Gateway.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.Gateway(cfg.Gateway)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Gateway),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageGatewayCommand)
|
||||
register.AddCommand(GatewayCommand)
|
||||
}
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StorageGroupProviderCommand is the entrypoint for the storage-groupprovider command.
|
||||
func StorageGroupProviderCommand(cfg *config.Config) *cli.Command {
|
||||
// GroupCommand is the entrypoint for the Group command.
|
||||
func GroupCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-groupprovider",
|
||||
Usage: "start storage groupprovider service",
|
||||
Name: cfg.Group.Service.Name,
|
||||
Usage: subcommandDescription(cfg.Group.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
@@ -24,13 +24,10 @@ func StorageGroupProviderCommand(cfg *config.Config) *cli.Command {
|
||||
cfg.Group.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.Groups(cfg.Group)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Group),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageGroupProviderCommand)
|
||||
register.AddCommand(GroupCommand)
|
||||
}
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// OCDavCommand is the entrypoint for the ocdav command.
|
||||
// OCDavCommand is the entrypoint for the OCDav command.
|
||||
func OCDavCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "ocdav",
|
||||
Usage: "start ocdav",
|
||||
Name: cfg.OCDav.Service.Name,
|
||||
Usage: subcommandDescription(cfg.OCDav.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
@@ -24,10 +24,7 @@ func OCDavCommand(cfg *config.Config) *cli.Command {
|
||||
cfg.OCDav.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.OCDav(cfg.OCDav)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.OCDav),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StorageSharingCommand is the entrypoint for the reva-sharing command.
|
||||
func StorageSharingCommand(cfg *config.Config) *cli.Command {
|
||||
// SharingCommand is the entrypoint for the Sharing command.
|
||||
func SharingCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-sharing",
|
||||
Usage: "start storage sharing service",
|
||||
Name: cfg.Sharing.Service.Name,
|
||||
Usage: subcommandDescription(cfg.Sharing.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
@@ -24,13 +24,10 @@ func StorageSharingCommand(cfg *config.Config) *cli.Command {
|
||||
cfg.Sharing.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.Sharing(cfg.Sharing)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Sharing),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageSharingCommand)
|
||||
register.AddCommand(SharingCommand)
|
||||
}
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StorageMetadataCommand is the entrypoint for the storage-metadata command.
|
||||
// StorageMetadataCommand is the entrypoint for the StorageMetadata command.
|
||||
func StorageMetadataCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-metadata",
|
||||
Usage: "start storage and data service for metadata",
|
||||
Name: cfg.StorageMetadata.Service.Name,
|
||||
Usage: subcommandDescription(cfg.StorageMetadata.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
@@ -24,10 +24,7 @@ func StorageMetadataCommand(cfg *config.Config) *cli.Command {
|
||||
cfg.StorageMetadata.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.StorageMetadata(cfg.StorageMetadata)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.StorageMetadata),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StoragePublicLinkCommand is the entrypoint for the reva-storage-oc command.
|
||||
// StoragePublicLinkCommand is the entrypoint for the StoragePublicLink command.
|
||||
func StoragePublicLinkCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-public-link",
|
||||
Usage: "start storage public link storage",
|
||||
Name: cfg.StoragePublicLink.Service.Name,
|
||||
Usage: subcommandDescription(cfg.StoragePublicLink.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
@@ -24,10 +24,7 @@ func StoragePublicLinkCommand(cfg *config.Config) *cli.Command {
|
||||
cfg.StoragePublicLink.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.StoragePublicLink(cfg.StoragePublicLink)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.StoragePublicLink),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StorageSharesCommand is the entrypoint for the storage-shares command.
|
||||
// StorageSharesCommand is the entrypoint for the StorageShares command.
|
||||
func StorageSharesCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-shares",
|
||||
Usage: "start storage and data provider for shares jail",
|
||||
Name: cfg.StorageShares.Service.Name,
|
||||
Usage: subcommandDescription(cfg.StorageShares.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
@@ -24,10 +24,7 @@ func StorageSharesCommand(cfg *config.Config) *cli.Command {
|
||||
cfg.StorageShares.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.StorageShares(cfg.StorageShares)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.StorageShares),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/storage-users/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"
|
||||
)
|
||||
|
||||
// StorageUsersCommand is the entrypoint for the StorageUsers command.
|
||||
func StorageUsersCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: cfg.StorageUsers.Service.Name,
|
||||
Usage: subcommandDescription(cfg.StorageUsers.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.StorageUsers.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.StorageUsers),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageUsersCommand)
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/owncloud/ocis/extensions/storage-users/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StorageUsersCommand is the entrypoint for the storage-users command.
|
||||
func StorageUsersCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-users",
|
||||
Usage: "start storage and data provider for /users mount",
|
||||
Category: "extensions",
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.StorageUsers(cfg.StorageUsers)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageUsersCommand)
|
||||
}
|
||||
@@ -10,27 +10,24 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StorageUserProviderCommand is the entrypoint for the storage-userprovider command.
|
||||
func StorageUserProviderCommand(cfg *config.Config) *cli.Command {
|
||||
// UserCommand is the entrypoint for the User command.
|
||||
func UserCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-userprovider",
|
||||
Usage: "start storage userprovider service",
|
||||
Name: cfg.User.Service.Name,
|
||||
Usage: subcommandDescription(cfg.User.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.StorageUsers.Commons = cfg.Commons
|
||||
cfg.User.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.User(cfg.User)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.User),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(StorageUserProviderCommand)
|
||||
register.AddCommand(UserCommand)
|
||||
}
|
||||
Reference in New Issue
Block a user