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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9e0b81a6b53fc8a2990728a13ba6c727391281c2593ab0988bf317e0c8c77c2
|
|
| MD5 |
d0d2e8718d7d26411fa9f8a4abbd05bb
|
|
| BLAKE2b-256 |
3653c9b99105505aecd59bb02c2fb5294b612e470a0a95381e628e9d81e1db0e
|
Provenance
The following attestation bundles were made for wya-0.2.1.tar.gz:
Publisher:
pypi.yml on gottaeat/wya
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wya-0.2.1.tar.gz -
Subject digest:
e9e0b81a6b53fc8a2990728a13ba6c727391281c2593ab0988bf317e0c8c77c2 - Sigstore transparency entry: 245696962
- Sigstore integration time:
-
Permalink:
gottaeat/wya@84e9a92ed58f85fecefcf78360e33184742d1f54 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/gottaeat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@84e9a92ed58f85fecefcf78360e33184742d1f54 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64f99db2a4c3961bd0411316f398bc45f90c3d831fa7cf7fc1a05ea5bb8dff9e
|
|
| MD5 |
327da4fa1e8237bebb9f30e3172a58ce
|
|
| BLAKE2b-256 |
f1131454770fff38c61cc017c84741554f2626c1c5fe162cf489e7dc72ededb3
|
Provenance
The following attestation bundles were made for wya-0.2.1-py2.py3-none-any.whl:
Publisher:
pypi.yml on gottaeat/wya
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wya-0.2.1-py2.py3-none-any.whl -
Subject digest:
64f99db2a4c3961bd0411316f398bc45f90c3d831fa7cf7fc1a05ea5bb8dff9e - Sigstore transparency entry: 245696964
- Sigstore integration time:
-
Permalink:
gottaeat/wya@84e9a92ed58f85fecefcf78360e33184742d1f54 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/gottaeat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@84e9a92ed58f85fecefcf78360e33184742d1f54 -
Trigger Event:
release
-
Statement type: