Cannot detect public IP address: ifconfig.co is unreachable for both IPv4 and IPv6
Hi
Using the ifconfig.co service to check IP addresses is hardcoded, and that's not a good idea!
On some servers, this site is unavailable, and when launching mtg doctor, we get an error.
It would be better to use multiple IP address checking services, for example
https://api4.ipify.org
https://ipv4.icanhazip.com
https://v4.api.ipinfo.io/ip
https://ipv4.myexternalip.com/raw
https://4.ident.me
https://check-host.net/ip
Thank's
This is possible, sure. But I'm very curious where is ifconfig.co blocked, can you share? Just for self-education
This is possible, sure. But I'm very curious where is ifconfig.co blocked, can you share? Just for self-education
Adguard dns, есть список блокировки трекеров и там заблокирован этот сайт: ShadowWhisperer Tracking List ||ifconfig.co^
Если это AdGuard или какой другой внешний сервис, просто добавьте их ip в hosts. Кроме того, если AdGuard крутится в виде AdGuard Home, домен можно внести в белый список
Я просто как пример привёл. Понятно, что проще нам добавить в список исключений ifconfig.co или просто вбить руками свой ip в ссылку, чем Вам загружать код ненужными вещами.
I'm running MTG on a server hosted by Hetzner, and ifconfig.co is blocked there. I think there are many providers, especially in Russia, where one or another IP checker service might be blocked. So, you need to check against a list of such services.
There's also a problem with the output of
mtg access /etc/mtg/config.toml
if the MTG can't determine the IP address
Only the secret part of the JSON configuration is output
ipv4 is not output!
# mtg doctor /etc/mtg/config.toml
Deprecated options
✅ All good
Time skewness
✅ Time drift is -1.321364ms, but tolerate-time-skewness is 5s
Validate native network connectivity
✅ DC 1
✅ DC 2
✅ DC 3
✅ DC 4
✅ DC 5
✅ DC 203
Validate fronting domain connectivity
✅ xxxx.xxxx:443 is reachable
Validate SNI-DNS match
‼️ cannot detect public IP address: ifconfig.co is unreachable for both IPv4 and IPv6
# mtg access /etc/mtg/config.toml
{
"secret": {
"hex": "eeXXXXXXXXXXX",
"base64": "XXXXXXX"
}
}
По мне лучше тогда добавить пункт в конфиге, где можно руками вбить свой IP, а не гадать какой сервис разблокирован
@6apakyda думаю, это хорошая идея
PR: #418
Добавил два опциональных параметра в конфиг: public-ipv4 и public-ipv6. Если задан — используется вместо ifconfig.co. Если не задан — текущее поведение (автодетект через ifconfig.co) сохраняется.
Работает и в mtg doctor (SNI-DNS проверка), и в mtg access (генерация ссылок). В mtg access приоритет: CLI флаг → конфиг → автодетект.