pentacent / keila

Open Source Newsletter Tool.
https://keila.io
GNU Affero General Public License v3.0
1.33k stars 69 forks source link

Nil root@localhost #136

Closed bryanthen closed 2 years ago

bryanthen commented 2 years ago

Hello everyone,

I deployed Keila (both Keila web and Database) on docker. Configured KEILA_USER and KEILA_PASSWORD on the environment, but it's giving me UI error:

"PASSWORD is incorrect". Although the password is extremely basic, with "randompassword" as string.

Also, tried to find the root@localhost user and password was a tough journey since it was deployed via Portainer Docker Compose without any logs, hence missed the password generated for the default user.

Based on https://github.com/pentacent/keila/issues/82, I tried to find the root user on the docker, and it was returning the following result:

iex(keila@3bdc6f488a4c)3> root=Keila.Auth.find_user_by_email("root@localhost") nil

Now, I am stucked even further without able to sign in to the dashboard. Kindly assist.

wmnnd commented 2 years ago

Did you configure both KEILA_USER and KEILA_PASSWORD before you first started Keila? Because in case you specified just KEILA_USER it would have created a user with your specified email but still set up a random password.

You can also try to get a list of all users: Keila.Auth.list_users() |> Enum.map(& &1.email)

bryanthen commented 2 years ago

Hi @wmnnd , the result of the list_users() is returning [ ], an empty string. I have inserted KEILA_USER and KEILA_PASSWORD on the docker-compose.yml prior to deployment. Technically it should be made available to the application.

bryanthen commented 2 years ago

I think i resolved the problem, finally! What I did was to set a HOME environment variable and redeploy the stack again. Thanks @wmnnd for the command to ensure that I know what I'm doing.

I checked on the list_users() functionality and it gave me the configured KEILA_USER and hashed KEILA_PASSWORD environment variables. And the rest are history.

wmnnd commented 2 years ago

Excellent, glad to hear you managed to sort this out! :+1: