Skip to content

fix: TRUSTED_PROXY accepts hostnames like mod_remoteip (#9210) - #9289

Open
jabrailkhalil wants to merge 9 commits into
FreshRSS:edgefrom
jabrailkhalil:fix/trusted-proxy-entries
Open

jabrailkhalil wants to merge 9 commits into
FreshRSS:edgefrom
jabrailkhalil:fix/trusted-proxy-entries

Conversation

@jabrailkhalil

@jabrailkhalil jabrailkhalil commented Sep 10, 2026 •

Copy link
Copy Markdown

Accept IP addresses, CIDR ranges and hostnames in trusted proxy entries. Resolve hostname IPv4/IPv6 addresses and cache them only within the current PHP execution: one HTTP request under Apache/PHP-FPM, or one CLI invocation. Empty, invalid and unresolved sources do not match.

Current-main integration

Current head: 2a73b211eace5d2b6ef70bde1639c9dabef7fa10; integrated edge 44fe0d8248f5ee7d096ec7c78550e5a74d4c2722 by a normal, conflict-free merge. The trusted-proxy change and regression expectations are preserved while both files incorporate new edge context. The net PR remains limited to 2 file(s).

Validation

Fresh isolated Linux validation passes PHP 8.3.6 dependency installation, full PHP/PHTML syntax checks, 781 PHPUnit tests / 1,523 assertions, full PHPCS, PHPStan and pinned typos. Separate Node 24.22.1 validation passes dependency installation plus the complete frontend ESLint, CSS Stylelint and Markdownlint checks (113 Markdown files). Tracked source remains unchanged after both environments.

Both trusted-proxy files incorporate the new edge context without a code conflict; the net PR remains limited to those two files. PHPCS was run outside /tmp so the repository temporary-directory exclusion cannot make the check vacuous. No rules, assertions or scope were relaxed. This does not claim every deployment DNS configuration or Apache/PHP-FPM integration was exercised.

These local checks are separate from current-head upstream CI authorization and maintainer review.

@Alkarex Alkarex added this to the 1.30.1 milestone Sep 10, 2026
Comment thread app/Utils/httpUtil.php Resolved
@Alkarex

Alkarex commented Sep 14, 2026

Copy link
Copy Markdown
Member

Now that #9301 is merged, could you please check whether the current PR might be adjusted?

@jabrailkhalil
jabrailkhalil force-pushed the fix/trusted-proxy-entries branch from 4f18465 to 68408bf Compare September 14, 2026 16:42
@jabrailkhalil jabrailkhalil changed the title fix: TRUSTED_PROXY accepts bare IPs and hostnames like mod_remoteip (#9210) fix: TRUSTED_PROXY accepts hostnames like mod_remoteip (#9210) Sep 14, 2026
@jabrailkhalil

Copy link
Copy Markdown
Author

Adjusted after #9301 in 68408bf6: the branch is rebased on the accepted bare-IP implementation, duplicate mask handling and tests were removed, and this PR now adds only hostname resolution plus its public-path tests. PHP 8.4 syntax checks and all 37 focused PHPUnit assertions pass.

Recreate the existing implementation from PR FreshRSS#9289 as a GitHub-verified commit to satisfy the signed-commit requirement. File contents are unchanged from 3d4ce5d.
Recreate the existing PR FreshRSS#9289 tests as a GitHub-verified commit. The final tree must match 3d4ce5d exactly; no behavior or test assertions change.
@jabrailkhalil
jabrailkhalil force-pushed the fix/trusted-proxy-entries branch from 3d4ce5d to 4ee0318 Compare September 19, 2026 09:06
@jabrailkhalil

Copy link
Copy Markdown
Author

The signed-commit blocker is now addressed: both commits on the current head 4ee0318 are GitHub-verified. I recreated the existing implementation and tests through the GitHub editor, then verified that the entire Git tree is exactly identical to the previous head 3d4ce5d (tree e4cc2677f53fd74f795b0b15c610a37585d1fe63).

No source code, assertions, or behavior changed. PHP syntax checks pass for both files; the full test suite was not rerun for this signature-only history replacement. The merge panel no longer reports the unsigned-commit requirement. The required tests and maintainer review are still pending.

@Alkarex Alkarex modified the milestones: 1.30.1, 1.31.0 Sep 19, 2026
@jabrailkhalil

Copy link
Copy Markdown
Author

I updated the branch from edge; the PR still changes only app/Utils/httpUtil.php and its regression tests. On current head 5e5ff5ff8078, I ran the full PHP suite on Linux/PHP 8.3.6: 747 tests, 1,411 assertions passed. Full PHPCS and PHPStan also pass. The new Automated tests and Zizmor runs report action_required; could a maintainer approve those workflow runs for this revision?

@jabrailkhalil

Copy link
Copy Markdown
Author

The previously pending workflows have now run successfully on 5e5ff5ff8078: Automated tests and Zizmor are green. Together with the 747-test local PHP run and static checks reported above, this is ready for maintainer review. The branch has no merge conflicts; I have kept the signed implementation unchanged rather than adding another update without a review need.

Preserve trusted-source hostname and upstream NAT64 regression tests.
@jabrailkhalil

jabrailkhalil commented Oct 4, 2026 •

Copy link
Copy Markdown
Author

I merged current edge (4e5e142c) in eb5549d7 and resolved the append conflict in the HTTP utility tests. Both the trusted-hostname cases and the upstream NAT64 cases are preserved. The PR still changes only the original two files relative to current edge; the conflict resolution adds no new behavior.

Validation on Linux/PHP 8.3.6: all 758 tests and 1,429 assertions pass, including 45 focused HTTP utility tests. PHP/PHTML syntax checks, PHPCS, PHPStan and XML configuration checks also pass. The existing DNS cache lifetime remains one PHP execution, as discussed in the earlier review. Fresh upstream CI is now required on this merge commit.

Current-head upstream CI is awaiting maintainer approval: Automated tests and Zizmor CI both report action_required; neither has executed its checks yet.

@jabrailkhalil

Copy link
Copy Markdown
Author

Integrated current edge 9c04882c in 1699d281 to clear the stale-base/BEHIND gate. No feature scope was added.

Fresh Windows PHP 8.4.26 validation passes all 45 httpUtilTest cases, changed-file PHPCS and PHPStan with the repository configuration. Full PHPUnit executes 754 tests / 39 failures, versus 744 tests / the same 39 failing test identities on clean current edge in the same environment; baseline source import was checked explicitly. The Windows-wide failures remain outside this PR and were not hidden or patched. This does not claim a green Linux suite, DNS behavior on every host, or the full make test-all matrix. The hostname regression assertions and current-edge HTTP fetching changes are preserved.

Could a maintainer approve the current-head workflows and review the integration? This update does not bypass any CI or review requirement.

@jabrailkhalil

jabrailkhalil commented Oct 24, 2026 •

Copy link
Copy Markdown
Author

I integrated edge 44fe0d82 in 2a73b211 without conflicts. Fresh isolated Linux validation passes PHP 8.3.6 dependency installation, full PHP/PHTML syntax checks, 781 PHPUnit tests / 1,523 assertions, full PHPCS, PHPStan and pinned typos. Separate Node 24.22.1 validation passes dependency installation plus the complete frontend ESLint, CSS Stylelint and Markdownlint checks (113 Markdown files). Tracked source remains unchanged after both environments. Upstream CI and review remain separate.

Could a maintainer approve the pending workflow runs for this head?

@Alkarex Alkarex modified the milestones: 1.31.0, 1.32.0 Nov 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants