PascalMinder / geoblock

Traefik middleware plugin - Deny requests based on country of origin
105 stars 9 forks source link

Log Spamming #32

Closed jerrywoo96 closed 1 year ago

jerrywoo96 commented 1 year ago

Hi,

I'm using portainer, and i also use this middleware with a personal dns server for my own use only so as to restrict public use for dns over https. I'm not sure if this is a reason that cause this log spamming, but i'm pretty sure this can be muted. Or change it to a log that only shows rejected requests which is much more informative. Attached is my screenshot.

image

jerrywoo96 commented 1 year ago

This is the config.

image image

PascalMinder commented 1 year ago

It seems to me the middleware restarts always. Try to change the lines api: "https://get.geojs.io/v1/ip/country/{ip}" and unknownCountryApiResponse: "nil" adding the ".

jerrywoo96 commented 1 year ago

I've update the config, stopped traefik, deleted the log files, still same. The traefik.log and access.log files are empty, but Its still spamming the stout. the one above same behaviour, log files no spam, but it was spamming the stout.

image image image

PascalMinder commented 1 year ago

It looks like you have at least two different configurations: image

Did you check all of them?

jerrywoo96 commented 1 year ago

I only have 3 configurations. All 3 configurations are different. But my main concern is why does 1 configuration needs to be displayed so many times at the same time?

image

image

PascalMinder commented 1 year ago

If you use one configuration with multiple containers it will span multiple times thus showing up multiple times in the log. If after starting all the containers you use GeoBlock for, are up and running, the log output should stop.

On how many containers are you using the configuration? Do you use dynamic-configuration or another configuration option?

jerrywoo96 commented 1 year ago

If you use one configuration with multiple containers it will span multiple times thus showing up multiple times in the log. If after starting all the containers you use GeoBlock for, are up and running, the log output should stop.

On how many containers are you using the configuration? Do you use dynamic-configuration or another configuration option?

Only 1 Traefik container, and applied to multiple routers in Traefik. So are you saying if i have applied GeoBlock to 10 routers, it will display 10 times?

PascalMinder commented 1 year ago

Yes, as far as I understand it, Traefik will launch an instance of the middleware for each route the middleware is applied to.

jerrywoo96 commented 1 year ago

Can i get a config option to hide these? Also can i create a FR to show declined requests in stout?