Draft
Conversation
added 9 commits
December 30, 2025 21:53
Author
|
saw to late that #1381 already exists, feel free to close my pr |
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.
resolves: #1208
Allows listening to Connections with a Proxy Protocol Header(detects v1 or v2 automatically) and sets x-real-ip accordingly.
Theoretically this would allow to remove the usage of x-real-ip in caddy or ha proxy configs but only if all connections have a proxy header which can be configured with a combination of a "proxy-protocol-allowed-cidrs" and "proxy-protocol-policy".
Also allows sending Proxy Protocol Headers if "proxy-protocol-send-version" is set but it isnt possible to get the correct port if the connection didnt sent a proxy protocol header(eg use-proxy is false and we only have the x-real-ip from for example ha proxy)
Tests are missing as well as i want to get feedback on the implementation before i start, also could do a refactor of my code here and there
Here is a compose file which configured haproxy to send proxy protocol headers(i set ko.local when building the image via npm run container), creates a subnet with a cidr and allows this cidr to use proxy headers in anubis, if traffic comes from a different cidr it gets rejected also if the traffic wouldnt have proxy protocol header.
One could change it when setting the policy to IGNORE but then x-real-ip has to be passed in from haproxy
Checklist:
[Unreleased]section of docs/docs/CHANGELOG.mdnpm run test:integration(unsupported on Windows, please use WSL)