Integrate ocis-accounts

This commit is contained in:
Ilja Neumann
2020-04-30 15:08:44 +02:00
committed by Ilja Neumann
parent f0c5ccaaa5
commit b0d984c252
6 changed files with 57 additions and 18 deletions
+40
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)
}
+6 -3
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(),
+1
View File
@@ -49,6 +49,7 @@ var (
"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`