Based on this question and other resources, I was able to set a default server connection in pgadmin with the servers.json
config file.
But when I try to open the server connection I get this error and the password is asked:
fe_sendauth: no password supplied
Without the passfile, I don't have the error (but obviously the password is asked too).
On my windows filesystem I have:
../db/servers.json
../db/servers_pass
With the following pass file:
#host:port:db:user:pass
database:5432:*:postgres:mypasswd
I first tried with a simpler passfile with only database:5432:postgres:mypasswd:postgres:mypasswd
and no newline, no comment. I had the same error.
database
is the name of the docker-compose image for Postgres and the name of the host (the servers.json is working and the connection to that host is fine, except for the password).
Those files are mounted in the docker compose to /pgadmin4/
volumes:
- ../db/servers.json:/pgadmin4/servers.json
- ../db/servers_pass:/pgadmin4/servers_pass
I can see them in the docker container
-rwxr-xr-x 1 pgadmin pgadmin 526 Nov 18 10:22 servers.json
-rwxr-xr-x 1 root root 57 Nov 18 11:06 servers_pass
It's a bit weird that they do not have the same owner.
I also read on other questions that permissions of the passfile needs to be 600 but how can I change that when the files are actually on the Windows filesystem?