mirror of
https://github.com/pelican-dev/panel.git
synced 2026-02-24 03:12:01 +03:00
Panel does not correctly handle X-Forwarded-For #127
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ItzExotical on GitHub (Jul 9, 2024).
Current Behavior
The panel does not care about the X-Forwarded-For header provided by Caddy among other web servers, resulting in the panel getting the user's IP wrong (if a service like Cloudflare is used).
Expected Behavior
The panel should get the user's actual IP and store that in logs too.
Steps to Reproduce
Sorry, but I think this one is quite straightforward.
Panel Version
1.0.0-beta6
Wings Version
1.0.0-beta3
Games and/or Eggs Affected
No response
Docker Image
No response
Error Logs
No response
Is there an existing issue for this?
@Boy132 commented on GitHub (Jul 9, 2024):
You need to set the
TRUSTED_PROXIESin your .env file. Then it'll show the real ip.See https://pelican.dev/docs/panel/config#reverse-proxy-setup
@ItzExotical commented on GitHub (Jul 9, 2024):
Oh well, I totally missed that. What about wings? Still shows proxy IP for server events, such as opening and writing to files.
@Boy132 commented on GitHub (Jul 9, 2024):
Wings also has a config option for that.
api.trusted_proxies@Boy132 commented on GitHub (Jul 12, 2024):
I'm going to close this. If you still have problems with it showing the wrong ip you should visit the Discord and open a support thread. But setting the trusted proxies config vars should work.
@ItzExotical commented on GitHub (Jul 12, 2024):
I set
TRUSTED_PROXIESto127.0.0.1in my.envand it still showed the Cloudflare IP and not my IP. I even tried setting it to wildcard but same thing there. X-Forwarded-For exists and is properly set to the real connecting IP of the client, but Pelican is not handling it correctly it looks like.@Boy132 commented on GitHub (Jul 12, 2024):
Because
127.0.0.1is wrong, you need to set it to the cloudflare ips as described in the docs. At this point please visit the Discord for support.