Skip to content

Commit

Permalink
chore: add debug logging, set default host to 0.0.0.0 for kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
kashalls committed May 23, 2024
1 parent b67d5be commit a91d5e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webhook/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package configuration
import (
"time"

"github.com/caarlos0/env/v8"
"github.com/caarlos0/env/v11"
log "github.com/sirupsen/logrus"
)

Expand All @@ -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"`
Expand Down
2 changes: 2 additions & 0 deletions webhook/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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)
Expand Down

0 comments on commit a91d5e8

Please sign in to comment.