Skip to content

Fast, scalable ip lookup service server implementation powered by fastify and maxmind

License

Notifications You must be signed in to change notification settings

cpuchain/ifconfig-server

Repository files navigation

Ifconfig-server

Fast, scalable ip lookup service server implementation powered by Fastify and MaxMind GeoLite2 DB

Live Servers

  • ifconfig.la (IPv4 only, no-logging, no-cloudflare, TOR friendly)

Highlights

  • Fast: Built on top of Fastify and node-maxmind library which supports faster IP query against any available libraries
  • Scalable: Built on nodejs's cluster API which splits workloads by core
  • Bug-free: Written from scratch using TypeScript
  • Low memory footprint: Aggregates concurrent request to a single file read operation, should complete under 100ms.
  • Cross-platform: Runs on any machine where node.js or docker is supported.

Requirements

Quickstart

Installation

  • Running via Docker Compose (Recommended)
  # Spawn a docker container
  $ docker compose up -d
  # Show docker logs
  $ docker compose logs -f
  • Running via source code
  $ git clone https://github.com/cpuchain/ifconfig-server
  $ cd ifconfig-server
  $ yarn
  $ yarn start

Configuration

See ./src/config.ts for available configuration environment values. (You can also use .env file to setup env values)

Cloudflare-Free

This server isn't resource intensive thus it could handle more than a thousand requests concurrently.

Therefore, it is advised not to host the website behind the cloudflare firewall unless required since it will block browser requests, command line requests, and especially tor users.

We recommend you set up an ifconfig-server behind the nginx proxy with basic configuration to prevent DOS abuse. See here about NGINX rate limiting.

Contact

Please use the Github issues.

License

By using this source code you must follow MaxMind's GeoLite2 End User License Agreement.

The source code of Ifconfig-server implementation is distributed with MIT LICENSE.

MaxMind GeoLite2 DB is distributed with Creative Commons License 4.0 as a part of the source code & release binary.

We do not distribute the latest version of MaxMind GeoLite2 DB and the GeoLite2 DB bundled with the source code is distributed as a part of the source code assuming you are the legit user of GeoLite2 End User License Agreement.

To run with the latest, accurate IP information you will need a MaxMind API key from their homepage. See more info about the registeration.