Giter Site home page Giter Site logo

enrico204 / traefik-geoip-forwardauth Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 1.3 MB

A tiny server for Traefik ForwardAuth implementing ip blocking/allowing based on MaxMind data.

License: GNU Affero General Public License v3.0

Dockerfile 3.54% Makefile 16.00% JavaScript 6.51% Go 73.95%
geoip2 maxmind-geoip traefik traefik-middleware

traefik-geoip-forwardauth's Introduction

Traefik GeoIP

This project is a tiny server for Traefik ForwardAuth middleware implementing a allowlist/blocklist for IPs based on MaxMind data.

Currently, it's able to block IPs based on country of origin.

It has been tested with GeoLite2, however it should work also with GeoIP2 thanks to the library I'm using: https://github.com/oschwald/geoip2-golang

Usage

Usage of traefik-geoip-forwardauth:
  -action string
        Action on countries. If "allow", only those countries are allowed, others are blocked.
        If "block", only countries are blocked, others are allowed. (default "allow")
  -allow-empty-countries
        Whether to allow the request on empty results in country field (default block)
  -countries string
        Comma separated ISO country codes to allow or block (see action flag) (default "IT")
  -db string
        Database path (default "GeoLite2-Country.mmdb")
  -db-refresh-every duration
        After this period of time, the database file is re-read. (default 1h0m0s)
  -debug
        Debug mode (log verbose)
  -web-listen string
        HTTP Listener IP address and port (default ":8080")
  -web-timeout duration
        Timeout when reading/writing HTTP (default 30s)

This software does not implement downloading GeoIP2/GeoLite2 databases. There are official tools for this, like the maxmindinc/geoipupdate Docker image.

License

See LICENSE file.

traefik-geoip-forwardauth's People

Contributors

enrico204 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.