feat(ip-info): consolidate IP lookup, add ipinfo.io token support

Replace get_ip_info + get_cached_ip_info pair with a single unshackle.core.utils.ip_info module providing a normalized return shape across providers. Adds optional ipinfo_api_key config for the ipinfo.io Lite endpoint (higher rate limits, ASN/org/continent data), swaps the ipapi.co fallback for ip-api.in, and migrates all callers (service, gluetun, remote_service, api/handlers, DSNP, YT) to the new import path. Auth token is sent per-request and never attached to the shared session headers.
This commit is contained in:
imSp4rky
2026-05-04 22:20:43 -06:00
parent 8f4cac6c7b
commit a7af898617
9 changed files with 267 additions and 114 deletions
+2 -1
View File
@@ -13,7 +13,8 @@ import requests
from unshackle.core import binaries
from unshackle.core.proxies.proxy import Proxy
from unshackle.core.utilities import get_country_code, get_country_name, get_debug_logger, get_ip_info
from unshackle.core.utilities import get_country_code, get_country_name, get_debug_logger
from unshackle.core.utils.ip_info import get_ip_info
# Global registry for cleanup on exit
_gluetun_instances: list["Gluetun"] = []