vriteio / vrite

Open-source developer content platform
https://vrite.io
Other
1.63k stars 65 forks source link

self-hosted: cannot log in #40

Closed ovizii closed 1 year ago

ovizii commented 1 year ago

So after a long journey of finally enabling SMTP without authentication, I managed to receive the email to validate my email. I clicked the link, I was told my email is now verified and there was a link to click to visit the dashboard. Clicking that link sends me to http://10.10.10.10:7171/auth and asks me to log in.

Login doesn't work with user/pass. The page accepts my credentials and then redirects me here again: http://10.10.10.10:7171/auth

When I simply visit the login page I already see these errors:

image

I tried logging in via magic link, I receive the login link but upon opening it, I have the exact same behaviour as above with user/pass.

docker compose logs -f does show absolutely no reaction when this happens so I cannot suzpply any logs.

areknawo commented 1 year ago

Do you have the following env vars set?

PUBLIC_COLLAB_URL=
PUBLIC_APP_URL=
PUBLIC_API_URL=
PUBLIC_ASSETS_URL=

They should reflect the URLs your services are accessible at, e.g. PUBLIC_APP_URL=http://10.10.10.10:7171

You can also try setting the following to explicitly specify the Domain attribute for auth cookies (which might be the source of the issue):

COOKIE_DOMAIN=10.10.10.10
ovizii commented 1 year ago

Thanks, the tip with the cookie domain solved the problem. I already had the URLs set in my .env file.

I have a related question about those URLs: if I put my vrite instance behind a reverse proxy, which of those URLs needs to be publicly accessible? Is it just PUBLIC_APP_URL? I assume the others only need to be accessible to each other and not from "outside"?

areknawo commented 1 year ago

For now, all need to be accessible from the outside. To give you an overview:

It's how it was originally structured, partially due to technical limitations and partially to better suit the Vrite Cloud setup. I'm not planning to change it right now, but I might try to optimize it for v1.