Skip to content

Update functions.php for Caddy #1210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

lilrags16
Copy link

This change gets the left most IP address from the X-Forward-For header. This is required to get the right IP easily from Caddy. Tested and working.

This change gets the left most IP address from the X-Forward-For header. This is required to get the right IP easily from Caddy. Tested and working.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello & Welcome! :)

Thanks for taking the time to help improve ITFlow. We're excited to review your contributions - we'll review this PR as soon as we can!

Whilst you're waiting, please feel free to check out the forum.

Just so you know, all contributions to ITFlow are licensed under the GNU GPL. By contributing you grant us a perpetual & irrevocable license to include your work in ITFlow.

@lilrags16
Copy link
Author

@johnnyq what is the process for getting PRs included upstream?

@git-kup
Copy link
Contributor

git-kup commented Apr 22, 2025

@johnnyq what is the process for getting PRs included upstream?

https://docs.itflow.org/contribute

@johnnyq
Copy link
Collaborator

johnnyq commented Apr 22, 2025

how will this affect users not using Caddy?

@lilrags16
Copy link
Author

If someone is using the CONST_GET_IP_METHOD == "HTTP_X_FORWARDED_FOR" value in there config, it will always set the IP that ITFlow logs as the leftmost IP presented in a list of comma separated IPs.

Case 1 - Not using config value, not using caddy- No changes to use
Case 2 - Using config value, but reverse proxy only passes on IP: No effective change as the left most of a list of one is still the same
Case 3 - Caddy w/ Value set: The actually client IP is passed through correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants