Merge branch 'master' into feature/public-shares

This commit is contained in:
A.Unger
2020-05-26 12:01:32 +02:00
44 changed files with 1833 additions and 296 deletions

40
pkg/command/accounts.go Normal file
View File

@@ -0,0 +1,40 @@
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-accounts/pkg/command"
svcconfig "github.com/owncloud/ocis-accounts/pkg/config"
"github.com/owncloud/ocis-accounts/pkg/flagset"
"github.com/owncloud/ocis/pkg/config"
"github.com/owncloud/ocis/pkg/register"
)
// AccountsCommand is the entrypoint for the accounts command.
func AccountsCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "accounts",
Usage: "Start accounts server",
Category: "Extensions",
Flags: flagset.ServerWithConfig(cfg.Accounts),
Action: func(c *cli.Context) error {
accountsCommand := command.Server(configureAccounts(cfg))
if err := accountsCommand.Before(c); err != nil {
return err
}
return cli.HandleAction(accountsCommand.Action, c)
},
}
}
func configureAccounts(cfg *config.Config) *svcconfig.Config {
cfg.Accounts.Log.Level = cfg.Log.Level
cfg.Accounts.Log.Pretty = cfg.Log.Pretty
cfg.Accounts.Log.Color = cfg.Log.Color
return cfg.Accounts
}
func init() {
register.AddCommand(AccountsCommand)
}

View File

@@ -0,0 +1,28 @@
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-migration/pkg/command"
toolconfig "github.com/owncloud/ocis-migration/pkg/config"
"github.com/owncloud/ocis-migration/pkg/flagset"
"github.com/owncloud/ocis/pkg/config"
"github.com/owncloud/ocis/pkg/register"
)
// ImportCommand is the entrypoint for the accounts command.
func ImportCommand(cfg *config.Config) *cli.Command {
tc := toolconfig.New()
return &cli.Command{
Name: "import",
Usage: "Import a user exported by owncloud/data_exporter",
Flags: flagset.ImportWithConfig(tc),
Action: func(c *cli.Context) error {
importCommand := command.Import(tc)
return cli.HandleAction(importCommand.Action, c)
},
}
}
func init() {
register.AddCommand(ImportCommand)
}

View File

@@ -0,0 +1,40 @@
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/pkg/config"
"github.com/owncloud/ocis/pkg/register"
)
// RevaStorageEOSCommand is the entrypoint for the reva-storage-oc command.
func RevaStorageEOSCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-eos",
Usage: "Start reva eos storage",
Category: "Extensions",
Flags: flagset.StorageEOSWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaStorageEOS(cfg)
return cli.HandleAction(
command.StorageEOS(scfg).Action,
c,
)
},
}
}
func configureRevaStorageEOS(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
return cfg.Reva
}
func init() {
register.AddCommand(RevaStorageEOSCommand)
}

View File

@@ -0,0 +1,40 @@
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-reva/pkg/command"
svcconfig "github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
"github.com/owncloud/ocis/pkg/config"
"github.com/owncloud/ocis/pkg/register"
)
// RevaStorageEOSDataCommand is the entrypoint for the reva-storage-eos-data command.
func RevaStorageEOSDataCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "reva-storage-eos-data",
Usage: "Start reva eos storage dataprovider",
Category: "Extensions",
Flags: flagset.StorageEOSDataWithConfig(cfg.Reva),
Action: func(c *cli.Context) error {
scfg := configureRevaStorageEOSData(cfg)
return cli.HandleAction(
command.StorageEOSData(scfg).Action,
c,
)
},
}
}
func configureRevaStorageEOSData(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Level = cfg.Log.Level
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
return cfg.Reva
}
func init() {
register.AddCommand(RevaStorageEOSDataCommand)
}

View File

@@ -32,8 +32,6 @@ func configureRevaStorageHome(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
cfg.Reva.Reva.StorageHome.ExposeDataServer = true
return cfg.Reva
}

View File

@@ -32,8 +32,6 @@ func configureRevaStorageOC(cfg *config.Config) *svcconfig.Config {
cfg.Reva.Log.Pretty = cfg.Log.Pretty
cfg.Reva.Log.Color = cfg.Log.Color
cfg.Reva.Reva.StorageOC.ExposeDataServer = true
return cfg.Reva
}

View File

@@ -15,15 +15,12 @@ import (
)
var (
// SimpleRuntimeServices declares which services will be started for the fullstack server
// SimpleRuntimeServices declares which services will be started for the simple server
SimpleRuntimeServices = []string{
"hello",
"phoenix",
"reva-frontend",
"reva-gateway",
"reva-users",
"reva-auth-basic",
"reva-auth-bearer",
"konnectd",
"glauth",
}
)
@@ -50,7 +47,7 @@ func Simple(cfg *config.Config) *cli.Command {
runtime := runtime.New(
runtime.Logger(logger),
runtime.Services(append(runtime.RuntimeServices, SimpleRuntimeServices...)),
runtime.Services(append(runtime.MicroServices, SimpleRuntimeServices...)),
runtime.MicroRuntime(cmd.DefaultCmd.Options().Runtime),
runtime.Context(c),
)

View File

@@ -1,6 +1,7 @@
package config
import (
accounts "github.com/owncloud/ocis-accounts/pkg/config"
glauth "github.com/owncloud/ocis-glauth/pkg/config"
graphExplorer "github.com/owncloud/ocis-graph-explorer/pkg/config"
graph "github.com/owncloud/ocis-graph/pkg/config"
@@ -58,22 +59,24 @@ type Config struct {
GRPC GRPC
Tracing Tracing
Accounts *accounts.Config
Graph *graph.Config
GraphExplorer *graphExplorer.Config
GLAuth *glauth.Config
Hello *hello.Config
Konnectd *konnectd.Config
OCS *ocs.Config
Phoenix *phoenix.Config
WebDAV *webdav.Config
Reva *reva.Config
GLAuth *glauth.Config
Proxy *proxy.Config
Reva *reva.Config
Thumbnails *thumbnails.Config
WebDAV *webdav.Config
}
// New initializes a new configuration with or without defaults.
func New() *Config {
return &Config{
Accounts: accounts.New(),
Graph: graph.New(),
GraphExplorer: graphExplorer.New(),
Hello: hello.New(),

View File

@@ -84,7 +84,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "tracing-service",
Value: "hello",
Value: "ocis",
Usage: "Service name for tracing",
EnvVars: []string{"OCIS_TRACING_SERVICE"},
Destination: &cfg.Tracing.Service,

View File

@@ -46,8 +46,11 @@ var (
"reva-storage-home",
"reva-storage-public-link",
"reva-storage-home-data",
"reva-storage-eos",
"reva-storage-eos-data",
"reva-storage-oc",
"reva-storage-oc-data",
"accounts",
"glauth",
"konnectd",
"proxy", // TODO rename this command. It collides with micro's `proxy`