mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
Merge branch 'master' into search
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/accounts/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func AccountsCommand(cfg *config.Config) *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)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Accounts.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Accounts),
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/audit/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func AuditCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "audit",
|
||||
Usage: "start audit service",
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Audit.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Audit),
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/glauth/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func GLAuthCommand(cfg *config.Config) *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)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.GLAuth.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.GLAuth),
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/graph/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func GraphCommand(cfg *config.Config) *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)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Graph.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Graph),
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/graph-explorer/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ 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)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.GraphExplorer.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.GraphExplorer),
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/idm/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func IDMCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "idm",
|
||||
Usage: "idm extension commands",
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.IDM.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.IDM),
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/idp/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func IDPCommand(cfg *config.Config) *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)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.IDP.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.IDP),
|
||||
}
|
||||
|
||||
84
ocis/pkg/command/init.go
Normal file
84
ocis/pkg/command/init.go
Normal file
@@ -0,0 +1,84 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/defaults"
|
||||
ocisinit "github.com/owncloud/ocis/ocis/pkg/init"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
cli "github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// InitCommand is the entrypoint for the init command
|
||||
func InitCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "init",
|
||||
Usage: "initialise an ocis config",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "insecure",
|
||||
EnvVars: []string{"OCIS_INSECURE"},
|
||||
Value: "ask",
|
||||
Usage: "Allow insecure oCIS config",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "force-overwrite",
|
||||
Aliases: []string{"f"},
|
||||
EnvVars: []string{"OCIS_FORCE_CONFIG_OVERWRITE"},
|
||||
Value: false,
|
||||
Usage: "Force overwrite existing config file",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "config-path",
|
||||
Value: defaults.BaseConfigPath(),
|
||||
Usage: "Config path for the ocis runtime",
|
||||
EnvVars: []string{"OCIS_CONFIG_DIR"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "admin-password",
|
||||
Aliases: []string{"ap"},
|
||||
EnvVars: []string{"ADMIN_PASSWORD", "IDM_ADMIN_PASSWORD"},
|
||||
Usage: "Set admin password instead of using a random generated one",
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
insecureFlag := c.String("insecure")
|
||||
insecure := false
|
||||
if insecureFlag == "ask" {
|
||||
answer := strings.ToLower(stringPrompt("Do want to configure oCIS with certificate checking disabled?\n This is not recommended for public instances! [yes | no = default]"))
|
||||
if answer == "yes" || answer == "y" {
|
||||
insecure = true
|
||||
}
|
||||
} else if insecureFlag == strings.ToLower("true") || insecureFlag == strings.ToLower("yes") || insecureFlag == strings.ToLower("y") {
|
||||
insecure = true
|
||||
}
|
||||
err := ocisinit.CreateConfig(insecure, c.Bool("force-overwrite"), c.String("config-path"), c.String("admin-password"))
|
||||
if err != nil {
|
||||
log.Fatalf("Could not create config: %s", err)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(InitCommand)
|
||||
}
|
||||
|
||||
func stringPrompt(label string) string {
|
||||
input := ""
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
for {
|
||||
fmt.Fprint(os.Stderr, label+" ")
|
||||
input, _ = reader.ReadString('\n')
|
||||
if input != "" {
|
||||
break
|
||||
}
|
||||
}
|
||||
return strings.TrimSpace(input)
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/nats/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func NatsServerCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "nats-server",
|
||||
Usage: "start nats server",
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Nats.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Nats),
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/notifications/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func NotificationsCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "notifications",
|
||||
Usage: "start notifications service",
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Notifications.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Notifications),
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/ocdav/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"
|
||||
)
|
||||
@@ -13,9 +16,14 @@ func OCDavCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "ocdav",
|
||||
Usage: "start ocdav",
|
||||
Category: "extensions",
|
||||
// Before: func(ctx *cli.Context) error {
|
||||
// return ParseStorageCommon(ctx, cfg)
|
||||
// },
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.OCDav.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.OCDav(cfg.OCDav)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/ocs/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func OCSCommand(cfg *config.Config) *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)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.OCS.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.OCS),
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/proxy/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func ProxyCommand(cfg *config.Config) *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)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Proxy.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Proxy),
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
"github.com/owncloud/ocis/ocis-pkg/shared"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/ocis/pkg/runtime"
|
||||
"github.com/urfave/cli/v2"
|
||||
@@ -16,14 +17,13 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
Usage: "start a fullstack server (runtime and all extensions in supervised mode)",
|
||||
Category: "fullstack",
|
||||
Before: func(c *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
err := parser.ParseConfig(cfg)
|
||||
if err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
}
|
||||
return err
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
|
||||
cfg.Commons = &shared.Commons{
|
||||
Log: cfg.Log,
|
||||
}
|
||||
|
||||
r := runtime.New(cfg)
|
||||
return r.Start()
|
||||
},
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/settings/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func SettingsCommand(cfg *config.Config) *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)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Settings.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Settings),
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/appprovider/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"
|
||||
)
|
||||
@@ -13,6 +16,14 @@ func StorageAppProviderCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-app-provider",
|
||||
Usage: "start storage app-provider service",
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.AppProvider.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.AppProvider(cfg.AppProvider)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/auth-basic/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"
|
||||
)
|
||||
@@ -13,6 +16,14 @@ func StorageAuthBasicCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-auth-basic",
|
||||
Usage: "start storage auth-basic service",
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.AuthBasic.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.AuthBasic(cfg.AuthBasic)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/auth-bearer/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"
|
||||
)
|
||||
@@ -13,6 +16,14 @@ func StorageAuthBearerCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-auth-bearer",
|
||||
Usage: "Start storage auth-bearer service",
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.AuthBearer.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.AuthBearer(cfg.AuthBearer)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/auth-machine/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"
|
||||
)
|
||||
@@ -13,6 +16,14 @@ func StorageAuthMachineCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-auth-machine",
|
||||
Usage: "start storage auth-machine service",
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.AuthMachine.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.AuthMachine(cfg.AuthMachine)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/frontend/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"
|
||||
)
|
||||
@@ -13,6 +16,14 @@ func StorageFrontendCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-frontend",
|
||||
Usage: "start storage frontend",
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Frontend.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.Frontend(cfg.Frontend)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/gateway/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"
|
||||
)
|
||||
@@ -13,10 +16,14 @@ func StorageGatewayCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-gateway",
|
||||
Usage: "start storage gateway",
|
||||
Category: "extensions",
|
||||
//Flags: flagset.GatewayWithConfig(cfg.Storage),
|
||||
// Before: func(ctx *cli.Context) error {
|
||||
// return ParseStorageCommon(ctx, cfg)
|
||||
// },
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Gateway.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.Gateway(cfg.Gateway)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/group/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"
|
||||
)
|
||||
@@ -13,6 +16,14 @@ func StorageGroupProviderCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-groupprovider",
|
||||
Usage: "start storage groupprovider service",
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Group.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.Groups(cfg.Group)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/storage-metadata/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"
|
||||
)
|
||||
@@ -13,6 +16,14 @@ func StorageMetadataCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-metadata",
|
||||
Usage: "start storage and data service for metadata",
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.StorageMetadata.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.StorageMetadata(cfg.StorageMetadata)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/storage-publiclink/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"
|
||||
)
|
||||
@@ -13,6 +16,14 @@ func StoragePublicLinkCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-public-link",
|
||||
Usage: "start storage public link storage",
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.StoragePublicLink.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.StoragePublicLink(cfg.StoragePublicLink)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/storage-shares/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"
|
||||
)
|
||||
@@ -13,6 +16,14 @@ func StorageSharesCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-shares",
|
||||
Usage: "start storage and data provider for shares jail",
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.StorageShares.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.StorageShares(cfg.StorageShares)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/sharing/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"
|
||||
)
|
||||
@@ -13,6 +16,14 @@ func StorageSharingCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-sharing",
|
||||
Usage: "start storage sharing service",
|
||||
Category: "extensions",
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Sharing.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.Sharing(cfg.Sharing)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/user/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"
|
||||
)
|
||||
@@ -13,6 +16,14 @@ func StorageUserProviderCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-userprovider",
|
||||
Usage: "start storage userprovider service",
|
||||
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
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.User(cfg.User)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/store/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -15,8 +17,13 @@ func StoreCommand(cfg *config.Config) *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)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Store.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Store),
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/thumbnails/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func ThumbnailsCommand(cfg *config.Config) *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)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Thumbnails.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Thumbnails),
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/web/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -14,8 +16,13 @@ func WebCommand(cfg *config.Config) *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)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.Web.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Web),
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/webdav/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/parser"
|
||||
@@ -15,8 +17,13 @@ func WebDAVCommand(cfg *config.Config) *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)
|
||||
Before: func(c *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
fmt.Printf("%v", err)
|
||||
return err
|
||||
}
|
||||
cfg.WebDAV.Commons = cfg.Commons
|
||||
return nil
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.WebDAV),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user