puter icon indicating copy to clipboard operation
puter copied to clipboard

CORS errors and login failure with selfhosted version

Open Close04 opened this issue 1 year ago • 3 comments

Issue Description Using docker self hosted version and Firefox. puter.zyx and api.puter.zyx are registered in DNS server pointing to the correct IP running the container, and resolve properly.

Firefox shows a lot of CORS errors in console: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://api.puter.localhost:4100/socket.io/?auth_token=null&EIO=4&transport=polling&t=Owh0Qlq. (Reason: CORS request did not succeed). Status code: (null).

Login with default_user and randomly generated password from console fails with a red rectangle above the login form. Not sure if the issues are related and why api.puter.localhost is showing up, I am not using that hostname.

Steps to Reproduce Load the base URL puter.zyx:4100 for the console errors, attempt login with default credentials results in login failure.

Expected & Actual Behavior Login screen should load with no errors in console, or at least no mentions of hostnames that are not registered anywhere in DNS. Login with password provided in console should also work.

Addition Information or Screenshots (if applicable) image image

Tooling

  • [ ] Development (npm run start)
  • [X] Docker (via docker run)
  • [ ] Docker (via docker-compose)

Puter version (if accessible)

Click the profile button on the top-right, then "Settings". The version number will be printed at the bottom puter:latest

Close04 avatar Apr 04 '24 21:04 Close04

If you are by any chance using Cloudflare DNS, then you might need to look into #221

MohamedElashri avatar Apr 04 '24 21:04 MohamedElashri

I'm using PiHole, the IP and hostname are local/private. Also no proxy, the container is running on one machine (a NAS), I'm trying to access from another in the same network.

The docs mention "puter.local" as the base domain name rather than the puter.localhost that I see in the console. But my local domain isn't "localhost" so the resolution won't work if I try with that.

Close04 avatar Apr 04 '24 22:04 Close04

Currently it is necessary to update domain in config/config.json to the desired domain. The default setting for this is puter.localhost

KernelDeimos avatar Apr 04 '24 22:04 KernelDeimos

Aah, I see it now, it was in the main readme.md :tired_face:. Don't troubleshoot in the middle of the night I guess. Thank you!

Close04 avatar Apr 05 '24 09:04 Close04