tegola icon indicating copy to clipboard operation
tegola copied to clipboard

Connection to Postgres erroneously requires password

Open EliRibble opened this issue 1 month ago • 1 comments

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.

EliRibble avatar Nov 14 '25 17:11 EliRibble

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"

EliRibble avatar Nov 14 '25 17:11 EliRibble