mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 11:26:00 +00:00
SYNC: fixed backup & restore under SSH tunnel #1092
This commit is contained in:
committed by
Diflow
parent
e35f9eb75b
commit
cff219674f
@@ -37,6 +37,8 @@ const loadModelTransform = require('../utility/loadModelTransform');
|
||||
const exportDbModelSql = require('../utility/exportDbModelSql');
|
||||
const axios = require('axios');
|
||||
const { callTextToSqlApi, callCompleteOnCursorApi, callRefactorSqlQueryApi } = require('../utility/authProxy');
|
||||
const { decryptConnection } = require('../utility/crypting');
|
||||
const { getSshTunnel } = require('../utility/sshTunnel');
|
||||
|
||||
const logger = getLogger('databaseConnections');
|
||||
|
||||
@@ -619,9 +621,23 @@ module.exports = {
|
||||
command,
|
||||
{ conid, database, outputFile, inputFile, options, selectedTables, skippedTables, argsFormat }
|
||||
) {
|
||||
const connection = await connections.getCore({ conid });
|
||||
const sourceConnection = await connections.getCore({ conid });
|
||||
let connection = decryptConnection(sourceConnection);
|
||||
const driver = requireEngineDriver(connection);
|
||||
|
||||
if (connection.useSshTunnel) {
|
||||
const tunnel = await getSshTunnel(connection);
|
||||
if (tunnel.state == 'error') {
|
||||
throw new Error(tunnel.message);
|
||||
}
|
||||
|
||||
connection = {
|
||||
...connection,
|
||||
server: tunnel.localHost,
|
||||
port: tunnel.localPort,
|
||||
}
|
||||
}
|
||||
|
||||
const settingsValue = await config.getSettings();
|
||||
|
||||
const externalTools = {};
|
||||
|
||||
Reference in New Issue
Block a user