No longer able to mirror some Github repos: "migration/cloning from 'github.com' is not allowed"

I’ve been running the same instance of Gitea for a long while with no problems. Recently I upgraded my 1.26 to 28.0 and then 28.1 in quick succession. Now suddenly the handful of Github repos I mirror locally are getting errors when trying to sync. The logs show entries like:

2026/10/17 00:07:04 .../mirror/mirror_pull.go:118:runSync() [E] SyncMirrors [repo: <Repository 99:github/Yaesu_Web_Control>]: remote URL is not allowed: migration/cloning from '``github.com``' is not allowed.

All of my mirror repos are via regular https. If I go into a repo’s settings and simply try to update any of the “Mirror Settings”, I get:

You cannot import from disallowed hosts. Please ask the admin to check the ALLOWED_HOST_LIST/BLOCKED_HOST_LIST settings in the [migrations] section.

Okay, but I’ve tried numerous variations of my app.ini trying to get “github.com” allowed (with and without wildcards, port numbers, other settings, etc). I’m just running the Gitea binary on a Linux server directly, and there’s nothing funky about my home LAN setup.

The seemingly pertinent parts of the current app.ini:

[security]
INSTALL_LOCK = true
INTERNAL_TOKEN = (redacted)
PASSWORD_HASH_ALGO = pbkdf2
;;;; Attempting various combinations of:
;;ALLOWED_HOST_LIST = 192.168.199.0/24:, github.com:, .github.com:
;;ALLOWED_HOST_LIST = github.com, 192.168.199.0/24:, github.com:, .github.com:, loopback:, private:
ALLOWED_HOST_LIST=github.com
;;BLOCKED_HOST_LIST=
ALLOWED_DOMAINS=*
BLOCKED_DOMAINS=
;;;; Tried various combinations of 'lax' and 'strict':
EGRESS_MODE = lax
DISABLE_WEBHOOKS = false
DISABLE_GIT_HOOKS = false
REVERSE_PROXY_LIMIT = 1
REVERSE_PROXY_TRUSTED_PROXIES = *

;; I'm not running a proxy:
[proxy]
PROXY_ENABLED = false

[migrations]
;;;; Trying various combinations of 'lax' and 'strict':
EGRESS_MODE = lax
;;;; Attempting various combinations of:
;;ALLOWED_HOST_LIST = github.com, 192.168.199.0/24:, github.com:, .github.com:, loopback:, private:
;;ALLOWED_HOST_LIST = github.com
ALLOWED_HOST_LIST=github.com,github.com:*
BLOCKED_HOST_LIST=foobarbaz.com

[mirror]
ENABLED = true

My only other thought is maybe there’s another setting I might have missed to add earlier, as this Gitea instance has been running since maybe 1.15 or so and might have missed getting another setting added to app.ini. I’ve poked around the Go source but nothing is jumping out at me as far as the cause.

Any ideas?

Hey, sorry for the issue. It should work out of the box, especially in lax config as github.com addresses are public. Does it resolve to some private address instead of public ones in your network? That’s the only idea I can think of right now.

On the same server (outside of Gitea) I can plain (command line) ‘git clone’ a repo from github.com, so it’s not a network issue. In my Gitea I also just tried to migrate https://gitea.com/gitea/runner.git which actually worked despite my app.ini not mentioning that host anywhere. Also a ‘doctor check’ comes back with no problems.

none of this is related as the error is from internal policy filter. It should block private/problematic ranges by default but leave public ones callable (unless it’s strict). What does github.com resolve to?

Outside of Gitea everything seems to resolve fine on the same server (if that’s what your asking):

$ ping github.com
PING github.com (140.82.114.4) 56(84) bytes of data.
64 bytes from lb-140-82-114-4-iad.github.com (140.82.114.4): icmp_seq=1 ttl=47 time=20.2 ms
64 bytes from lb-140-82-114-4-iad.github.com (140.82.114.4): icmp_seq=2 ttl=47 time=20.5 ms

$ host github.com
github.com has address 140.82.114.4
github.com has IPv6 address 64:ff9b::8c52:7204
github.com mail is handled by 0 github-com.mail.protection.outlook.com.

And since all the mirroring was operating fine prior to me upgrading to 28.x last week I’m assuming there’s something that got missed in my app.ini.

the ipv6 address explains it as it’s just nat64 embed of ipv4 and that’s blocked since they require additional decode and I figured it was unneeded for most users. Though what you found is a bug as afaik dialer would move to ipv4 and work in the end and check is failing early on nat address. I’ll look into it and fix that logic…

Ok. My home lan is sitting behind a opnsense router, and I’m only doing ipv4 on the lan purely out of simplicity. Would enabling ipv6 on the lan fix the issue?