mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-08 04:20:59 -05:00
ensure, that each config is only parsed once
This commit is contained in:
committed by
Jörn Friedrich Dreyer
parent
5b56920128
commit
1dc63cbce1
@@ -15,15 +15,7 @@ func AccountsCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start accounts server",
|
||||
Category: "Extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Commons != nil {
|
||||
cfg.Accounts.Commons = cfg.Commons
|
||||
}
|
||||
|
||||
return nil
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Accounts),
|
||||
}
|
||||
|
||||
@@ -15,15 +15,7 @@ func GLAuthCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start glauth server",
|
||||
Category: "Extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Commons != nil {
|
||||
cfg.GLAuth.Commons = cfg.Commons
|
||||
}
|
||||
|
||||
return nil
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.GLAuth),
|
||||
}
|
||||
|
||||
@@ -15,15 +15,7 @@ func GraphCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start graph server",
|
||||
Category: "Extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Commons != nil {
|
||||
cfg.Accounts.Commons = cfg.Commons
|
||||
}
|
||||
|
||||
return nil
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Graph),
|
||||
}
|
||||
|
||||
@@ -15,15 +15,7 @@ func GraphExplorerCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start graph-explorer server",
|
||||
Category: "Extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Commons != nil {
|
||||
cfg.GraphExplorer.Commons = cfg.Commons
|
||||
}
|
||||
|
||||
return nil
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.GraphExplorer),
|
||||
}
|
||||
|
||||
@@ -15,15 +15,7 @@ func IDPCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start idp server",
|
||||
Category: "Extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Commons != nil {
|
||||
cfg.IDP.Commons = cfg.Commons
|
||||
}
|
||||
|
||||
return nil
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.IDP),
|
||||
}
|
||||
|
||||
@@ -15,15 +15,7 @@ func OCSCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start ocs server",
|
||||
Category: "Extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Commons != nil {
|
||||
cfg.OCS.Commons = cfg.Commons
|
||||
}
|
||||
|
||||
return nil
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.OCS),
|
||||
}
|
||||
|
||||
@@ -15,15 +15,7 @@ func ProxyCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start proxy server",
|
||||
Category: "Extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Commons != nil {
|
||||
cfg.Proxy.Commons = cfg.Commons
|
||||
}
|
||||
|
||||
return nil
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Proxy),
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
|
||||
"github.com/owncloud/ocis/ocis-pkg/clihelper"
|
||||
"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"
|
||||
)
|
||||
@@ -17,9 +16,6 @@ func Execute() error {
|
||||
app := clihelper.DefaultApp(&cli.App{
|
||||
Name: "ocis",
|
||||
Usage: "ownCloud Infinite Scale Stack",
|
||||
Before: func(c *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
})
|
||||
|
||||
for _, fn := range register.Commands {
|
||||
|
||||
@@ -15,15 +15,7 @@ func SettingsCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start settings server",
|
||||
Category: "Extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Commons != nil {
|
||||
cfg.Settings.Commons = cfg.Commons
|
||||
}
|
||||
|
||||
return nil
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Settings),
|
||||
}
|
||||
|
||||
@@ -16,15 +16,7 @@ func StoreCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start a go-micro store",
|
||||
Category: "Extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Commons != nil {
|
||||
cfg.Store.Commons = cfg.Commons
|
||||
}
|
||||
|
||||
return nil
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Store),
|
||||
}
|
||||
|
||||
@@ -15,15 +15,7 @@ func ThumbnailsCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start thumbnails server",
|
||||
Category: "Extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Commons != nil {
|
||||
cfg.Thumbnails.Commons = cfg.Commons
|
||||
}
|
||||
|
||||
return nil
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.Server(cfg.Thumbnails)
|
||||
|
||||
@@ -15,15 +15,7 @@ func WebCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start web server",
|
||||
Category: "Extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Commons != nil {
|
||||
cfg.Web.Commons = cfg.Commons
|
||||
}
|
||||
|
||||
return nil
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Web),
|
||||
}
|
||||
|
||||
@@ -16,15 +16,7 @@ func WebDAVCommand(cfg *config.Config) *cli.Command {
|
||||
Usage: "Start webdav server",
|
||||
Category: "Extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
if err := parser.ParseConfig(cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Commons != nil {
|
||||
cfg.WebDAV.Commons = cfg.Commons
|
||||
}
|
||||
|
||||
return nil
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.WebDAV),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user