docs: correct ALLOW_LOCALNETWORKS description in app.example.ini - #39240
Open
rawsun007 wants to merge 1 commit into
Open
docs: correct ALLOW_LOCALNETWORKS description in app.example.ini#39240rawsun007 wants to merge 1 commit into
rawsun007 wants to merge 1 commit into
Conversation
The comment claimed ALLOWED_DOMAINS overrides this option. Since the migration URL validation hardening, checkByAllowBlockList returns on the block list before it consults the allow list, so a host listed in ALLOWED_DOMAINS is still rejected when it resolves to a private or loopback address and ALLOW_LOCALNETWORKS is false. Assisted-by: Claude (Claude Code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the
app.example.inihalf of #39224.The comment says:
That is no longer true.
checkByAllowBlockListinservices/migrations/migrate.goconsults the block list first and returns immediately:IsMigrateURLAllowedresolves the host withnet.LookupIPand passes the addresses in, so withALLOW_LOCALNETWORKS = falsea host that appears inALLOWED_DOMAINSis 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 ingitea/docs(both the English and zh-cn pages) per the issue; that is a separate repository, and the PR template says documentation changes go there, so I have not touched it. Happy to send that one too.I did not change behaviour — I have no opinion on whether block-before-allow is the right precedence, only that the comment describes the opposite of what the code does.
Disclosure: prepared with AI assistance (Claude, via Claude Code); the commit carries an
Assisted-by:trailer. I read the validation path rather than inferring it, and every quote above is from currentmain. Per your contributing guide, review replies here will be mine rather than an AI's.