Skip to content
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

Fix strfry x-forwarded-for ip by using network_mode: host #142

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

Conversation

dcadenas
Copy link
Contributor

@dcadenas dcadenas commented Jan 8, 2025

While investigating the events service queue, I noticed that events pushed from it were being rejected due to rate limits. The issue occurred because strfry was only seeing Traefik’s internal IP instead of the actual client IP. To resolve this, I added network_mode: "host" to the Traefik service configuration. With this change, strfry now correctly sees the real client IP, and events are no longer rejected.

Caveats:
I acknowledge that using network_mode: "host" is a more open configuration, but given the nature of our relay, which is designed to be highly exposed, this should not introduce significant risks. I also explored alternatives to expose the X-Forwarded-For header without enabling host networking but could not find a suitable solution.

@mplorentz
Copy link
Member

I'm ok with this, but I'm curious if @nbenmoody is concerned.

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.

2 participants