diff --git a/webhook/configuration/configuration.go b/webhook/configuration/configuration.go index 37a79f3..5dbe16b 100644 --- a/webhook/configuration/configuration.go +++ b/webhook/configuration/configuration.go @@ -3,7 +3,7 @@ package configuration import ( "time" - "github.com/caarlos0/env/v8" + "github.com/caarlos0/env/v11" log "github.com/sirupsen/logrus" ) @@ -13,7 +13,7 @@ type Config struct { UnifiUser string `env:"UNIFI_USER" envDefault:"external-dns-unifi"` UnifiPass string `env:"UNIFI_PASS" envDefault:"V3ryS3cur3!!"` UnifiSkipTLSVerify bool `env:"UNIFI_SKIP_TLS_VERIFY" envDefault:"true"` - ServerHost string `env:"SERVER_HOST" envDefault:"localhost"` + ServerHost string `env:"SERVER_HOST" envDefault:"0.0.0.0"` ServerPort int `env:"SERVER_PORT" envDefault:"8888"` ServerReadTimeout time.Duration `env:"SERVER_READ_TIMEOUT"` ServerWriteTimeout time.Duration `env:"SERVER_WRITE_TIMEOUT"` diff --git a/webhook/server/server.go b/webhook/server/server.go index 1da9e8c..dde25d3 100644 --- a/webhook/server/server.go +++ b/webhook/server/server.go @@ -11,6 +11,7 @@ import ( "time" "github.com/go-chi/chi/v5" + "github.com/go-chi/chi/v5/middleware" "github.com/kashalls/external-dns-unifi-webhook/webhook" "github.com/kashalls/external-dns-unifi-webhook/webhook/configuration" @@ -26,6 +27,7 @@ import ( func Init(config configuration.Config, p *webhook.Webhook) *http.Server { r := chi.NewRouter() r.Use(webhook.Health) + r.Use(middleware.Logger) r.Get("/", p.Negotiate) r.Get("/records", p.Records) r.Post("/records", p.ApplyChanges)