diff --git a/pkg/client/client.go b/pkg/client/client.go index cb7dd33..cc5bbdc 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -74,6 +74,9 @@ func NewFromUrl(url string, sshInfo *shared.SSHInfo) (*Client, error) { var tunnel *Tunnel if sshInfo != nil { + if command.Opts.DisableSSH { + return nil, fmt.Errorf("ssh connections are disabled") + } if command.Opts.Debug { fmt.Println("Opening SSH tunnel for:", sshInfo) } diff --git a/pkg/command/options.go b/pkg/command/options.go index 0f95216..36dbe3c 100644 --- a/pkg/command/options.go +++ b/pkg/command/options.go @@ -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:""` 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"` + 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"` 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"`