• 3 Posts
  • 14 Comments
Joined 1 year ago
cake
Cake day: June 11th, 2023

help-circle

  • I learned something interesting in doing some more testing…

    Using the -W option does indeed prompt for a password, but it accepts any value entered at the password prompt. In order to actually authenticate with a password when using psql, you must modify the pg_hba.conf file to use scram-sha-256 as the method for type local.

    When I do this, I am unable to authenticate (both while using my actual password, and also while using a password of “test”.

    And then I figured out the problem.

    In my docker-compose.yml, I had put single quotes around my postgres password, thinking this would be safe per my understanding of this question. However, just to check, I tried logging in to psql using the password 'test'. Sure enough, it worked.

    I found another stack exchange with some different advice on strings in yaml: https://stackoverflow.com/questions/53082932/yaml-docker-compose-spaces-quotes

    So, I tried my password again, without the single quotes… and it worked.

    Perhaps this will help somebody beating their head against the wall in the future.



  • Yeah the name you want for the database host is postgres, or whatever the container is named in the docker-compose.yml.

    I was curious about this, and it turns out both work. I tested by pinging both postgres and lemmy_postgres_1, and both responded with the same IP address. Good to know, but I did go ahead and change it back to postgres

    Maybe try a very simple password temporarily like test, rebuild the postgres container/delete the volumes and see if it works.

    I did this, and I’m still getting the same error, so obviously something is wrong.



  • Thank you for enlightening me on the -W option in psql. I have successfully logged in using the expected password for lemmy. This points to something with the connection string. According to the error log, the connection string being used is:

    postgres://lemmy:<my percent-encoded password>@postgres:5432/lemmy
    

    As far as I can tell, the percent encoding is correct. Any ideas how to troubleshoot this further?

    edit: it just occurred to me that my container name is lemmy_postgres_1, not postgres as was entered in my lemmy.hjson file. Let’s see if changing that will work…

    edit2: no, that had no effect. I’m getting the authentication error for user lemmy on both the lemmy container and the postgres container. :(






  • Do you mind sharing what exactly you changed in order to get it to work? I got nginx_internal.conf installed, but did not make any changes to it. I’m not able to get the UI using http://<ipaddress>:1236

    I’m not a complete newb when it comes to nginx, but I’m having a hard time understanding what all the different parts are here. For instance, what is the lemmy-ui container for? Is that what needs to be exposed for me to access the UI? If so, I don’t see any port mapping the in container definition, so is it hard-coded to use a specific port?

    Any help you can provide is greatly appreciated!