PascalMinder / geoblock

Traefik middleware plugin - Deny requests based on country of origin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BlackListMode not working

fdegraeve opened this issue · comments

Hello,

I try to enabled the BlackListMode is not working.

I try this

  middlewares:
    geoblock:
      plugin:
        GeoBlock:
          allowLocalRequests: true
          logLocalRequests: false
          logAllowedRequests: false
          logApiRequests: false
          api: "https://get.geojs.io/v1/ip/country/{ip}"
          apiTimeoutMs: 800
          cacheSize: 25
          forceMonthlyUpdate: true
          allowUnknownCountries: false
          unknownCountryApiResponse: "nil"
          backListMode: true
          countries:
            - IL # Israel

or this

  middlewares:
    geoblock:
      plugin:
        GeoBlock:
          allowLocalRequests: true
          logLocalRequests: false
          logAllowedRequests: false
          logApiRequests: false
          api: "https://get.geojs.io/v1/ip/country/{ip}"
          apiTimeoutMs: 800
          cacheSize: 25
          forceMonthlyUpdate: true
          allowUnknownCountries: false
          unknownCountryApiResponse: "nil"
          blacklist: true
          countries:
            - IL # Israel

It's never work.
The logs.

INFO: GeoBlock: 2023/05/14 20:12:20 allow local IPs: true
INFO: GeoBlock: 2023/05/14 20:12:20 log local requests: false
INFO: GeoBlock: 2023/05/14 20:12:20 log allowed requests: false
INFO: GeoBlock: 2023/05/14 20:12:20 log api requests: false
INFO: GeoBlock: 2023/05/14 20:12:20 API uri: https://get.geojs.io/v1/ip/country/{ip}
INFO: GeoBlock: 2023/05/14 20:12:20 API timeout: 800
INFO: GeoBlock: 2023/05/14 20:12:20 cache size: 25
INFO: GeoBlock: 2023/05/14 20:12:20 force monthly update: true
INFO: GeoBlock: 2023/05/14 20:12:20 allow unknown countries: false
INFO: GeoBlock: 2023/05/14 20:12:20 unknown country api response: nil
INFO: GeoBlock: 2023/05/14 20:12:20 allowed countries: [IL]
INFO: GeoBlock: 2023/05/14 20:12:38 geoblock@file: request denied [x.x.x.x] for country [FR]

Thanks for your help.

Ok find it, just typo on Readme. I open this PR for fix: #36

Hi @fdegraeve

Thank you for your contribution. I am currently on holiday. I'll review it afterwards (about 3 weeks).

Fixed by #36