From b6b2fdccac584813982dad3be1218df3a2e2ee27 Mon Sep 17 00:00:00 2001 From: tinkle-community Date: Tue, 28 Oct 2025 20:44:38 +0800 Subject: [PATCH] Security: Remove hardcoded credentials - Remove hardcoded API URL and auth token from pool/coin_pool.go - Update config.json.example with placeholder format - Credentials should now be configured via config.json file --- config.json.example | 4 ++-- pool/coin_pool.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.json.example b/config.json.example index 4b29cbbf..c78e943a 100644 --- a/config.json.example +++ b/config.json.example @@ -21,8 +21,8 @@ "scan_interval_minutes": 3 } ], - "coin_pool_api_url": "http://x.x.x.x:x/api/ai500/list?auth=", - "oi_top_api_url": "http://x.x.x.x:x/api/oi/top?auth=", + "coin_pool_api_url": "http://x.x.x.x:x/api/ai500/list?auth=YOUR_AUTH_TOKEN", + "oi_top_api_url": "http://x.x.x.x:x/api/oi/top?auth=YOUR_AUTH_TOKEN", "api_server_port": 8080, "max_daily_loss": 5.0, "max_drawdown": 10.0, diff --git a/pool/coin_pool.go b/pool/coin_pool.go index 5119b78f..67dbfcd5 100644 --- a/pool/coin_pool.go +++ b/pool/coin_pool.go @@ -19,7 +19,7 @@ type CoinPoolConfig struct { } var coinPoolConfig = CoinPoolConfig{ - APIURL: "http://43.128.34.180:30006/api/ai500/list?auth=admin123sadasd3r323", + APIURL: "", // 将通过config.json配置或SetCoinPoolAPI()设置 Timeout: 30 * time.Second, // 增加到30秒 CacheDir: "coin_pool_cache", } @@ -359,7 +359,7 @@ var oiTopConfig = struct { Timeout time.Duration CacheDir string }{ - APIURL: "http://43.128.34.180:30006/api/oi/top?auth=admin123sadasd3r323", + APIURL: "", // 将通过config.json配置或SetOITopAPI()设置 Timeout: 30 * time.Second, CacheDir: "coin_pool_cache", }