PascalMinder / geoblock

Traefik middleware plugin - Deny requests based on country of origin
98 stars 10 forks source link

Panic error messages in Traefik container logs #17

Closed tbishop9 closed 4 months ago

tbishop9 commented 2 years ago

Hi, Getting the following error message regularly in my Traefik container logs:

time="2022-05-12T17:07:30+10:00" level=error msg="plugins-storage/sources/gop-3711732145/src/github.com/PascalMinder/GeoBlock/geoblock.go:117:20: panic" plugin=plugin-geoblock module=github.com/PascalMinder/GeoBlock

Config is pretty basic, allowing one country as follows:

middlewares: geoblock: plugin: geoblock: allowLocalRequests: true logLocalRequests: false logAllowedRequests: false logApiRequests: false api: "https://get.geojs.io/v1/ip/country/{ip}" apiTimeoutMs: 750 # optional cacheSize: 1500 forceMonthlyUpdate: true allowUnknownCountries: false unknownCountryApiResponse: nil countries:

  • AU # Australia

Other than this error message it seems to be working correctly in any case.

PascalMinder commented 2 years ago

There might be a strange value in the xForwardedFor or xRealIp header field of the HTTP request. Do you know how the request looks like?

tbishop9 commented 4 months ago

This issue seems to have gone away now - happy to close this out.