remove build flags, add debug server to accounts

This commit is contained in:
Willy Kloucek
2022-01-03 11:11:15 +01:00
parent 6d0b754a86
commit eee0d0c4c8
24 changed files with 260 additions and 63 deletions
-3
View File
@@ -1,6 +1,3 @@
//go:build !simple
// +build !simple
package command
import (
-3
View File
@@ -1,6 +1,3 @@
//go:build !simple
// +build !simple
package command
import (
+14 -2
View File
@@ -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"
+1
View File
@@ -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,
//}
-3
View File
@@ -1,6 +1,3 @@
//go:build !simple
// +build !simple
package command
import (
+2
View File
@@ -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.