Cannot login with IP other than localhost/127.0.0.1 on local server
Hello,
First of all, thank you so much for bringing Netrunner online. I really appreciate that! :)
I installed a local Netrunner server with the docker container. Everything built successfully and I am able to create an user and sign in. it is even possible to play a game with myself with 2 accounts. everything perfect to this point.
when I try to log in with my local IP 192.168.0.xxx it does not work. I enter my credentials, click on log in and the page is reloaded. I can see the red "shadow cljs - reconnecting..." message in the lower left corner for some milliseconds and then the page reloads. no login. :(
with my public IP it does not work either. I just tried it with my local IP first to avoid any port forwarding issues.
I cannot see any problems in the browser's developer debug console (firefox). there is only a warning because of http and password insecurities and so on. it is just a warning and should not be the problem.
I tried Firefox and Chrome with the same disappointing result. I hope you can help me!
Is there anything else I can do to provide additional information to solve the problem?
regards
I forgot to say that I tried the above on Linux Debian Bullseye and Windows 11 with the same bad result. I even built it from scratch without the docker container with the same result. I also tried to run the server with 'lein run' instead of 'lein repl' because I was not sure if the repl mode only allows a connection from localhost due to security reasons?!
Now I am really running out of ideas. :( Please Help
I don't quite understand the problem. You're trying to run the server locally but use an external IP to play?
ok, I guess that was not specific enough. my fault.
I run the server locally, that is correct. I can log in locally, that's fine. When I want to play with a friend, who uses an external IP, it doesn't work as described above.
I used my own external IP just for testing. sorry for being too vague.
Oh I see. Looks like we don't have any instructions for that. We use Ring for our server handling. If you use lein uberjar, you can use nginx and java -jar pointed at the uberjar to run it. I don't know much about that side of things, so you'll have to figure that out on your own, sadly. I think it's called a reverse proxy?
Did that change? I just ask, because it worked without any problems in the past (2020, 2021). I already had a running local server at that time and did not see any of those problems.
I don't know anything about our docker set up either, lol. And I don't think the people who created it are active devs anymore. I'm sorry I'm not more help.
well, the idea with reverse proxy was good, but did not solve the problem.
I cloned the project into an older revision. just a random revision from Jan 2020 and there it works, i.e. I can login with my user with an external IP. without any proxy server or other fancy stuff.
It looks like something in the code concerning the login changed. Maybe I find out until which revision it works and then I can check the files which have changed...
After some research I found out that release 103 (12th Nov 2021) is the last one which works with my building scripts (based on the corresponding readme text in github). forget docker, I did not used the containers, but built it manually.
In the next release 104 (from 17th March 2022) the file bower.json was removed and shadow-cljs.edu was introduced . A lot of stuff concerning the compilation of the software has changed. The readme was modified too, but I am not sure if there is something missing. when I try to build according to the readme I get the problems mentioned above. I also tried a mixture of the old and new installation instructions (readme) without any success.
I can pinpoint my problems to the transition from release 103 to 104. With that additional information, do you have any idea what could have happened?
In the meantime I solved the problem!
On 21st of December 2021 the line "secure: true" was added to the file dev.edn. I guess this means that only https is allowed and http requests are ignored. At least it behaves like that.
In general I agree that this is a good idea, but for the first shot I tried to avoid additional complexity due to https.
removing that line from the config solved the problem. :) Maybe this should be mentioned in the README.
Probably worth removing from dev.edn. Maybe we're doing some silly merging logic for prod, which isn't good.
Enforcing security is usually a good thing, but at least the user should know how to configure it. Maybe it is better to set the default value to "secure: false"?
In any case, the issue can be closed now
It should just be part of the README. Also, I'm surprised the docker build worked for you. It errors out on me about the clojure dependency not being available.