remove build flags, add debug server to accounts
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
//go:build !simple
|
||||
// +build !simple
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build !simple
|
||||
// +build !simple
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/envdecode"
|
||||
"github.com/owncloud/ocis/ocis-pkg/shared"
|
||||
"github.com/owncloud/ocis/ocis-pkg/version"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/urfave/cli/v2"
|
||||
@@ -57,11 +57,23 @@ func Execute() error {
|
||||
|
||||
// ParseConfig loads ocis configuration.
|
||||
func ParseConfig(c *cli.Context, cfg *config.Config) error {
|
||||
_, err := ociscfg.BindSourcesToStructs("ocis", cfg)
|
||||
_, err := config.BindSourcesToStructs("ocis", cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// provide with defaults for shared logging, since we need a valid destination address for BindEnv.
|
||||
if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
|
||||
cfg.Log = &shared.Log{
|
||||
Level: cfg.Commons.Log.Level,
|
||||
Pretty: cfg.Commons.Log.Pretty,
|
||||
Color: cfg.Commons.Log.Color,
|
||||
File: cfg.Commons.Log.File,
|
||||
}
|
||||
} else if cfg.Log == nil && cfg.Commons == nil {
|
||||
cfg.Log = &shared.Log{}
|
||||
}
|
||||
|
||||
// load all env variables relevant to the config in the current context.
|
||||
if err := envdecode.Decode(cfg); err != nil {
|
||||
// no environment variable set for this config is an expected "error"
|
||||
|
||||
@@ -18,6 +18,7 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
|
||||
// what to do
|
||||
//cfg.Commons = &shared.Commons{
|
||||
// Log: &cfg.Log,
|
||||
//}
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build !simple
|
||||
// +build !simple
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
|
||||
@@ -23,11 +23,13 @@ func StoreCommand(cfg *config.Config) *cli.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
// TODO: what to do
|
||||
//globalLog = cfg.Log
|
||||
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
// TODO: what to do
|
||||
// if accounts logging is empty in ocis.yaml
|
||||
//if (cfg.Store.Log == shared.Log{}) && (globalLog != shared.Log{}) {
|
||||
// // we can safely inherit the global logging values.
|
||||
|
||||
Reference in New Issue
Block a user