Skip to content

Self hosted GeoIP lookup tool written in Go

License

Notifications You must be signed in to change notification settings

michibiki-io/rest-geoip

 
 

Repository files navigation

rest-geoip

Go Report Card Golangci-lint Status Docker build Status Build Report

A self hosted geoip lookup application which provides a client with information about their IP address or any other. It uses the Maxmind GeoLite2-City database.

The webapp provides general geoip information. There is also an api available

GET  /api/ip              : Return client IP Address
GET  /api/geoip           : Return client Geoip information
GET  /api/geoip/:address  : Return Geoip information for "address"
PUT  /api/update          : Update the Maxmind database

The application doesn't provide a database. A PUT request to /api/update will update the database and will ideally be protected by an api key (header: X-API-KEY). If API_KEY env var is not set, then the application will set one on startup and notify via STDOUT

Screenshots of optional webapp

Light

light

Dark

light

Example nginx config

server {
	server_name geoip.domain.com

	listen [::]:443 ssl;
	listen 443 ssl;

	include ssl.conf;

	location / {
	  proxy_set_header        X-Real-IP $remote_addr;
	  proxy_pass              http://localhost:8080/;
	  proxy_read_timeout      600s;
	  proxy_send_timeout      600s;
	}
}

About

Self hosted GeoIP lookup tool written in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 85.1%
  • Shell 6.3%
  • JavaScript 6.2%
  • Dockerfile 2.2%
  • CSS 0.2%