mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-18 07:12:51 +00:00
c0c573f7af
Fixes the `app.example.ini` half of #39224. The comment says: > If a domain is allowed by `ALLOWED_DOMAINS`, this option will be ignored. That is no longer true. `checkByAllowBlockList` in `services/migrations/migrate.go` consults the block list **first** and returns immediately: ```go if blockList.MatchHostName(hostName) || ipBlocked { return &git.ErrInvalidCloneAddr{Host: hostName, IsPermissionDenied: true} } // if we have an allow-list, check the allow-list before return to get the more accurate error if !allowList.IsEmpty() { ... } ``` `IsMigrateURLAllowed` resolves the host with `net.LookupIP` and passes the addresses in, so with `ALLOW_LOCALNETWORKS = false` a host that appears in `ALLOWED_DOMAINS` is still rejected once any resolved address is private or loopback — the allow list never gets a look. The reporter traced this to the validation hardening in #38324 / #38400, and the code matches their description. The new wording states the precedence rather than the old override claim. Scope: this only covers `custom/conf/app.example.ini`, which lives here. The same stale sentence is on the config cheat sheet in `gitea/docs` (both the English and zh-cn pages) per the issue; that is a separate repository. Assisted-by: Claude, via Claude Code