DweebUI icon indicating copy to clipboard operation
DweebUI copied to clipboard

Running behind reverse proxy showing wrong IP

Open Joly0 opened this issue 1 year ago • 3 comments

Hey, i want to run DweebUI behind an nginx reverse proxy and i noticed, that DweebUI seems like not using the X-Real-IP header. I tried to set it, like for most of my other hosts using nginx, but dweebui shows the ip of the docker gateway for the docker networks its using as the ip for various things like logins. Am i missing something or what could be wrong here?

Joly0 avatar Oct 11 '24 23:10 Joly0

Hi @Joly0, Where is the wrong IP being displayed? In the address bar when accessing DweebUI through Nginx? Could you give me a screenshot? If you used the compose file in the README, could you try the broken dev version with docker run: docker run -d --name=DweebUI -p 8000:8000 -v dweebui:/app/database -v /var/run/docker.sock:/var/run/docker.sock lllllllillllllillll/dweebui:v0.7X-dev

lllllllillllllillll avatar Oct 12 '24 22:10 lllllllillllllillll

Here in the syslogs is the wrong ip displayed: image Here the ip is shown as 172.18.0.1 which is the gateway of the docker network that dweebUI is connected to. Usually the IP of the user that is connected should be shown here, no? There are only 2 instances where the IP was shown correct and that was the bottom 2 entries where i registered first. But that was without the nginx proxy. I will try to run the dev image and will report back later if it changes anything.

Also i have found a few other bugs with dweebUI, i probably will open a few other issue reports here

Joly0 avatar Oct 14 '24 07:10 Joly0

@Joly0 Thanks. I still need to test it, but this should be fixed in the next release. There are definitely a lot more bugs in there. If you try the dev version out, it includes two settings to reduce or disable the sign-in auth. Which you may want to try if you already have some other form of authentication already.

[Build 469] Added 'trust proxy' to express config and changed syslog to use req.ip instead of req.socket.remoteAddress which should get the forwarded IP address.

lllllllillllllillll avatar Oct 14 '24 09:10 lllllllillllllillll