Real IP address is not displayed

(#598) Bug Fixed moderation self-hosting

Summary

When viewing a user in the admin panel, I see that the IP address is 172.18.0.1 which is the ip of the docker container. The instance is behind a Pangolin proxy.

Steps to reproduce

  1. have the Fluxer instance behind a proxy
  2. go to the admin panel
  3. browse for any user
  4. check the user's ip address

Environment

OS: Alma Linux 10 Browser: Firefox 151.0.4 (64-bit) Device: CachyOS Linux

Merged posts

These posts were merged into this one. Their comments are now part of the conversation below, marked with where they came from.

Merged from #624 [Self-Hosted] All users have the same IP address

RexSystemoriginally by @coolty on GitHub

Report details

Summary

All users have the same IP Address of 172.18.0.1 which is a docker IP address. Using cloudflared tunnel but I don't think that's relevant to the issue.

Steps to reproduce

1) Set up self-hosting with cloudflared 2) Invite users to your instance 3) All users now have the same IP address image
  • 609212961-12224412-9bf5-445f-831e-b1f91725b472.png

    609212961-12224412-9bf5-445f-831e-b1f91725b472.png

    1350×763 | 42 kB

6 comments

Sign in with Fluxer to comment and vote.
Comment by @D1reW0lf
RexSystem 1 vote originally by @D1reW0lf on GitHub
Also using Pangolin and also having the same issue.
Comment by @Dschogo
RexSystem 1 vote originally by @Dschogo on GitHub
Had the same issue behind my Nginx proxy. Changing the variable value of FLUXER_CLIENT_IP_HEADER_NAME to x-real-ip in compose.yaml fixed the issue. (This is the Header with the real-ip set by the reverse proxy). Additionally added trusted_proxies to the default Caddy file:
{
	servers {
		trusted_proxies static private_ranges
	}
}
Comment by @D1reW0lf
RexSystem 1 vote edited originally by @D1reW0lf on GitHub
@Dschogo After doing that the admin areas loads normally but the main Fluxer is blank. Edit And after several cache cleaning all over the place, it started to work.
Comment by @valtteri1010
RexSystem 1 vote edited Merged from #624 originally by @valtteri1010 on GitHub
You can easily fix that by trusting headers from private IP-ranges in Caddy:
{
    servers {
        trusted_proxies static private_ranges
    }
}