Skip to content

Commit

Permalink
Merge branch 'main' of github.com:l3montree-dev/traefik-crowdsec-bouncer
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-kw committed Feb 11, 2024
2 parents 8791613 + 34cd8ca commit 0d0b2e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bouncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
func getLogLevel() slog.Level {
envVar := os.Getenv("LOG_LEVEL")
if envVar == "" {
return slog.LevelDebug
return slog.LevelInfo
}
switch envVar {
case "DEBUG":
Expand All @@ -26,7 +26,7 @@ func getLogLevel() slog.Level {
case "ERROR":
return slog.LevelError
default:
return slog.LevelDebug
return slog.LevelInfo
}
}
func initLogger() {
Expand Down
7 changes: 5 additions & 2 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ type blocklist struct {
rwMutex sync.RWMutex
}

var globalBlocklist blocklist = blocklist{}
var globalBlocklist blocklist = blocklist{
list: make(map[string]struct{}),
rwMutex: sync.RWMutex{},
}

// will be nil if unparsable
func getIpFromDecision(d model.Decision) net.IP {
Expand Down Expand Up @@ -136,7 +139,7 @@ func StartStreaming() {
slog.Error("could not start streaming", "err", err)
panic("")
}

req.Header.Add(crowdsecAuthHeader, crowdsecBouncerApiKey)
resp, err := client.Do(req)
if err != nil {
slog.Error("could not fetch initial streaming state", "err", err)
Expand Down

0 comments on commit 0d0b2e4

Please sign in to comment.