feat(publicip): resilient public ip fetcher (#2518)
- `PUBLICIP_API` accepts a comma separated list of ip data sources, where the first one is the base default one, and sources after it are backup sources used if we are rate limited. - `PUBLICIP_API` defaults to `ipinfo,ifconfigco,ip2location,cloudflare` such that it now has `ifconfigco,ip2location,cloudflare` as backup ip data sources. - `PUBLICIP_API_TOKEN` accepts a comma separated list of ip data source tokens, each corresponding by position to the APIs listed in `PUBLICIP_API`. - logs ip data source when logging public ip information - assume a rate limiting error is for 30 days (no persistence) - ready for future live settings updates - consider an ip data source no longer banned if the token changes - keeps track of ban times when updating the list of fetchers
This commit is contained in:
@@ -30,6 +30,10 @@ func (c *cloudflare) CanFetchAnyIP() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (c *cloudflare) Token() (token string) {
|
||||
return ""
|
||||
}
|
||||
|
||||
// FetchInfo obtains information on the public IP address of the machine,
|
||||
// and returns an error if the `ip` argument is set since the Cloudflare API
|
||||
// can only be used to provide details about the current machine public IP.
|
||||
|
||||
Reference in New Issue
Block a user