Skip to content

Unable to login #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
huston9 opened this issue May 1, 2025 · 29 comments
Open

Unable to login #272

huston9 opened this issue May 1, 2025 · 29 comments
Labels
bug Something isn't working

Comments

@huston9
Copy link

huston9 commented May 1, 2025

I have started a Docker convertx instance using Docker Compose. Initially, the only change I made was swapping "3000:3000" to "3001:3000" since another container already uses the 3000 port in my setup. I have been able to access the setup page and login page, but when I enter my credentials into the login page, it simply returns me to the login page to reenter my credentials. I am unable to reach the main conversion page. Any help would be much appreciated!

@huston9
Copy link
Author

huston9 commented May 1, 2025

I have tried accessing both by my local network and remotely via Tailscale. Neither case has worked for me so far.

@ztgibby
Copy link

ztgibby commented May 1, 2025

Seconding this issue, setup is similar to yours but I left all default configs.

@C4illin
Copy link
Owner

C4illin commented May 1, 2025

Set HTTP_ALLOWED=true

@huston9
Copy link
Author

huston9 commented May 1, 2025 via email

@tremor021
Copy link

export HTTP_ALLOWED=true fixes it

@huston9
Copy link
Author

huston9 commented May 2, 2025

export HTTP_ALLOWED=true fixes it

As in enter that line into my environmental variables? I'm new-ish to Docker, and am unfamiliar with how to use export in a compose file.

@tremor021
Copy link

Yes as environment variable

@huston9
Copy link
Author

huston9 commented May 2, 2025

Tried that, but it didn't work.

Here is the environmental variables section of my docker-compose.yml:

environment:  
      - JWT_SECRET=password # will use randomUUID() if unset  
      - ACCOUNT_REGISTRATION=true  
      - export HTTP_ALLOWED=true

I don't know if this makes a difference in terms of finding a solution, but out of curiosity, I intentionally misentered my password. The "login" button sent me to a bare webpage that simply said {"message":"Invalid credentials."}. When I correctly enter my password, the "login" button simply refreshes the login page.

@tremor021
Copy link

no, export is someting you would type in the shell. Remove export from the compose file, leave just HTTP_ALLOWED=true

@huston9
Copy link
Author

huston9 commented May 2, 2025

Ok, so taking export out, I then call sudo docker compose restart; do I then do sudo docker <container> attach and run export from there?

@C4illin
Copy link
Owner

C4illin commented May 6, 2025

Ok, so taking export out, I then call sudo docker compose restart; do I then do sudo docker <container> attach and run export from there?

Setting it as an environment should be enough

@C4illin C4illin closed this as completed May 6, 2025
@huston9
Copy link
Author

huston9 commented May 6, 2025

That didn't work...
Also, what would the point of using export be? I'm not sure where it would come in if I don't use it in either the compose file or the console?
Still having the same problem; can we reopen the issue, @C4illin? Thanks!

@C4illin
Copy link
Owner

C4illin commented May 6, 2025

export is used in bash and similar to set env variables which can also be set in docker compose. I think you are doing something weird with your docker compose. Set the env variable in the compose file and then attach and check what it actually is (using echo for example)

@C4illin C4illin reopened this May 6, 2025
@huston9
Copy link
Author

huston9 commented May 6, 2025

Ok, you're right - despite the environment section of my compose file being this (as above)

environment:  
      - JWT_SECRET=password # will use randomUUID() if unset  
      - ACCOUNT_REGISTRATION=true  
      - export HTTP_ALLOWED=true

...when I run sudo docker exec convertx env in my CLI, I don't see env variables show up for ACCOUNT_REGISTRATION nor HTTP_ALLOWED. I do see JWT_SECRET=password, though. I'm not sure why that shows up but the other two don't.

I thought maybe I had goofed the way I ended that first line (the JWT_SECRET line), causing the next two lines to not be read right, but when I switched the order so that the JWT_SECRET line was last, I still only saw JWT_SECRET in the environmental variables. I'm not sure what's going wrong at this point.

I've tried setting the environmental variables in a .env file and referencing it in the compose file with env_file:, but no dice there either.

I'm at a loss at the moment as to what else could be causing this problem. Any other thoughts? All and any help is much appreciated!

@tremor021
Copy link

we told you to remove "export" from environment variables

@huston9
Copy link
Author

huston9 commented May 6, 2025

Oh, I did - I just copied the lines from my previous comment, and forgot I had export in there.

This is what I have:

environment:  
      - JWT_SECRET=password # will use randomUUID() if unset  
      - ACCOUNT_REGISTRATION=true  
      - HTTP_ALLOWED=true

@benwilcock
Copy link

I think I may have a suggestion here.

HTTP_ALLOWED=true only works for localhost serving. When self hosting (e.g. on Docker on a NAS etc.), it's quite often the case that you would want any machine on the local LAN network at be able to access and use the service, but when set to localhost, only the users of the actual server are able to access the service. Therefore, if your server for your LAN is on http://192.168.1.5:3001, and you called the service from a browser on 192.168.1.10, then you would be unable to login.

I'd argue this is a bug or a feature request - to allow HTTP on the local LAN. Is that possible already?

@huston9
Copy link
Author

huston9 commented May 19, 2025

HTTP_ALLOWED=true only works for localhost serving.

Ahhhh, that makes sense then. Yep, I'm trying to access the service from other machines on my LAN and Tailscale network. The server itself is headless, so being able to access it only with localhost isn't very helpful for me.

Thanks @benwilcock for the added info!

@C4illin, thoughts regarding the comment above?

@C4illin C4illin added the bug Something isn't working label May 20, 2025
@tdigu
Copy link

tdigu commented May 21, 2025

I think I may have a suggestion here.

HTTP_ALLOWED=true only works for localhost serving. When self hosting (e.g. on Docker on a NAS etc.), it's quite often the case that you would want any machine on the local LAN network at be able to access and use the service, but when set to localhost, only the users of the actual server are able to access the service. Therefore, if your server for your LAN is on http://192.168.1.5:3001, and you called the service from a browser on 192.168.1.10, then you would be unable to login.

I'd argue this is a bug or a feature request - to allow HTTP on the local LAN. Is that possible already?

Curious on this, i believe this is my situation as well. I am trying to run convertx on a rpi4 in docker and access it from a different computer. Is there currently a resolution to this? It allows me to create an account but i then can not log in. I tried with https as well but i get a ssl error attempting that.

@huston9
Copy link
Author

huston9 commented May 22, 2025

Yeah @tdigu, exactly the same here, just different hardware. Haven't found a resolution yet, but I remain optimistic. Looks like @C4illin just added a bug ticket two days ago, so hopefully we'll be able to figure out what's up soon.

@C4illin
Copy link
Owner

C4illin commented May 23, 2025

I tested it here and if I add HTTP_ALLOWED=true I am able to log in on another device on the local network

Maybe try to clear cookies?

@C4illin
Copy link
Owner

C4illin commented May 23, 2025

HTTP_ALLOWED=true only works for localhost serving.

@benwilcock no, on localhost HTTP_ALLOWED=false even works

@benwilcock
Copy link

HTTP_ALLOWED=true only works for localhost serving.

@benwilcock no, on localhost HTTP_ALLOWED=false even works

We might be talking at cross purposes. The point though, is that to work on headless systems on LAN, there's an issue with the login flow and using http mode. Should be reproducible.

@C4illin
Copy link
Owner

C4illin commented May 23, 2025

Should be reproducible.

I tried the following on my headless system (not a raspberry pi though):

docker run -p 3003:3000 -v ./data:/app/data -e HTTP_ALLOWED=true ghcr.io/c4illin/convertx

then i visited http://192.168.1.4:3003 and create an account and was able to use it as normally

so I cant reproduce the issue

@samudotlol
Copy link

Hiya, had this issue and HTTP_ALLOWED=true does work, but not sure how good of a solution it is, as I want to make the service available thru cloudflare, and will have to use https at that point

@C4illin
Copy link
Owner

C4illin commented May 24, 2025

Yeah the idea is that you use https and don't change the variable (HTTP_ALLOWED=False)

@orrd
Copy link

orrd commented May 27, 2025

I spent a lot of time trying to figure out why the login wouldn't work before I happened to find this issue. I did eventually also see it in a note on the install page, but most of us don't read all the instructions thoroughly when this is one of several projects we're installing and just trying to get it done.

I don't know why HTTP is not allowed by default, but if it's going to remain not allowed by default, HTTP_ALLOWED=true (or false) should at least be in the sample docker-compose.yml. And also the login page should really give an error message that explains what's going on.

@wrapperNo1
Copy link

Hi, I had the same issue in a fresh installation. HTTP_ALLOWED=true did fix it.

@huston9
Copy link
Author

huston9 commented May 28, 2025

Not sure what happened, but when I wiped and reinstalled the container via Docker Compose, suddenly it started working. I'm now able to connect over HTTP via Tailscale, and just ran my first conversion as a test. Everything seems to be in order now, but not sure why it suddenly decided to start working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants