move config parse error logging into function to ensure new lines and don't parse config for help

This commit is contained in:
Willy Kloucek
2022-08-18 08:57:27 +00:00
committed by Willy Kloucek
parent d1f0dbc4c9
commit e58eaabdeb
92 changed files with 241 additions and 526 deletions

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func AppProviderCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.AppProvider.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.AppProvider.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func AppRegistryCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.AppRegistry.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.AppRegistry.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func AuditCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Audit.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Audit.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func AuthBasicCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.AuthBasic.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.AuthBasic.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func AuthBearerCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.AuthBearer.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.AuthBearer.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func AuthMachineCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.AuthMachine.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.AuthMachine.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func FrontendCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Frontend.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Frontend.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func GatewayCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Gateway.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Gateway.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func GraphExplorerCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.GraphExplorer.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.GraphExplorer.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func GraphCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Graph.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Graph.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func GroupsCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Groups.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Groups.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func IDMCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.IDM.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.IDM.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func IDPCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.IDP.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.IDP.Commons = cfg.Commons
return nil
},

View File

@@ -2,7 +2,6 @@ package command
import (
"context"
"fmt"
"os"
"sync"
@@ -13,6 +12,7 @@ import (
"github.com/cs3org/reva/v2/pkg/share/manager/registry"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
sharing "github.com/owncloud/ocis/v2/services/sharing/pkg/config"
@@ -27,21 +27,6 @@ func Migrate(cfg *config.Config) *cli.Command {
Name: "migrate",
Usage: "migrate data from an existing to another instance",
Category: "migration",
Before: func(c *cli.Context) error {
// Parse base config
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
return err
}
// Parse sharing config
cfg.Sharing.Commons = cfg.Commons
if err := sharingparser.ParseConfig(cfg.Sharing); err != nil {
fmt.Printf("%v", err)
return err
}
return nil
},
Subcommands: []*cli.Command{
MigrateShares(cfg),
MigratePublicShares(cfg),
@@ -69,6 +54,16 @@ func MigrateShares(cfg *config.Config) *cli.Command {
Usage: "Share manager to import the data into",
},
},
Before: func(c *cli.Context) error {
// Parse base config
if err := parser.ParseConfig(cfg, true); err != nil {
return configlog.LogReturnError(err)
}
// Parse sharing config
cfg.Sharing.Commons = cfg.Commons
return configlog.LogReturnError(sharingparser.ParseConfig(cfg.Sharing))
},
Action: func(c *cli.Context) error {
log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger()
ctx := log.WithContext(context.Background())
@@ -154,6 +149,16 @@ func MigratePublicShares(cfg *config.Config) *cli.Command {
Usage: "Public share manager to import the data into",
},
},
Before: func(c *cli.Context) error {
// Parse base config
if err := parser.ParseConfig(cfg, true); err != nil {
return configlog.LogReturnError(err)
}
// Parse sharing config
cfg.Sharing.Commons = cfg.Commons
return configlog.LogReturnError(sharingparser.ParseConfig(cfg.Sharing))
},
Action: func(c *cli.Context) error {
log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger()
ctx := log.WithContext(context.Background())

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func NatsCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Nats.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Nats.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func NotificationsCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Notifications.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Notifications.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func OCDavCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.OCDav.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.OCDav.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func OCSCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.OCS.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.OCS.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func ProxyCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Proxy.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Proxy.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func SearchCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Search.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Search.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/owncloud/ocis/v2/ocis/pkg/runtime"
@@ -17,11 +16,7 @@ func Server(cfg *config.Config) *cli.Command {
Usage: "start a fullstack server (runtime and all services in supervised mode)",
Category: "fullstack",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, false); err != nil {
fmt.Printf("%v", err)
return err
}
return nil
return configlog.LogReturnError(parser.ParseConfig(cfg, false))
},
Action: func(c *cli.Context) error {
r := runtime.New(cfg)

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func SettingsCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Settings.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Settings.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func SharingCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Sharing.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Sharing.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func StoragePublicLinkCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.StoragePublicLink.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.StoragePublicLink.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func StorageSharesCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.StorageShares.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.StorageShares.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func StorageSystemCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.StorageSystem.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.StorageSystem.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func StorageUsersCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.StorageUsers.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.StorageUsers.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -19,9 +18,7 @@ func StoreCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Store.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Store.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func ThumbnailsCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Thumbnails.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Thumbnails.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func UsersCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Users.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Users.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -18,9 +17,7 @@ func WebCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.Web.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.Web.Commons = cfg.Commons
return nil
},

View File

@@ -1,9 +1,8 @@
package command
import (
"fmt"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
@@ -19,9 +18,7 @@ func WebDAVCommand(cfg *config.Config) *cli.Command {
Usage: helper.SubcommandDescription(cfg.WebDAV.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
if err := parser.ParseConfig(cfg, true); err != nil {
fmt.Printf("%v", err)
}
configlog.LogError(parser.ParseConfig(cfg, true))
cfg.WebDAV.Commons = cfg.Commons
return nil
},