geoblock
geoblock copied to clipboard
Traefik middleware plugin - Deny requests based on country of origin
Now that Traefik supports [TCP Middlewares](https://doc.traefik.io/traefik/middlewares/tcp/overview/), will this plugin work with TCP TLS Routers? :thinking:
Hello, I have this line of log in Traefik app. ``` {"ClientAddr":"172.69.195.155:25064","ClientHost":"92.159.32.169","ClientPort":"25064","ClientUsername":"-","DownstreamContentSize":0,"DownstreamStatus":403,"Duration":78683198,"OriginContentSize":0,"OriginDuration":78537041,"OriginStatus":403,"Overhead":146157,"RequestAddr":"HIDE","RequestContentSize":0,"RequestCount":787,"RequestHost":"HIDE","RequestMethod":"GET","RequestPath":"/","RequestPort":"-","RequestProtocol":"HTTP/2.0","RequestScheme":"https","RetryAttempts":0,"RouterName":"ghost@docker","StartLocal":"2023-11-21T14:39:38.552466146+01:00","StartUTC":"2023-11-21T13:39:38.552466146Z","TLSCipher":"TLS_AES_128_GCM_SHA256","TLSVersion":"1.3","downstream_Strict-Transport-Security":"max-age=31536000; includeSubDomains","downstream_Vary":"Accept-Encoding","entryPointName":"websecure","level":"info","msg":"","origin_Strict-Transport-Security":"max-age=31536000; includeSubDomains","origin_Vary":"Accept-Encoding","request_Accept-Encoding":"gzip","request_Cdn-Loop":"cloudflare","request_Cf-Connecting-Ip":"92.159.32.169","request_Cf-Ipcountry":"FR","request_Cf-Ray":"82995705ece16353-LHR","request_Cf-Visitor":"{\"scheme\":\"https\"}","request_User-Agent":"Go-http-client/1.1","request_X-Forwarded-For":"92.159.32.169","request_X-Forwarded-Host":"HIDE","request_X-Forwarded-Port":"443","request_X-Forwarded-Proto":"https","request_X-Forwarded-Server":"7d5c04451a79","request_X-Real-Ip":"172.69.195.155","time":"2023-11-21T14:39:38+01:00"} ``` And in trafik log `INFO: GeoBlock: 2023/11/21 14:39:38 geoblock@file: request denied [172.69.195.155] for country [LV]`...
It would be great to add countries by continent like Africa, America, Asia, Europe, Oceania ... This list could help: https://gist.github.com/orenitamar/3207618
I installed this, and it works great 96% of the time. What happens is that when I'm moving from page to page, all is well. I can see in the...
Hello. It exists a way to log all the into a file : geoblock.log ? Thanks.