Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jason5ng32 committed Apr 11, 2024
1 parent d730c22 commit c233c4a
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BING_MAP_API_KEY=""
ALLOWED_DOMAINS=""
IPINFO_API_TOKEN=""
KEYCDN_USER_AGENT=""
IPChecking_API_KEY=""
IPCHECKING_API_KEY=""
CLOUDFLARE_API=""
VITE_RECAPTCHA_SITE_KEY=""
RECAPTCHA_SECRET_KEY=""
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ You can use the program without adding any environment variables, but if you wan
| `PORT` | No | `18966` | The port on which the program runs |
| `BING_MAP_API_KEY` | No | `""` | API Key for Bing Maps, used to display the location of the IP on a map |
| `ALLOWED_DOMAINS` | No | `""` | Allowed domains for access, separated by commas, used to prevent misuse of the backend API |
| `IPChecking_API_KEY` | No | `""` | API Key for IPCheck.ing, used to obtain accurate IP geolocation information |
| `IPCHECKING_API_KEY` | No | `""` | API Key for IPCheck.ing, used to obtain accurate IP geolocation information |
| `IPINFO_API_TOKEN` | No | `""` | API Token for IPInfo.io, used to obtain IP geolocation information through IPInfo.io |
| `KEYCDN_USER_AGENT` | No | `""` | The domain name when using KeyCDN, must contain https prefix. Used to obtain IP address information through KeyCDN |
| `CLOUDFLARE_API` | No | `""` | API Key for Cloudflare, used to obtain AS system information through Cloudflare |
Expand Down
2 changes: 1 addition & 1 deletion README_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Vous pouvez utiliser le programme sans ajouter de variables d'environnement, mai
| `PORT` | Non | `18966` | Le port sur lequel le programme s'exécute |
| `BING_MAP_API_KEY` | Non | `""` | Clé API pour Bing Maps, utilisée pour afficher l'emplacement de l'adresse IP sur une carte |
| `ALLOWED_DOMAINS` | Non | `""` | Domaines autorisés pour l'accès, séparés par des virgules, utilisés pour empêcher une utilisation abusive de l'API backend |
| `IPChecking_API_KEY` | Non | `""` | Clé API pour IPCheck.ing, utilisée pour obtenir des informations de géolocalisation précises sur l'adresse IP |
| `IPCHECKING_API_KEY` | Non | `""` | Clé API pour IPCheck.ing, utilisée pour obtenir des informations de géolocalisation précises sur l'adresse IP |
| `IPINFO_API_TOKEN` | Non | `""` | Jeton API pour IPInfo.io, utilisé pour obtenir des informations de géolocalisation sur l'adresse IP via IPInfo.io |
| `KEYCDN_USER_AGENT` | Non | `""` | Le nom de domaine lorsque vous utilisez KeyCDN, doit contenir le préfixe https. Utilisé pour obtenir des informations sur l'adresse IP via KeyCDN |
| `CLOUDFLARE_API` | Non | `""` | Clé API pour Cloudflare, utilisée pour obtenir des informations sur le système AS via Cloudflare |
Expand Down
2 changes: 1 addition & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ docker run -d -p 18966:18966 --name myip --restart always jason5ng32/myip:latest
| `PORT` || `18966` | 程序运行的端口 |
| `BING_MAP_API_KEY` || `""` | Bing 地图的 API Key,用于展示 IP 所在地的地图 |
| `ALLOWED_DOMAINS` || `""` | 允许访问的域名,用逗号分隔,用于防止后端 API 被滥用 |
| `IPChecking_API_KEY` || `""` | IPCheck.ing 的 API Key,用于获取精准的 IP 归属地信息 |
| `IPCHECKING_API_KEY` || `""` | IPCheck.ing 的 API Key,用于获取精准的 IP 归属地信息 |
| `IPINFO_API_TOKEN` || `""` | IPInfo.io 的 API Token,用于通过 IPInfo.io 获取 IP 归属地信息 |
| `KEYCDN_USER_AGENT` || `""` | 使用 KeyCDN 时的域名,需包含 https 前缀。用于通过 KeyCDN 获取 IP 归属地信息 |
| `CLOUDFLARE_API` || `""` | Cloudflare 的 API Key,用于通过 Cloudflare 获取 AS 系统的信息 |
Expand Down
1 change: 0 additions & 1 deletion api/cfradar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { get } from 'https';

// 创建一个用于设置 headers 的通用函数
function createFetchOptions() {
Expand Down
2 changes: 1 addition & 1 deletion api/configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default (req, res) => {
const envConfigs = {
bingMap: process.env.BING_MAP_API_KEY,
ipInfo: process.env.IPINFO_API_TOKEN,
ipChecking: process.env.IPChecking_API_KEY,
ipChecking: process.env.IPCHECKING_API_KEY,
keyCDN: process.env.KEYCDN_USER_AGENT,
originalSite,
cloudFlare: process.env.CLOUDFLARE_API,
Expand Down
2 changes: 1 addition & 1 deletion api/ipchecking.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default (req, res) => {

const lang = req.query.lang || 'en';

const key = process.env.IPChecking_API_KEY;
const key = process.env.IPCHECKING_API_KEY;

// 构建请求 IPCheck.ing 的 URL
const url = new URL(`https://api.ipcheck.ing/ipinfo?key=${key}&ip=${ipAddress}&lang=${lang}`);
Expand Down

0 comments on commit c233c4a

Please sign in to comment.