geoip

command module
v0.0.0-...-8118545 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 10 Imported by: 0

README

geoip

Here is a ready to deploy ip geo location server, It works for both ip v4 and ip v6, However the underlying database is not that huge, It makes use of the OpenGeoFeed database found here,

How to use

Create docker-compose.yml like that:

version: "3.3"
services:
  geoip:
    container_name: geoip
    image: your_regisrty_ip:registry_port/geoip:latest
    build:
      context: .
      dockerfile: ./Dockerfile
    restart: always
    ports:
      - 8000:8000

Build and run:

docker compose --progress=plain build --no-cache --force-rm --pull geoip
docker compose push geoip
docker compose up -d --no-build --no-deps --force-recreate geoip

Web UI

Open in browser: http://localhost:8000

API Request

Request:

curl -X POST http://localhost:8000/getIpInfo/140.82.114.3

Response:

{"ip":"140.82.114.3","country":"US"}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cdn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳