File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import (
15
15
"nets/manager"
16
16
"os"
17
17
"path/filepath"
18
- "strings"
19
18
"time"
20
19
21
20
"github.com/IBM/alchemy-logging/src/go/alog"
@@ -64,17 +63,14 @@ type CertReloader struct {
64
63
func ReadConfig () Config {
65
64
var config Config
66
65
67
- config_path := os .Getenv ("CONFIG_PATH" )
68
- if config_path == "" {
69
- config_path = "config.yaml"
66
+ config_path := "config.yaml"
67
+ // If the config/config.yaml exists then use the config instead
68
+ _ , err := os .Stat ("config/config.yaml" )
69
+ if ! os .IsNotExist (err ) {
70
+ config_path = "config/config.yaml"
70
71
}
71
72
72
73
log .Log (alog .INFO , "Loading config from %s " , config_path )
73
-
74
- // Block paths starting with '/' or containing '..'
75
- if strings .Contains (config_path , ".." ) {
76
- log .Log (alog .ERROR , "invalid config path: %s" , config_path )
77
- }
78
74
// Open YAML file
79
75
file , err := os .Open (filepath .Clean (config_path ))
80
76
if err != nil {
You can’t perform that action at this time.
0 commit comments