Merge pull request #279 from sosedoff/disable-ssh
Add new CLI option to disable SSH connections
This commit is contained in:
commit
b6167ce422
@ -74,6 +74,9 @@ func NewFromUrl(url string, sshInfo *shared.SSHInfo) (*Client, error) {
|
|||||||
var tunnel *Tunnel
|
var tunnel *Tunnel
|
||||||
|
|
||||||
if sshInfo != nil {
|
if sshInfo != nil {
|
||||||
|
if command.Opts.DisableSSH {
|
||||||
|
return nil, fmt.Errorf("ssh connections are disabled")
|
||||||
|
}
|
||||||
if command.Opts.Debug {
|
if command.Opts.Debug {
|
||||||
fmt.Println("Opening SSH tunnel for:", sshInfo)
|
fmt.Println("Opening SSH tunnel for:", sshInfo)
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ type Options struct {
|
|||||||
Bookmark string `short:"b" long:"bookmark" description:"Bookmark to use for connection. Bookmark files are stored under $HOME/.pgweb/bookmarks/*.toml" default:""`
|
Bookmark string `short:"b" long:"bookmark" description:"Bookmark to use for connection. Bookmark files are stored under $HOME/.pgweb/bookmarks/*.toml" default:""`
|
||||||
BookmarksDir string `long:"bookmarks-dir" description:"Overrides default directory for bookmark files to search" default:""`
|
BookmarksDir string `long:"bookmarks-dir" description:"Overrides default directory for bookmark files to search" default:""`
|
||||||
DisablePrettyJson bool `long:"no-pretty-json" description:"Disable JSON formatting feature for result export" default:"false"`
|
DisablePrettyJson bool `long:"no-pretty-json" description:"Disable JSON formatting feature for result export" default:"false"`
|
||||||
|
DisableSSH bool `long:"no-ssh" description:"Disable database connections via SSH" default:"false"`
|
||||||
ConnectBackend string `long:"connect-backend" description:"Enable database authentication through a third party backend"`
|
ConnectBackend string `long:"connect-backend" description:"Enable database authentication through a third party backend"`
|
||||||
ConnectToken string `long:"connect-token" description:"Authentication token for the third-party connect backend"`
|
ConnectToken string `long:"connect-token" description:"Authentication token for the third-party connect backend"`
|
||||||
ConnectHeaders string `long:"connect-headers" description:"List of headers to pass to the connect backend"`
|
ConnectHeaders string `long:"connect-headers" description:"List of headers to pass to the connect backend"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user