tegola
tegola copied to clipboard
Connection to Postgres erroneously requires password
See postgis.go where a new error state is created if the connection URI does not include a user. A user isn't required in libpq connection URIs. This makes sense if using a Trust Authentication with unix domain sockets
Given #1044 and #1016 it would be much better, I think, to avoid parsing and attempting to validate the connection parameters (env vars and connection string) and just catch errors from pgx when connecting.
For anyone who comes across this and wants to craft a URI that will use domain sockets and passes tegola's validation, you want something like this:
[[providers]]
uri = "postgres://user:@localhost:/databasename?host=/var/run/postgresql&sslmode=disable"