feat: implement geo-filtering with whitelist and blacklist support

- Added support for geo-filtering in the proxy pool, allowing configuration of allowed and blocked countries via environment variables.
- Updated `.env.example` and `docker-compose.yml` to include `ALLOWED_COUNTRIES` for whitelist functionality.
- Enhanced `CLAUDE.md`, `GEO_FILTER.md`, and `README.md` to document the new geo-filtering features and usage instructions.
- Modified proxy validation logic to prioritize whitelist over blacklist during admission checks.
- Improved WebUI to allow dynamic configuration of geo-filter settings.
This commit is contained in:
isboyjc
2026-04-01 21:45:09 +08:00
parent dfe71d0390
commit a06be637e7
14 changed files with 307 additions and 65 deletions

View File

@@ -110,6 +110,11 @@ func (m *Manager) NeedsFetch(status *PoolStatus) (bool, string, string) {
httpPct := float64(status.HTTP) / float64(status.HTTPSlots)
socks5Pct := float64(status.SOCKS5) / float64(status.SOCKS5Slots)
// 如果两个协议都缺(都<50%),同时补充两个协议
if httpPct < 0.5 && socks5Pct < 0.5 {
return true, "refill", ""
}
// 只有一个协议缺时,优先补充更缺的
if httpPct < 0.5 {
return true, "refill", "http"
}