Home

Awesome

๐Ÿงฐ MyIP - A Better IP Toolbox

<div align="center">

IPCheck.ing Banner

<a href="https://trendshift.io/repositories/5332" target="_blank"><img src="https://trendshift.io/api/badge/repositories/5332" alt="jason5ng32%2FMyIP | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>

Mentioned in Awesome Self Hosted

GitHub Repo stars GitHub forks Docker Pulls

Website PWA

CodeQL Docker Build and Push

๐Ÿ‡บ๐Ÿ‡ธ English | ๐Ÿ‡จ๐Ÿ‡ณ ็ฎ€ไฝ“ไธญๆ–‡ | ๐Ÿ‡ซ๐Ÿ‡ท Franรงais

๐Ÿ‘‰ Demo: https://ipcheck.ing

Feel free to bookmark the demo or deploy your own.

Deploy with Docker

</div>

๐Ÿ‘€ Main Features

๐Ÿ“• How to Use

Deploying in a Node Environment

Make sure you have Node.js installed.

Clone the code:

git clone https://github.com/jason5ng32/MyIP.git

Install and build:

npm install && npm run build

Run:

npm start

The program will run on port 18966.

Using Docker

Click the 'Deploy to Docker' button at the top to complete the deployment. Or, use the following shell:

docker run -d -p 18966:18966 --name myip --restart always jason5ng32/myip:latest

๐Ÿ“š Environment Variable

You can use the program without adding any environment variables, but if you want to use some advanced features, you can add the following environment variables:

Variable NameRequiredDefault ValueDescription
BACKEND_PORTNo"11966"The running port of the backend part of the program
FRONTEND_PORTNo"18966"The running port of the frontend part of the program
SECURITY_RATE_LIMITNo"0"Controls the number of requests an IP can make to the backend server every 60 minutes (set to 0 for no limit)
SECURITY_DELAY_AFTERNo"0"Controls the first X requests from an IP every 20 minutes that are not subject to speed limits, and after X requests, the delay will increase
SECURITY_BLACKLIST_LOG_FILE_PATHNo"logs/blacklist-ip.log"Path setting. Records the list of IPs that triggered the limit after SECURITY_RATE_LIMIT is enabled
BING_MAP_API_KEYNo""API Key for Bing Maps, used to display the location of the IP on a map
ALLOWED_DOMAINSNo""Allowed domains for access, separated by commas, used to prevent misuse of the backend API
IPCHECKING_API_KEYNo""API Key for IPCheck.ing, used to obtain accurate IP geolocation information
IPINFO_API_TOKENNo""API Token for IPInfo.io, used to obtain IP geolocation information through IPInfo.io
IPAPIIS_API_KEYNo""API Key for IPAPI.is, used to obtain IP geolocation information through IPAPI.is
KEYCDN_USER_AGENTNo""The domain name when using KeyCDN, must contain https prefix. Used to obtain IP address information through KeyCDN
CLOUDFLARE_APINo""API Key for Cloudflare, used to obtain AS system information through Cloudflare
MAC_LOOKUP_API_KEYNo""API Key for MAC Lookup, used to obtain MAC address information
VITE_GOOGLE_ANALYTICS_IDYes""Google Analytics ID, used to track user behavior
VITE_CURL_IPV4_DOMAINNo""Provides the IPv4 domain for the CURL API to users
VITE_CURL_IPV6_DOMAINNo""Provides the IPv6 domain for the CURL API to users
VITE_CURL_IPV64_DOMAINNo""Provides the dual-stack domain for the CURL API to users

Note that if any of the CURL series environment variables are missing, the CURL API will not be enabled.

Using Environment Variables in a Node Environment

Create environment variables:

cp .env.example .env

Modify .env, and for example, add the following:

BACKEND_PORT=11966
FRONTEND_PORT=18966
BING_MAP_API_KEY="YOUR_KEY_HERE"
ALLOWED_DOMAINS="example.com"
IPCHECKING_API="YOUR_KEY_HERE"

Then restart the backend service.

Using Environment Variables in Docker

You can add environment variables when running Docker, for example:

docker run -d -p 18966:18966 \
  -e BING_MAP_API_KEY="YOUR_KEY_HERE" \
  -e ALLOWED_DOMAINS="example.com" \
  -e IPCHECKING_API="YOUR_TOKEN_HERE" \
  --name myip \
  jason5ng32/myip:latest

๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ’ป Advanced Usage

If you're using a proxy for internet access, consider adding this rule to your proxy configuration (modify it according to your client). This setup lets you check both your real IP and the IP when using the proxy:

# IP Testing
IP-CIDR,1.0.0.1/32,Proxy,no-resolve
IP-CIDR6,2606:4700:4700::1111/128,Proxy,no-resolve
DOMAIN,4.ipcheck.ing,DIRECT
DOMAIN,6.ipcheck.ing,DIRECT
# Rule Testing
DOMAIN,ptest-1.ipcheck.ing,Proxy1
DOMAIN,ptest-2.ipcheck.ing,Proxy2
DOMAIN,ptest-3.ipcheck.ing,Proxy3
DOMAIN,ptest-4.ipcheck.ing,Proxy4
DOMAIN,ptest-5.ipcheck.ing,Proxy5
DOMAIN,ptest-6.ipcheck.ing,Proxy6
DOMAIN,ptest-7.ipcheck.ing,Proxy7
DOMAIN,ptest-8.ipcheck.ing,Proxy8

๐Ÿ˜ถโ€๐ŸŒซ๏ธ Additional Notes

When version 2.0 was released, I said that 70% of the code for this program was not written by me, but by ChatGPT. After about 90 interactions, plus some minor manual adjustments, the entire codebase was completed.

Of course, the architecture and UI still required my own design.

With the release of version 3.0 and subsequent versions, the proportion of code written with the help of ChatGPT has gradually decreased, now estimated to be between 40% and 50%. On the contrary, in this process, I went from having no knowledge of JavaScript and Vue to being able to understand most of the JS code, and I can now write some on my own.

Thanks to AI, it has given me, an unemployed product manager, a rapid opportunity to learn programming.

๐ŸŒŸ Star History

Star History Chart