alisinabh / atlas

A simple performant GeoIP server written in Rust using MaxMind DBs with auto database update
Apache License 2.0
44 stars 1 forks source link
geoip geoip-api geoip-lookup geoip2 geolocation maxmind maxmind-geoip

Atlas

Atlas

Atlas CI

Atlas is a geoip HTTP service built in Rust, designed to simplify IP GeoLocation by automatically managing MaxMind databases. It ensures that users have up-to-date IP data without the hassle of manual downloads and updates. This tool is perfect for services who need reliable and fast IP GeoLocation lookup in their applications using a very simple HTTP API.

Learn more about Atlas in my blog post here.

Features

Running Atlas

To run Atlas, you can choose one of the methods below.

Using Docker (Recommended)

We automatically build docker images of Atlas and push them to docker hub.

You can easily run our docker image which automatically downloads the latest MaxMind DB like this.

docker run -it --rm \
  -e "MAXMIND_ACCOUNT_ID={account id here}" \
  -e "MAXMIND_LICENSE_KEY={license_key_here}" \
  -p 8080:8080 \
  alisinabh/atlas

Same image can be used for deploying Atlas to Kubernetes or other orchestration platforms. By default, the databases will be saved at /opt/atlas/db directory. It is recommended to mount this path to a persistant storage medium to avoid downloading a new DB on every restart.

For more configuration variables, visit Configuration section.

Compiling from source

Firstly, make sure you have rustc and cargo installed. Then after cloning the repository you can simply run the following command to build a release binary to use in your service.

cargo build --release

You can find the release binaries at target/release/atlas. Then you can run atlas by running ./target/release/atlas in your terminal. Make sure that the DB_PATH directory already exists otherwise atlas crashes on startup.

API Documentation

Atlas generates OpenApi 3.0 specifications for its APIs. We host our main branch docs at https://atlas-rs.fly.dev/swagger-ui/.

You can also enable the /swagger-ui endpoint locally or in your deployments by setting SWAGGER_UI_ENABLED to true.

Configuration

Atlas uses OS environment variables for configuration. Here are the list of environment variables that atlas looks into.

Contribution

Contributions to Atlas are very welcome! Before undertaking any substantial work, please consider opening an issue to discuss ideas and planned approaches so we can ensure we keep progress moving in the same direction. Always remember to be respectful of others.

License

Apache License 2.0