pgweb icon indicating copy to clipboard operation
pgweb copied to clipboard

Support for .pgpass config file

Open robbles opened this issue 9 years ago • 7 comments

The psql CLI supports reading from the ~/.pgpass configuration file with a standard format, so that you don't need to put passwords into the command-line history or enter them in every time.

Could pgweb read this file and replace an empty password with one found in there for a matching host?

robbles avatar Feb 17 '16 21:02 robbles

Yes, this feature could be supported, but only in a single session mode.

sosedoff avatar Feb 17 '16 22:02 sosedoff

Closing due to no activity. I've personally never used pgpass files and nobody else expressed interest in the feature so far.

sosedoff avatar Nov 07 '16 04:11 sosedoff

I just found (and liked) your UI, and support for ~/.pgpass is the first thing I went to check.

I would strongly prefer to use ~/.pgpass, precisely for the reason original posted requested: don't want passwords in history and in command line. psql client requires that ~/.pgpass be readable only by the file owner, whereas no such check exists for the shell's history file.

I would offer to implement this, but alas I haven't written (and until today - not even read) a single line of go code.

iillyyaa avatar Jan 19 '17 01:01 iillyyaa

Btw, while i havent added the support for pgpass file, you can get away with using bookmarks. By using bookmarks you're not exposing any passwords in the web or cli.

sosedoff avatar Jan 20 '17 19:01 sosedoff

Since I posted my original comment, I have indeed found bookmarks, which do provide this functionality. (.pgpass would have the benefit of working w/o me adding a password to yet another file).

Thank you for your response and for reconsidering this ticket.

iillyyaa avatar Jan 20 '17 22:01 iillyyaa

I think .pgpass would provide a way for pgweb to use connections without adding the credentials to the urls.

My issue so far is that I would like to use bookmarks feature and expose some databases to users, however there is no way to hide the credentials for the db. pgpass would provide a solution.

ieugen avatar Jul 17 '19 15:07 ieugen

Implementing pgpass into pgweb, would be a great benefit for pgweb. At the moment I‘m looking for a web-based db-browser, using this feature.

dhd80 avatar Jun 24 '21 20:06 dhd80

Should be available in the next version.

sosedoff avatar Dec 14 '22 19:12 sosedoff