Add public-ipv4/public-ipv6 config options for manual IP override

On some servers ifconfig.co is unreachable (e.g. Hetzner, AdGuard DNS
blocklists), causing 'mtg doctor' SNI-DNS check and 'mtg access' link
generation to fail. New config options allow specifying public IPs
manually, with automatic detection as fallback.

Fixes #405
This commit is contained in:
Alexey Dolotov
2026-03-29 00:47:49 +03:00
parent cc4b6ce2f4
commit 2b07c0037e
9 changed files with 63 additions and 3 deletions
+6
View File
@@ -58,6 +58,9 @@ func (a *Access) Run(cli *CLI, version string) error {
wg.Go(func() {
ip := a.PublicIPv4
if ip == nil {
ip = conf.PublicIPv4.Get(nil)
}
if ip == nil {
ip = getIP(ntw, "tcp4")
}
@@ -70,6 +73,9 @@ func (a *Access) Run(cli *CLI, version string) error {
})
wg.Go(func() {
ip := a.PublicIPv6
if ip == nil {
ip = conf.PublicIPv6.Get(nil)
}
if ip == nil {
ip = getIP(ntw, "tcp6")
}