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%
Find a file
Paul Git 5d1dd2f4f1
Improve CI notification formatting and docker-compose structure
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.
2026-06-18 13:09:06 +07:00
.forgejo/workflows Improve CI notification formatting and docker-compose structure 2026-06-18 13:09:06 +07:00
public Add color-scheme meta tag for dark mode 2026-06-13 23:05:56 +07:00
scripts Add entrypoint script to bootstrap geodata on first container start 2026-06-13 14:49:25 +07:00
src fix: correct JSDoc bigint types and rangeToCidr null return for empty range 2026-05-17 08:37:10 +08:00
tests fix: correct JSDoc bigint types and rangeToCidr null return for empty range 2026-05-17 08:37:10 +08:00
.dockerignore feat: replace ISP display with ASN CIDR range footer 2026-05-16 12:11:08 +08:00
.env.example fix: prevent stale IP from browser caching 2026-06-13 16:13:45 +07:00
.gitignore Add package-lock.json to repository 2026-05-17 18:14:12 +08:00
.yamllint feat: migrate CI/CD to Forgejo Actions 2026-06-02 21:49:13 +07:00
AGENTS.md ci: overhaul workflow with validate/build/notify jobs and tini in Dockerfile 2026-06-07 13:25:12 +07:00
docker-compose.yml Improve CI notification formatting and docker-compose structure 2026-06-18 13:09:06 +07:00
Dockerfile fix: add bash, curl, unzip and scripts dir to runner image 2026-06-13 15:21:40 +07:00
eslint.config.mjs feat: add ESLint with flat config 2026-05-31 22:30:52 +07:00
LICENSE Enhanced script to allow different formats to be output. 2020-04-01 14:05:35 +02:00
package-lock.json 4.3.3 2026-06-13 23:06:06 +07:00
package.json 4.3.3 2026-06-13 23:06:06 +07:00
README.md Add PUID/PGID environment variables for container user mapping 2026-06-13 16:05:24 +07:00
REVIEW.md Add code review checklist for project-specific diff analysis 2026-06-12 05:58:30 +07:00
robots.txt Implemented IP location on HTML output usimg database from https://ip2location.com 2020-04-02 14:03:58 +02:00
server.js Self-host flag-icons instead of using CDN 2026-06-13 22:46:10 +07:00
vercel.json Display hostname under IP and add Vercel config 2026-03-29 18:18:59 +08:00

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.


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


MIT — see LICENSE.