Auto execute plugin puttyforward for linux.

При наличии такого плагина:
```
; SSH (Unix): tunnel putty forward
;
Title=[Putty tunnel forward]
Command=putty -load "$$TITLE"
appliesto=puttyforward
Description=Putty forward tunnel from local port.
KeyFile=
Platform=unix
ServerType=postgresql
Database=No
SetPassword=No
;
```
При попытке подключения к БД если существует конфигурация
туннеля описанного в putty то будет проверятся наличие открытого порта на localhost
и если он закрыт то запускается выше указанный плагин для организации туннеля.
This commit is contained in:
lsv 2026-03-17 11:57:33 +05:00
parent 903fd8ea9e
commit 2cde1c04f4
5 changed files with 88 additions and 9 deletions

View file

@ -17,6 +17,7 @@
class frmMain;
class pgServer;
class pluginUtilityFactory;
class pgServerFactory : public pgaFactory
{
@ -366,6 +367,10 @@ public:
void ShowTreeDetail(ctlTree *browser, frmMain *form = 0, ctlListView *properties = 0, ctlSQLBox *sqlPane = 0);
void ShowHint(frmMain *form, bool force);
void ShowStatistics(frmMain *form, ctlListView *statistics);
void SetPuttyTunnel(pluginUtilityFactory *puttytunnel) {
puttyTunnel=puttytunnel;
}
pluginUtilityFactory* GetPuttyTunnel() {return puttyTunnel;}
wxString GetHelpPage(bool forCreate) const
{
return wxT("pg/managing-databases");
@ -448,6 +453,7 @@ public:
{
sslcompression = b;
}
#if defined(HAVE_OPENSSL_CRYPTO) || defined(HAVE_GCRYPT)
//SSH Tunnel
@ -560,6 +566,7 @@ private:
bool inRecovery, replayPaused;
wxString receiveLoc, replayLoc, replayTimestamp;
wxDateTime confLoadedSince;
pluginUtilityFactory *puttyTunnel=NULL; // if exists putty tunnel for pgServer
#if defined(HAVE_OPENSSL_CRYPTO) || defined(HAVE_GCRYPT)
bool createSSHTunnel();

View file

@ -282,6 +282,7 @@ wxString qtTypeIdent(const wxString &value); // add " if necessary
bool make_identifier(const wxString &strname, wxString &s, wxString &n, bool islower);
wxSize getScreenSizeForPoint(const wxPoint screenPos);
void showHelpHtml(wxWindow *parent, const wxString &htmlHelp,wxPoint screenPos, wxSize size);
bool isPortOpen(const wxString& host, int port , int timeout_ms);
#endif