Add IP-to-country geolocation service
Introduce a geoloc package that stores CIDR-to-country mappings in PostgreSQL using the native cidr type with a GiST index for fast containment lookups. Data comes from the ipverse/country-ip-blocks dataset added as a git submodule. A standalone geoloc-import command reads the TXT files from disk and bulk-loads them via COPY. probod wires the service and logs a warning when the table is empty. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
||||
[submodule "pkg/validator/data/disposable-email-domains"]
|
||||
path = pkg/validator/data/disposable-email-domains
|
||||
url = https://github.com/disposable-email-domains/disposable-email-domains.git
|
||||
[submodule "pkg/geoloc/data/country-ip-blocks"]
|
||||
path = pkg/geoloc/data/country-ip-blocks
|
||||
url = https://github.com/ipverse/country-ip-blocks.git
|
||||
|
||||
Reference in New Issue
Block a user