diff --git a/bin/go-proxy b/bin/go-proxy index ca0c3b51..95236145 100755 Binary files a/bin/go-proxy and b/bin/go-proxy differ diff --git a/compose.example.yml b/compose.example.yml index 30a55309..636c42a3 100755 --- a/compose.example.yml +++ b/compose.example.yml @@ -22,7 +22,7 @@ services: - ./config:/app/config # if local docker provider is used - # - /var/run/docker.sock:/var/run/docker.sock:ro + - /var/run/docker.sock:/var/run/docker.sock:ro # use existing certificate # - /path/to/cert.pem:/app/certs/cert.crt:ro diff --git a/src/go-proxy/config.go b/src/go-proxy/config.go index 56dfdf16..d220f14a 100644 --- a/src/go-proxy/config.go +++ b/src/go-proxy/config.go @@ -24,10 +24,6 @@ type Config interface { func NewConfig(path string) Config { cfg := &config{ - m: &configModel{ - TimeoutShutdown: 3 * time.Second, - RedirectToHTTPS: false, - }, reader: &FileReader{Path: path}, } cfg.watcher = NewFileWatcher( @@ -60,7 +56,7 @@ func (cfg *config) Load(reader ...Reader) error { return NewNestedError("unable to read config file").With(err) } - model := &configModel{} + model := defaultConfig() if err := yaml.Unmarshal(data, model); err != nil { return NewNestedError("unable to parse config file").With(err) } @@ -188,6 +184,13 @@ type configModel struct { RedirectToHTTPS bool `yaml:"redirect_to_https" json:"redirect_to_https"` } +func defaultConfig() *configModel { + return &configModel{ + TimeoutShutdown: 3 * time.Second, + RedirectToHTTPS: false, + } +} + type config struct { m *configModel diff --git a/src/go-proxy/main.go b/src/go-proxy/main.go index ce599e29..66286057 100755 --- a/src/go-proxy/main.go +++ b/src/go-proxy/main.go @@ -37,6 +37,8 @@ func main() { cfg = NewConfig(configPath) cfg.MustLoad() + logrus.Info(cfg.Value()) + if args.Command == CommandVerify { logrus.Printf("config OK") return