Generalizing GeoIP to be consumed by more services

This commit is contained in:
2025-12-29 14:46:55 -06:00
parent b6785b861a
commit 0070afde5d
17 changed files with 108 additions and 60 deletions

30
roles/GeoIP/README.md Normal file
View File

@@ -0,0 +1,30 @@
Geolocation by IP is a methodology
# Etymology
GeoIP is a shortening of geolocation by IP.
# Relevant Files and Software
This content is derived & packed by Arch, pulling regularly from [MaxMind](https://maxmind.com).
# Available Clients
The Python `geoip2` library can be used with snippets like below:
```
#!/usr/bin/env python3
import geoip2.database
import sys
with geoip2.database.Reader('/etc/nginx/conf/maxmind-geoip2.mmdb') as reader:
response = reader.country(sys.argv[1])
print(response.country.iso_code)
```
We also install the `geoiplookup` client from the GeoIP client.
# Equivalents or Competition
Whois and other tools can also provide corroboration or alternate responses for these queries.