BrandonE/lichocker

redirects to localhost

Tysseract opened this issue · 5 comments

I installed the container on my Debian server and got the "listening on 0.0.0.0:9663" message but when I navigated to 192.168.0.2:9663 (the server IP) from a windows machine, it redirected to localhost:9663.
I then tried adding it to the Debian machine's (working) reverse proxy
ProxyPass "/chess" "http://0.0.0.0:9663" ProxyPassReverse "/chess" "http://0.0.0.0:9663"
and now it gives a too many redirects error...
I can't for the life of me figure out why it redirects to localhost, any help would be appreciated

I just merged a PR that made a couple of modifications to the Dockerfile. Could you check to see if these help at all for your issue? Thanks!

It's still happening :(
So I reset and pulled all the git repos, rebuilt the docker, and ran it (https://pastebin.com/jNvMW60n always happens but I just (r)etry and it works)...

Then when I get to
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0.0.0.0:9663 \ (Server started, use Enter to stop and go back to the console...)
I go to 192.168.0.2:9663 (server IP) from my desktop browser and it appears to load on a blank screen for a while while the console spits out https://pastebin.com/K5P2Byjz
When its done, any attempt to go to 192.168.0.2:9663 redirects to localhost:9663 (the desktop's localhost)

Maybe the problem is that there is some config that I don't know about to enable outside connections?

I was able to reproduce this exact issue via docker + Ubuntu on WSL2, with remote clients always being redirected to localhost.

Looks to be because line 6 (net.domain) of lila/conf/base.conf is defaulted to localhost:9663 and it redirects based on that entry.
Changing the value in lila/conf/base.conf before building (the application.conf override doesn't stick) makes the page accessible, but then the Content-Security-Policy prevents script/style loading.

Understood. I haven't looked into this issue in-depth, but from what you're describing, it sounds like this could be an issue that is also prevalent in the official Lichess Development Onboarding instructions. Is this accurate?

lichocker's goal is to make Lichess onboarding faster and easier. If there's an issue with developer onboarding in general, that discussion might be better to have in the lila repository.

I encountered this problem as well.
This does appear to be prevalent in the official Lichess Development Onboarding instructions, and modifying lila/conf/base.conf doesn't alone resolve the problem of having the entire framework function correctly. However, since it is counter productive for lichess.org to devote any development time towards code development or bug fixes associated with setting up a server, such an issue would unlikely ever be resolved via lichess.org. Their intention is that development should be done on a local machine accessing localhost.

In lieu of lila enabling the easy creation of a server other than localhost development, lichocker may benefit by having instructions that point this out and suggest SSH Port Forwarding to allow local clients to hit localhost but be redirected to the actual server.