Skip to content

Commit

Permalink
update dependencies + lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Sep 20, 2024
1 parent 4c1e06c commit 95d7c13
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 19 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ jobs:
with:
go-version: '1.22'

- name: mod tidy
run: |
go mod tidy
git diff
- name: Build
run: |
make build
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ linters:
# - errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occations, where the check for the returned error can be omitted.
# - errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.
# - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13.
# - execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds
# - exhaustive # check exhaustiveness of enum switch statements
# - exportloopref # checks for pointers to enclosing loop variables
# - forcetypeassert # finds forced type assertions
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module github.com/crowdsecurity/cs-firewall-bouncer
go 1.22

require (
github.com/crowdsecurity/crowdsec v1.6.3-rc3
github.com/crowdsecurity/go-cs-bouncer v0.0.14-0.20240819095913-4521d8ddc0c6
github.com/crowdsecurity/go-cs-lib v0.0.13
github.com/crowdsecurity/crowdsec v1.6.3
github.com/crowdsecurity/go-cs-bouncer v0.0.14
github.com/crowdsecurity/go-cs-lib v0.0.15
github.com/google/nftables v0.2.0
github.com/prometheus/client_golang v1.20.0
github.com/prometheus/client_model v0.6.1
Expand Down
14 changes: 6 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/crowdsecurity/crowdsec v1.6.3-rc3 h1:Hlb4CIHI7oB6DptjhTjdLZXBiWgm5ufCFdekIEnKh+A=
github.com/crowdsecurity/crowdsec v1.6.3-rc3/go.mod h1:o1M2A0sNqch8D5RwiXpmiLj5JPznZGwTFalXskXhkPY=
github.com/crowdsecurity/go-cs-bouncer v0.0.14-0.20240819095913-4521d8ddc0c6 h1:fLJyC+uzlUEufSg9vBPHNZ74X9y4pWvE/877DLjDK2o=
github.com/crowdsecurity/go-cs-bouncer v0.0.14-0.20240819095913-4521d8ddc0c6/go.mod h1:qnxo6SrLoU3BwU+v9vKDosVHQnhoNDGss37wseoGhRk=
github.com/crowdsecurity/go-cs-lib v0.0.13 h1:asmtjIEPOibUK8eaYQCIR7XIBU/EX5vyAp1EbKFQJtY=
github.com/crowdsecurity/go-cs-lib v0.0.13/go.mod h1:ePyQyJBxp1W/1bq4YpVAilnLSz7HkzmtI7TRhX187EU=
github.com/crowdsecurity/crowdsec v1.6.3 h1:L/6iT2/Gfl9bc9DQkHJz2BbpKM3P+yW6ocCKRyF4j1g=
github.com/crowdsecurity/crowdsec v1.6.3/go.mod h1:LrdAX9l4vgaExQbNUVnvZIu/DPwD9pSE9gBj14D4MTo=
github.com/crowdsecurity/go-cs-bouncer v0.0.14 h1:0hxOaa59pMT274qDzJXNxps4QfMnhSNss+oUn36HTpw=
github.com/crowdsecurity/go-cs-bouncer v0.0.14/go.mod h1:4nSF37v7i98idHM6cw1o0V0XgiY25EjTLfFFXvqg6OA=
github.com/crowdsecurity/go-cs-lib v0.0.15 h1:zNWqOPVLHgKUstlr6clom9d66S0eIIW66jQG3Y7FEvo=
github.com/crowdsecurity/go-cs-lib v0.0.15/go.mod h1:ePyQyJBxp1W/1bq4YpVAilnLSz7HkzmtI7TRhX187EU=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -61,8 +61,6 @@ github.com/google/nftables v0.2.0 h1:PbJwaBmbVLzpeldoeUKGkE2RjstrjPKMl6oLrfEJ6/8
github.com/google/nftables v0.2.0/go.mod h1:Beg6V6zZ3oEn0JuiUQ4wqwuyqqzasOltcoXPtgLbFp4=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI=
github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA=
Expand Down
2 changes: 1 addition & 1 deletion pkg/cfg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func nftablesConfig(config *BouncerConfig) error {
return errors.New("both IPv4 and IPv6 disabled, doing nothing")
}

if config.NftablesHooks == nil || len(config.NftablesHooks) == 0 {
if len(config.NftablesHooks) == 0 {
config.NftablesHooks = []string{"input"}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/nftables/nftables.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func normalizedDecisions(decisions []*models.Decision) []*models.Decision {
}

*d.Value = strings.Split(*d.Value, "/")[0]
if max, ok := vals[*d.Value]; !ok || t > max.duration {
if longest, ok := vals[*d.Value]; !ok || t > longest.duration {
vals[*d.Value] = tmpDecisions{
duration: t,
origin: *d.Origin,
Expand Down

0 comments on commit 95d7c13

Please sign in to comment.