feat: Allow multiple options in request_ip_source #1985

Merged
Aranjedeath merged 2 commits from Omar007/continuwuity:feature/ip-src-fallback into main 2026-07-21 14:35:55 +00:00

2 commits

Author SHA1 Message Date
e0737beb16 chore: Add towncrier news fragment
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m22s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m15s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m2s
2026-07-18 20:48:50 +02:00
e4161cee0d feat: Introduce accepted_ip_sources as a multiple options variant of request_ip_source
The current `request_ip_source` setting only allows a single option.
While it does fall back to the peer IP if the header is missing as of !2003,
which likely covers a lot of regular use, only allowing a single option limits
the deployment options available to more advanced deployments.
Setups where internal and external traffic use different reverse proxies will
end up with the wrong IP and the implicitness of the fallback allows for
situations where the used IP is not the IP expected.

By introducing a setting that allows multiple options to be set,
this limitation is resolved and it becomes possible to have client IP resolution
behind different reverse proxies and also making it possible to decide if and/or
what the fallback should be.

If set, options are evaluated in order. If all fail, the request fails.
2026-07-18 20:48:45 +02:00