Skip to main content

wya

Project description

wya

wya is an ip asn and geolocation lookup tool built with flask and geolite2 databases. it dumps out a json that is similar to ipinfo.io, with additional ptr record validation.

# get a pong
$ curl https://ip.example.com/ping
PONG

# query a specific public ip
$ curl https://ip.example.com/`dig +short facebook.com`
{
  "ip": "157.240.253.35",
  "asn": "AS32934",
  "org": "FACEBOOK",
  "hostname": [
    {
      "edge-star-mini-shv-02-fra5.facebook.com.": {
        "resolves_back": true
      }
    }
  ],
  "country": "DE",
  "city": "Frankfurt am Main",
  "region": "Hesse",
  "loc": "50.1187,8.6842",
  "tz": "Europe/Berlin"
}

# query your own ip
$ curl https://ip.example.com
{
  "ip": "93.184.215.14",
  "asn": "AS15133",
  "org": "EDGECAST",
  "hostname": null,
  "country": "US",
  "city": null,
  "region": null,
  "loc": "37.751,-97.822",
  "tz": "America/Chicago"
}

installation

# 1. get the compose file
mkdir wya/; cd wya/
curl -LO \
    https://raw.githubusercontent.com/gottaeat/wya/master/docker-compose.yml

# 2. create the volume mount for geolite2 databases
mkdir data/
for i in ASN City; do
    curl -Lo ./data/GeoLite2-${i}.mmdb https://git.io/GeoLite2-${i}.mmdb
done

# 3. docker compose up
docker compose up -d

wya takes a SIGHUP to reload the databases without service interruption.

example reverse proxy setup

server {
    listen 80;
    server_name ip.example.com;

    return 301 https://$host:443$request_uri;
}

server {
    listen 443 ssl;
    server_name ip.example.com;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Connection $http_connection;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wya-0.2.1.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wya-0.2.1-py2.py3-none-any.whl (18.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file wya-0.2.1.tar.gz.

File metadata

  • Download URL: wya-0.2.1.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for wya-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e9e0b81a6b53fc8a2990728a13ba6c727391281c2593ab0988bf317e0c8c77c2
MD5 d0d2e8718d7d26411fa9f8a4abbd05bb
BLAKE2b-256 3653c9b99105505aecd59bb02c2fb5294b612e470a0a95381e628e9d81e1db0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for wya-0.2.1.tar.gz:

Publisher: pypi.yml on gottaeat/wya

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wya-0.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: wya-0.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for wya-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 64f99db2a4c3961bd0411316f398bc45f90c3d831fa7cf7fc1a05ea5bb8dff9e
MD5 327da4fa1e8237bebb9f30e3172a58ce
BLAKE2b-256 f1131454770fff38c61cc017c84741554f2626c1c5fe162cf489e7dc72ededb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for wya-0.2.1-py2.py3-none-any.whl:

Publisher: pypi.yml on gottaeat/wya

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page