A small Node.js/Express app that shows your public IP address in a clean web UI and via simple API endpoints.
https://ip.paulg.it
- JavaScript 59.1%
- CSS 26.4%
- HTML 8%
- Shell 4.9%
- Dockerfile 1.6%
Rename variables for consistency in the notify job. Update Pushover notifications to use HTML message format with named parameters and short commit hashes for cleaner display. Add document start marker and explicit volumes section to docker-compose.yml. |
||
|---|---|---|
| .forgejo/workflows | ||
| public | ||
| scripts | ||
| src | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .yamllint | ||
| AGENTS.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| eslint.config.mjs | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| REVIEW.md | ||
| robots.txt | ||
| server.js | ||
| vercel.json | ||
What's My IP
A Node.js/Express app that shows your public IP address with geolocation (city, region, country, ASN, CIDR) via local IP2Location LITE databases — no external API calls at runtime.
- Demo: https://ip.paulg.it
- License: MIT
Quick start (local)
git clone https://github.com/paulgit/whatsmyip.git
cd whatsmyip
npm install
Download geolocation databases (requires a free token from https://lite.ip2location.com):
cp .env.example .env
# set IP2LOCATION_TOKEN in .env
npm run download-geodata
npm run dev
The app runs without geodata — it returns the IP only.
Quick start (Docker)
docker build -t whatsmyip .
docker run --rm -p 3000:3000 -v ./geodata:/app/geodata:ro whatsmyip
Or with Compose (geodata volume is pre-configured):
docker compose up -d
API
| Endpoint | Description |
|---|---|
GET / |
HTML page |
GET /?format=json |
IP + geolocation as JSON |
GET /?format=text |
IP as plain text |
GET /api/ip |
{ "ip": "…" } |
GET /api/info |
{ "ip": "…", "city": "…", "asn": "…", … } |
GET /health |
{ "status": "ok", … } |
Configuration
| Variable | Required | Description |
|---|---|---|
PORT |
No | Server port (default: 3000) |
IP2LOCATION_TOKEN |
For geodata download only | Free token from lite.ip2location.com |
DEV_IP |
No | Override detected IP for local testing (e.g. 8.8.8.8) |
GEODATA_REFRESH_HOURS |
No | Auto-refresh databases on this interval |
PUID / PGID |
No | UID/GID the container runs as (default: 1000). Set to match your host user on Linux to fix volume permissions. |
Tests
npm test
Credits
- Geolocation: IP2Location LITE
- Flags: flag-icons
MIT — see LICENSE.