All Projects → fgsch → libvmod-geoip2

fgsch / libvmod-geoip2

Licence: BSD-2-Clause license
A Varnish VMOD to query MaxMind GeoIP2 DB files

Programming Languages

c
50402 projects - #5 most used programming language
M4
1887 projects
Makefile
30231 projects
perl
6916 projects
shell
77523 projects

Projects that are alternatives of or similar to libvmod-geoip2

Libvmod Querystring
Query-string module for Varnish Cache
Stars: ✭ 85 (+129.73%)
Mutual labels:  module, varnish
libvmod-cfg
VMOD useful to access to contents of environment variables and local or remote files from VCL, usually for configuration purposes, including execution of Lua and JavaScript programs.
Stars: ✭ 20 (-45.95%)
Mutual labels:  varnish, vmod
docker-varnish
Varnish docker image used within EMGAG environments
Stars: ✭ 25 (-32.43%)
Mutual labels:  varnish, vmod
libvmod-redis
VMOD using the synchronous hiredis library API to access Redis servers from VCL.
Stars: ✭ 76 (+105.41%)
Mutual labels:  varnish, vmod
mmdbwriter
Go library for writing MaxMind DB (mmdb) files
Stars: ✭ 44 (+18.92%)
Mutual labels:  geoip2
companion-module-requests
Repository for tracking module requests
Stars: ✭ 60 (+62.16%)
Mutual labels:  module
ember-cli-new-version
A convention based update notification for Ember. With this addon, you can detect a new version and notify the user to refresh the page
Stars: ✭ 22 (-40.54%)
Mutual labels:  module
amd-cmd-hot-update-hmr
esl-hot-update: Hot update esl modules(AMD、CMD) when modifed. JS, LESS, tpl, component is all supported!
Stars: ✭ 25 (-32.43%)
Mutual labels:  module
geoip2.cr
MaxMind GeoIP2 Reader for Crystal
Stars: ✭ 15 (-59.46%)
Mutual labels:  geoip2
pkg-require
require node files relative to your package directory
Stars: ✭ 22 (-40.54%)
Mutual labels:  module
AdminOnSteroids
Various ProcessWire admin tweaks to boost productivity.
Stars: ✭ 39 (+5.41%)
Mutual labels:  module
guess-module
Guess.js integration for Nuxt.js with guess-webpack
Stars: ✭ 20 (-45.95%)
Mutual labels:  module
bar-horizontal
Create beautiful horizontal charts, that fit your terminal.
Stars: ✭ 36 (-2.7%)
Mutual labels:  module
puppetlabs-vcsrepo
Support for source control repositories
Stars: ✭ 228 (+516.22%)
Mutual labels:  module
nodejs-geoip2ws
Maxmind GeoIP2 Web Services for Node.js
Stars: ✭ 47 (+27.03%)
Mutual labels:  geoip2
gondul
Network management/monitoring system specialized for temporary events
Stars: ✭ 40 (+8.11%)
Mutual labels:  varnish
Godot-Share
Simple share text and/or image module for Godot Engine (Android & iOS)
Stars: ✭ 58 (+56.76%)
Mutual labels:  module
GeoIP2-CN
小巧精悍、准确、实用 GeoIP2 数据库
Stars: ✭ 3,965 (+10616.22%)
Mutual labels:  geoip2
webtrees-fancy-research-links
Fancy Research Links Module for webtrees
Stars: ✭ 20 (-45.95%)
Mutual labels:  module
Windows-Python-RAT
A New Microsoft Windows Remote Administrator Tool [RAT] with Python by Sir.4m1R.
Stars: ✭ 70 (+89.19%)
Mutual labels:  module

libvmod-geoip2

ci codecov

About

A Varnish master VMOD to query MaxMind GeoIP2 DB files.

For Varnish 6.0, 6.4, 6.5 and 6.6 refer to main branch. Older Varnish versions are no longer supported.

Requirements

To build this VMOD you will need:

  • make
  • a C compiler, e.g. GCC or clang
  • pkg-config
  • python-docutils or docutils in macOS [1]
  • Varnish master built from sources
  • libmaxminddb-dev in recent Debian/Ubuntu releases, maxminddb in macOS [1]. See also https://github.com/maxmind/libmaxminddb

If you are building from Git, you will also need:

  • autoconf
  • automake
  • libtool

You will also need to set PKG_CONFIG_PATH to the directory where varnishapi.pc is located before running autogen.sh and configure. For example:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Finally, to use it you will need one or more GeoIP2 or GeoLite2 binary databases. See https://dev.maxmind.com/.

Installation

From a tarball

To install this VMOD, run the following commands:

./configure
make
make check
sudo make install

The make check step is optional but it's good to know whether the tests are passing on your platform.

From the Git repository

To install from Git, clone this repository by running:

git clone --recursive https://github.com/fgsch/libvmod-geoip2

And then run ./autogen.sh followed by the instructions above for installing from a tarball.

Packages

See https://github.com/fgsch/libvmod-geoip2/wiki#packages.

Example

import geoip2;

sub vcl_init {
	new country = geoip2.geoip2("/path/to/GeoLite2-Country.mmdb");
}

sub vcl_recv {
	if (country.lookup("country/names/en", client.ip) != "Japan") {
		...
	}
}

More examples available at https://github.com/fgsch/libvmod-geoip2/wiki.

DB updates

To update the GeoIP2 DB, download the new file on the same filesystem as the old one and move it over. See also https://github.com/maxmind/geoipupdate.

License

This VMOD is licensed under BSD license. See LICENSE for details.

Note

  1. Using Homebrew, https://github.com/Homebrew/brew/.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].