### Setting Up Development Environment Source: https://github.com/jason5ng32/myip/blob/main/CONTRIBUTING.md Instructions for setting up the development environment for the myip project, including installing Node.js, Vite, Vue3, cloning the repository, and installing dependencies. ```bash npm install ``` -------------------------------- ### Install and Run MyIP in Node.js Environment Source: https://github.com/jason5ng32/myip/blob/main/README_FR.md Steps to set up and run the MyIP project within a Node.js environment. This includes cloning the repository, installing dependencies, building the project, and starting the application. ```bash git clone https://github.com/jason5ng32/MyIP.git cd MyIP npm install && npm run build npm start ``` -------------------------------- ### Node.js Environment Setup Source: https://github.com/jason5ng32/myip/blob/main/README.md Demonstrates how to set up environment variables for a Node.js application by copying an example .env file and modifying it with specific values. ```bash cp .env.example .env BACKEND_PORT=11966 FRONTEND_PORT=18966 GOOGLE_MAP_API_KEY="YOUR_KEY_HERE" ALLOWED_DOMAINS="example.com" IPCHECKING_API="YOUR_KEY_HERE" ``` -------------------------------- ### Deploy MyIP with Docker Source: https://github.com/jason5ng32/myip/blob/main/README_FR.md Instructions for deploying the MyIP application using Docker, leveraging pre-built Docker images for easy setup and execution. ```bash docker run -d -p 18966:18966 --name myip jason5ng32/myip ``` -------------------------------- ### Clone and Build MyIP with Node.js Source: https://github.com/jason5ng32/myip/blob/main/README_ZH.md Instructions for cloning the MyIP repository, installing dependencies, and building the project using Node.js. This is for self-hosting the application. ```bash git clone https://github.com/jason5ng32/MyIP.git npm install && npm run build npm start ``` -------------------------------- ### Clone and Build MyIP with Node.js Source: https://github.com/jason5ng32/myip/blob/main/README.md Instructions for cloning the MyIP repository, installing dependencies, building the project, and running the application in a Node.js environment. The application will run on port 18966. ```bash git clone https://github.com/jason5ng32/MyIP.git npm install && npm run build npm start ``` -------------------------------- ### Proxy Configuration Rules Source: https://github.com/jason5ng32/myip/blob/main/README.md Provides example rules for proxy configuration to test real IP and proxy IP, and to bypass proxy for specific domains. ```ini # IP Testing IP-CIDR,1.0.0.2/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 ``` -------------------------------- ### Running Tests Source: https://github.com/jason5ng32/myip/blob/main/CONTRIBUTING.md Command to execute all tests for the myip project to ensure changes are valid. ```bash npm test ``` -------------------------------- ### Docker Deployment Source: https://github.com/jason5ng32/myip/blob/main/README_FR.md Instructions for deploying the myip application using Docker. This involves running a Docker container and exposing the necessary ports. ```bash docker run -d -p 18966:18966 --name myip --restart always jason5ng32/myip:latest ``` -------------------------------- ### Docker Deployment with Environment Variables Source: https://github.com/jason5ng32/myip/blob/main/README.md Shows how to run the myip Docker container in detached mode, mapping ports and setting environment variables for configuration. ```bash docker run -d -p 18966:18966 \ -e GOOGLE_MAP_API_KEY="YOUR_KEY_HERE" \ -e ALLOWED_DOMAINS="example.com" \ -e IPCHECKING_API="YOUR_TOKEN_HERE" \ --name myip \ jason5ng32/myip:latest ``` -------------------------------- ### Deploy MyIP with Docker Source: https://github.com/jason5ng32/myip/blob/main/README_ZH.md This snippet shows the command to run the MyIP application using Docker. It maps the container's port to the host and ensures the container restarts automatically. ```bash docker run -d -p 18966:18966 --name myip --restart always jason5ng32/myip:latest ``` -------------------------------- ### Deploy MyIP using Docker Source: https://github.com/jason5ng32/myip/blob/main/README.md Command to run the MyIP application as a Docker container. It maps port 18966 from the host to the container and ensures the container restarts automatically. ```bash docker run -d -p 18966:18966 --name myip --restart always jason5ng32/myip:latest ``` -------------------------------- ### Environment Variables Configuration Source: https://github.com/jason5ng32/myip/blob/main/README_FR.md Details on how to configure environment variables for the myip application, both in a Node.js environment and within Docker. This includes setting ports, security limits, and API keys. ```bash cp .env.example .env BACKEND_PORT=11966 FRONTEND_PORT=18966 GOOGLE_MAP_API_KEY="YOUR_KEY_HERE" ALLOWED_DOMAINS="example.com" IPCHECKING_API="YOUR_KEY_HERE" ``` ```bash docker run -d -p 18966:18966 \ -e GOOGLE_MAP_API_KEY="YOUR_KEY_HERE" \ -e ALLOWED_DOMAINS="example.com" \ -e IPCHECKING_API="YOUR_TOKEN_HERE" \ --name myip \ jason5ng32/myip:latest ``` -------------------------------- ### Proxy Configuration for IP Checking Source: https://github.com/jason5ng32/myip/blob/main/README_FR.md Advanced usage instructions for configuring proxy settings to check IP addresses, especially when behind a proxy. This includes rules for direct connections and proxying specific domains. ```ini # Test d'adresse IP IP-CIDR,1.0.0.2/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 ``` -------------------------------- ### Environment Variables Configuration Source: https://github.com/jason5ng32/myip/blob/main/README.md Lists and describes environment variables for configuring the myip program, including ports, security settings, API keys, and domains. Some variables are required for specific features to be enabled. ```APIDOC BACKEND_PORT: The running port of the backend part of the program. Default: "11966". FRONTEND_PORT: The running port of the frontend part of the program. Default: "18966". SECURITY_RATE_LIMIT: Controls the number of requests an IP can make to the backend server every 60 minutes. Set to 0 for no limit. Default: "0". SECURITY_DELAY_AFTER: 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. Default: "0". SECURITY_BLACKLIST_LOG_FILE_PATH: Path setting. Records the list of IPs that triggered the limit after SECURITY_RATE_LIMIT is enabled. Default: "logs/blacklist-ip.log". GOOGLE_MAP_API_KEY: API Key for Google Maps, used to display the location of the IP on a map. Default: "". ALLOWED_DOMAINS: Allowed domains for access, separated by commas, used to prevent misuse of the backend API. Default: "". IPCHECKING_API_KEY: API Key for IPCheck.ing, used to obtain accurate IP geolocation information. Default: "". IPINFO_API_TOKEN: API Token for IPInfo.io, used to obtain IP geolocation information through IPInfo.io. Default: "". IPAPIIS_API_KEY: API Key for IPAPI.is, used to obtain IP geolocation information through IPAPI.is. Default: "". IP2LOCATION_API_KEY: API Key for IP2Location.io, used to obtain IP geolocation information through IP2Location.io. Default: "". CLOUDFLARE_API: API Key for Cloudflare, used to obtain AS system information through Cloudflare. Default: "". MAC_LOOKUP_API_KEY: API Key for MAC Lookup, used to obtain MAC address information. Default: "". IPCHECKING_API_ENDPOINT: IPCheck.ing API endpoint. Required: Yes. VITE_GOOGLE_ANALYTICS_ID: Google Analytics ID, used to track user behavior. Required: Yes. VITE_CURL_IPV4_DOMAIN: Provides the IPv4 domain for the CURL API to users. Default: "". VITE_CURL_IPV6_DOMAIN: Provides the IPv6 domain for the CURL API to users. Default: "". VITE_CURL_IPV64_DOMAIN: Provides the dual-stack domain for the CURL API to users. Default: "". ``` -------------------------------- ### MyIP Environment Variables Table Source: https://github.com/jason5ng32/myip/blob/main/README_ZH.md A table listing the available environment variables for MyIP, their necessity, default values, and descriptions. This helps in customizing the application's functionality, such as setting ports, API keys, and security limits. ```APIDOC Environment Variables for MyIP: | Variable Name | Required | Default Value | Description | |----------------------------|----------|--------------------|------------------------------------------------------------------------------------------------------------| | `BACKEND_PORT` | No | "11966" | The port for the backend service. | | `FRONTEND_PORT` | No | "18966" | The port for the frontend service. | | `SECURITY_RATE_LIMIT` | No | "0" | Limits requests per IP per 60 minutes (0 means unlimited). | | `SECURITY_DELAY_AFTER` | No | "0" | Controls request delay for IPs exceeding the rate limit. | | `SECURITY_BLACKLIST_LOG_FILE_PATH` | No | "logs/blacklist-ip.log" | Path to log file for IPs triggering rate limits. | | `GOOGLE_MAP_API_KEY` | No | "" | API Key for Google Maps to display IP location on a map. | | `ALLOWED_DOMAINS` | No | "" | Comma-separated list of allowed domains to prevent API abuse. | | `IPCHECKING_API_KEY` | No | "" | API Key for IPCheck.ing for accurate IP geolocation. | | `IPINFO_API_TOKEN` | No | "" | API Token for IPInfo.io for IP geolocation. | | `IPAPIIS_API_KEY` | No | "" | API Key for IPAPI.is for IP geolocation. | | `IP2LOCATION_API_KEY` | No | "" | API Key for IP2Location.io for IP geolocation. | | `CLOUDFLARE_API` | No | "" | API Key for Cloudflare to retrieve AS system information. | | `MAC_LOOKUP_API_KEY` | No | "" | API Key for MAC Lookup services to get MAC address attribution. | | `IPCHECKING_API_ENDPOINT` | Yes | "" | The API endpoint URL for IPCheck.ing. | | `VITE_GOOGLE_ANALYTICS_ID` | Yes | "" | Google Analytics ID for tracking website visits. | | `VITE_CURL_IPV4_DOMAIN` | No | "" | Domain for providing CURL API for IPv4. | | `VITE_CURL_IPV6_DOMAIN` | No | "" | Domain for providing CURL API for IPv6. | | `VITE_CURL_IPV64_DOMAIN` | No | "" | Domain for providing CURL API for dual-stack networks. | Note: CURL API features are enabled only if at least one of the `VITE_CURL_` environment variables is provided. ``` -------------------------------- ### Configure MyIP Environment Variables Source: https://github.com/jason5ng32/myip/blob/main/README_ZH.md This section details how to set environment variables for MyIP, either by creating a .env file in Node.js projects or using the -e flag with Docker. These variables control various aspects of the application's behavior and features. ```bash # Example for .env file: BACKEND_PORT=11966 FRONTEND_PORT=18966 GOOGLE_MAP_API_KEY="YOUR_KEY_HERE" ALLOWED_DOMAINS="example.com" IPCHECKING_API="YOUR_KEY_HERE" # Example for Docker run command: docker run -d -p 18966:18966 \ -e GOOGLE_MAP_API_KEY="YOUR_KEY_HERE" \ -e ALLOWED_DOMAINS="example.com" \ -e IPCHECKING_API="YOUR_TOKEN_HERE" \ --name myip \ jason5ng32/myip:latest ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.