Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wisepythagoras/geoip-service
An extensible GeoIP service that can be a REST API or command line tool
https://github.com/wisepythagoras/geoip-service
geoip geoip-api geoip-data geoip-db geoip-lookup geoip-server geoip-service geoip2 go golang mux rest-api
Last synced: 2 days ago
JSON representation
An extensible GeoIP service that can be a REST API or command line tool
- Host: GitHub
- URL: https://github.com/wisepythagoras/geoip-service
- Owner: wisepythagoras
- License: gpl-3.0
- Created: 2019-05-25T20:14:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-18T22:28:42.000Z (9 months ago)
- Last Synced: 2024-06-21T18:52:32.244Z (5 months ago)
- Topics: geoip, geoip-api, geoip-data, geoip-db, geoip-lookup, geoip-server, geoip-service, geoip2, go, golang, mux, rest-api
- Language: Go
- Homepage:
- Size: 120 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GeoIP Service
A GeoIP service that can be a REST API or command line tool.
## Building
The only dependencies that this app has are [Gin](https://github.com/gin-gonic/gin), for setting up a webserver, and [govalidator](github.com/asaskevich/govalidator), for validating input.
``` sh
go build .
```## Using
```
Usage of ./geoip-service:
-dns-servers string
The list of DNS servers. If not specified defaults to Cloudflare, Google, and OpenDNS
-domain string
A domain name
-ext-dir string
Specify the location of the folder containing the extensions
-ip string
An IP address
-pub-dir string
Specify the location of the public folder (to serve a front end)
-serve
Run the HTTP server
-sip string
The IP to serve on (127.0.0.1 will make it accessible only from localhost) (default "127.0.0.1")
-whitelist string
If specified, it will only allow (only used with -serve)
`````` sh
# To query right from the command line.
./geoip-service -domain one.one.one.one
./geoip-service -ip 1.1.1.1# To run the HTTP API.
./geoip-service -serve# To serve on a specific iface.
./geoip-service -serve -sip 0.0.0.0# You can also add a whitelist of IPs to allow to access the API and a custom list of
# DNS servers to query.
./geoip-service -serve -whitelist ./whitelist -sip 0.0.0.0 -dns-servers ./dns_servers
```The `-pub-dir` flag can be used to specify a front end application that calls all the APIs. There's an example of this in the [geoip-service-fe](https://github.com/wisepythagoras/geoip-service-fe) repository.
### Extensions
The app has an integrated extension engine which is mostly meant to be used when running it as an API server. An extension can register API endpoints, run cron jobs, and manage data on their own, which the main app can query. Below you'll find an example of an extension that queries data from a 3rd party IP list.
See the full documentation on extensions [here](https://github.com/wisepythagoras/geoip-service/tree/master/extension).
## License
Although the source code is licensed under GNU GPLv3, I prohibit the use of this code for the purpsoses of training any kind of AI model. This applies to any version of the source code and/or commit, historic, current, and/or new.