traefik-plugin-geoblock

Build Status
Go Report Card
Latest GitHub release
License

traefik-plugin-geoblock is a traefik plugin to whitelist requests based on geolocation

This projects includes IP2Location LITE data available from lite.ip2location.com.

Configuration

Static

Local

experimental:
  localPlugins:
    geoblock:
      moduleName: github.com/kucjac/traefik-plugin-geoblock

Pilot

pilot:
  token: "xxxxxxxxx"

experimental:
  plugins:
    geoblock:
      moduleName: github.com/kucjac/traefik-plugin-geoblock
      version: v0.2.0

Dynamic

http:
  middlewares:
    geoblock:
      plugin:
        geoblock:
          # Whether or not to enable geoblocking.
          enabled: true
          # Path to the ip2location database.
          databaseFilePath: /plugins-local/src/github.com/kucjac/traefik-plugin-geoblock/IP2LOCATION-LITE-DB1.IPV6.BIN
          # Countries to allow requests from, using ISO 3166-1 alpha-2 codes.
          # See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
          # Either allowedCountries or disallowedCountries could be set at once.
          allowedCountries: [ "AT", "CH", "DE" ]
          # Countries from which requests are forbidden, using ISO 3166-1 alpha-2 codes.
          # Either allowedCountries or disallowedCountries could be set at once.
          disallowedCountries: [ "AT", "CH", "PL" ]

          # Whether or not requests from private networks should be allowed.
          allowPrivate: true

GitHub

View Github