run ParseConfig only when running unsupervised

This commit is contained in:
A.Unger
2021-03-11 20:09:05 +01:00
parent dc4b4b7e46
commit b52fe95762
13 changed files with 80 additions and 42 deletions
-1
View File
@@ -37,7 +37,6 @@ func Execute(cfg *config.Config) error {
Before: func(c *cli.Context) error {
cfg.Service.Version = version.String
return nil
//return ParseConfig(c, cfg)
},
Commands: []*cli.Command{
+4 -6
View File
@@ -47,6 +47,7 @@ func Server(cfg *config.Config) *cli.Command {
Usage: "Start integrated server",
Flags: append(flagset.ServerWithConfig(cfg), flagset.RootWithConfig(cfg)...),
Before: func(ctx *cli.Context) error {
logger := NewLogger(cfg)
if cfg.HTTP.Root != "/" {
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
}
@@ -56,13 +57,10 @@ func Server(cfg *config.Config) *cli.Command {
return err
}
if err := ParseConfig(ctx, cfg); err != nil {
return err
if !cfg.Supervised {
return ParseConfig(ctx, cfg)
}
// TODO we could parse OCIS_URL and set the PROXY_HTTP_ADDR port but that would make it harder to deploy with a
// reverse proxy ... wouldn't it?
logger.Debug().Str("service", "ocs").Msg("ignoring config file parsing when running supervised")
return nil
},
Action: func(c *cli.Context) error {