diff --git a/.github/workflows/configs/mlc-config.json b/.github/workflows/configs/mlc-config.json index ce8861388..39d187563 100644 --- a/.github/workflows/configs/mlc-config.json +++ b/.github/workflows/configs/mlc-config.json @@ -22,7 +22,7 @@ "pattern": "https://www.linode.com/docs/products/tools/api/guides/manage-api-tokens/" }, { - "pattern": "https://ipv6.ipleak.net/json" + "pattern": "https://(ip|ipv|v)6.+" }, { "pattern": "https://github.com/qdm12/ddns-updater/pkgs/container/ddns-updater" diff --git a/README.md b/README.md index 06674a64c..4d0d8f292 100644 --- a/README.md +++ b/README.md @@ -277,14 +277,26 @@ You can otherwise customize it with the following: - `google` using [https://domains.google.com/checkip](https://domains.google.com/checkip) - `spdyn` using [https://checkip.spdyn.de](https://checkip.spdyn.de/) - `ipleak` using [https://ipleak.net/json](https://ipleak.net/json) + - `icanhazip` using [https://icanhazip.com](https://icanhazip.com) + - `ident` using [https://ident.me](https://ident.me) + - `nnev` using [https://ip.nnev.de](https://ip.nnev.de) + - `wtfismyip` using [https://wtfismyip.com/text](https://wtfismyip.com/text) - You can also specify an HTTPS URL such as `https://ipinfo.io/ip` - `PUBLICIPV4_HTTP_PROVIDERS` gets your public IPv4 address only. It can be one or more of the following: - `ipleak` using [https://ipv4.ipleak.net/json](https://ipv4.ipleak.net/json) - `ipify` using [https://api.ipify.org](https://api.ipify.org) + - `icanhazip` using [https://ipv4.icanhazip.com](https://ipv4.icanhazip.com) + - `ident` using [https://v4.ident.me](https://v4.ident.me) + - `nnev` using [https://ip4.nnev.de](https://ip4.nnev.de) + - `wtfismyip` using [https://ipv4.wtfismyip.com/text](https://ipv4.wtfismyip.com/text) - You can also specify an HTTPS URL such as `https://ipinfo.io/ip` - `PUBLICIPV6_HTTP_PROVIDERS` gets your public IPv6 address only. It can be one or more of the following: - `ipleak` using [https://ipv6.ipleak.net/json](https://ipv6.ipleak.net/json) - `ipify` using [https://api6.ipify.org](https://api6.ipify.org) + - `icanhazip` using [https://ipv6.icanhazip.com](https://ipv6.icanhazip.com) + - `ident` using [https://v6.ident.me](https://v6.ident.me) + - `nnev` using [https://ip6.nnev.de](https://ip6.nnev.de) + - `wtfismyip` using [https://ipv6.wtfismyip.com/text](https://ipv6.wtfismyip.com/text) - You can also specify an HTTPS URL such as `https://ipinfo.io/ip` - `PUBLICIP_DNS_PROVIDERS` gets your public IPv4 address only or IPv6 address only or one of them (see #136). It can be one or more of the following: - `cloudflare` diff --git a/pkg/publicip/http/providers.go b/pkg/publicip/http/providers.go index 650122e9b..dc71827f9 100644 --- a/pkg/publicip/http/providers.go +++ b/pkg/publicip/http/providers.go @@ -12,12 +12,16 @@ import ( type Provider string const ( - Google Provider = "google" - Ifconfig Provider = "ifconfig" - Ipify Provider = "ipify" - Ipinfo Provider = "ipinfo" - Spdyn Provider = "spdyn" - Ipleak Provider = "ipleak" + Google Provider = "google" + Ifconfig Provider = "ifconfig" + Ipify Provider = "ipify" + Ipinfo Provider = "ipinfo" + Spdyn Provider = "spdyn" + Ipleak Provider = "ipleak" + Icanhazip Provider = "icanhazip" + Ident Provider = "ident" + Nnev Provider = "nnev" + Wtfismyip Provider = "wtfismyip" ) func ListProviders() []Provider { @@ -72,6 +76,14 @@ func (provider Provider) url(version ipversion.IPVersion) (url string, ok bool) url = "https://api.ipify.org" case Ipleak: url = "https://ipv4.ipleak.net/json" + case Icanhazip: + url = "https://ipv4.icanhazip.com" + case Ident: + url = "https://v4.ident.me" + case Nnev: + url = "https://ip4.nnev.de" + case Wtfismyip: + url = "https://ipv4.wtfismyip.com/text" } case ipversion.IP6: @@ -80,6 +92,14 @@ func (provider Provider) url(version ipversion.IPVersion) (url string, ok bool) url = "https://api6.ipify.org" case Ipleak: url = "https://ipv6.ipleak.net/json" + case Icanhazip: + url = "https://ipv6.icanhazip.com" + case Ident: + url = "https://v6.ident.me" + case Nnev: + url = "https://ip6.nnev.de" + case Wtfismyip: + url = "https://ipv6.wtfismyip.com/text" } case ipversion.IP4or6: @@ -96,6 +116,14 @@ func (provider Provider) url(version ipversion.IPVersion) (url string, ok bool) url = "https://checkip.spdyn.de" case Ipleak: url = "https://ipleak.net/json" + case Icanhazip: + url = "https://icanhazip.com" + case Ident: + url = "https://ident.me" + case Nnev: + url = "https://ip.nnev.de" + case Wtfismyip: + url = "https://wtfismyip.com/text" } }