mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-03 09:20:50 -05:00
use master @ ocis-accounts, ocis-settings, ocis-proxy
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis-settings/pkg/command"
|
||||
svcconfig "github.com/owncloud/ocis-settings/pkg/config"
|
||||
"github.com/owncloud/ocis-settings/pkg/flagset"
|
||||
"github.com/owncloud/ocis/pkg/config"
|
||||
"github.com/owncloud/ocis/pkg/register"
|
||||
)
|
||||
|
||||
// SettingsCommand is the entry point for the settings command.
|
||||
func SettingsCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "settings",
|
||||
Usage: "Start settings server",
|
||||
Category: "Extensions",
|
||||
Flags: flagset.ServerWithConfig(cfg.Settings),
|
||||
Action: func(ctx *cli.Context) error {
|
||||
settingsCommand := command.Server(configureSettings(cfg))
|
||||
|
||||
if err := settingsCommand.Before(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return cli.HandleAction(settingsCommand.Action, ctx)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func configureSettings(cfg *config.Config) *svcconfig.Config {
|
||||
cfg.Settings.Log.Level = cfg.Log.Level
|
||||
cfg.Settings.Log.Pretty = cfg.Log.Pretty
|
||||
cfg.Settings.Log.Color = cfg.Log.Color
|
||||
|
||||
return cfg.Settings
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(SettingsCommand)
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
phoenix "github.com/owncloud/ocis-phoenix/pkg/config"
|
||||
proxy "github.com/owncloud/ocis-proxy/pkg/config"
|
||||
reva "github.com/owncloud/ocis-reva/pkg/config"
|
||||
settings "github.com/owncloud/ocis-settings/pkg/config"
|
||||
thumbnails "github.com/owncloud/ocis-thumbnails/pkg/config"
|
||||
webdav "github.com/owncloud/ocis-webdav/pkg/config"
|
||||
)
|
||||
@@ -71,6 +72,7 @@ type Config struct {
|
||||
Reva *reva.Config
|
||||
Thumbnails *thumbnails.Config
|
||||
WebDAV *webdav.Config
|
||||
Settings *settings.Config
|
||||
}
|
||||
|
||||
// New initializes a new configuration with or without defaults.
|
||||
@@ -88,5 +90,6 @@ func New() *Config {
|
||||
GLAuth: glauth.New(),
|
||||
Proxy: proxy.New(),
|
||||
Thumbnails: thumbnails.New(),
|
||||
Settings: settings.New(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ var (
|
||||
|
||||
// Extensions are ocis extension services
|
||||
Extensions = []string{
|
||||
"proxy",
|
||||
"settings",
|
||||
"phoenix",
|
||||
"graph",
|
||||
"graph-explorer",
|
||||
@@ -51,7 +53,6 @@ var (
|
||||
"accounts",
|
||||
"glauth",
|
||||
"konnectd",
|
||||
"proxy",
|
||||
"thumbnails",
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user