mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 05:03:57 +00:00
This commit is contained in:
@@ -70,14 +70,14 @@ function decryptPasswordField(connection, field) {
|
|||||||
function encryptConnection(connection) {
|
function encryptConnection(connection) {
|
||||||
connection = encryptPasswordField(connection, 'password');
|
connection = encryptPasswordField(connection, 'password');
|
||||||
connection = encryptPasswordField(connection, 'sshPassword');
|
connection = encryptPasswordField(connection, 'sshPassword');
|
||||||
connection = encryptPasswordField(connection, 'sshKeyFilePassword');
|
connection = encryptPasswordField(connection, 'sshKeyfilePassword');
|
||||||
return connection;
|
return connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
function decryptConnection(connection) {
|
function decryptConnection(connection) {
|
||||||
connection = decryptPasswordField(connection, 'password');
|
connection = decryptPasswordField(connection, 'password');
|
||||||
connection = decryptPasswordField(connection, 'sshPassword');
|
connection = decryptPasswordField(connection, 'sshPassword');
|
||||||
connection = decryptPasswordField(connection, 'sshKeyFilePassword');
|
connection = decryptPasswordField(connection, 'sshKeyfilePassword');
|
||||||
return connection;
|
return connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const platformInfo = {
|
|||||||
environment: process.env.NODE_ENV,
|
environment: process.env.NODE_ENV,
|
||||||
platform,
|
platform,
|
||||||
runningInWebpack: !!process.env.WEBPACK_DEV_SERVER_URL,
|
runningInWebpack: !!process.env.WEBPACK_DEV_SERVER_URL,
|
||||||
defaultKeyFile: path.join(os.homedir(), '.ssh/id_rsa'),
|
defaultKeyfile: path.join(os.homedir(), '.ssh/id_rsa'),
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = platformInfo;
|
module.exports = platformInfo;
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ const CONNECTION_FIELDS = [
|
|||||||
'sshLogin',
|
'sshLogin',
|
||||||
'sshPassword',
|
'sshPassword',
|
||||||
'sshMode',
|
'sshMode',
|
||||||
'sshKeyFile',
|
'sshKeyfile',
|
||||||
'sshBastionHost',
|
'sshBastionHost',
|
||||||
'sshKeyFilePassword',
|
'sshKeyfilePassword',
|
||||||
];
|
];
|
||||||
const TUNNEL_FIELDS = [...CONNECTION_FIELDS, 'server', 'port'];
|
const TUNNEL_FIELDS = [...CONNECTION_FIELDS, 'server', 'port'];
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ async function getSshConnection(connection) {
|
|||||||
endPort: connection.sshPort || 22,
|
endPort: connection.sshPort || 22,
|
||||||
bastionHost: connection.sshBastionHost || '',
|
bastionHost: connection.sshBastionHost || '',
|
||||||
agentForward: connection.sshMode == 'agent',
|
agentForward: connection.sshMode == 'agent',
|
||||||
passphrase: connection.sshMode == 'keyFile' ? connection.sshKeyFilePassword : undefined,
|
passphrase: connection.sshMode == 'keyFile' ? connection.sshKeyfilePassword : undefined,
|
||||||
username: connection.sshLogin,
|
username: connection.sshLogin,
|
||||||
password: connection.sshMode == 'userPassword' ? connection.sshPassword : undefined,
|
password: connection.sshMode == 'userPassword' ? connection.sshPassword : undefined,
|
||||||
agentSocket: connection.sshMode == 'agent' ? platformInfo.sshAuthSock : undefined,
|
agentSocket: connection.sshMode == 'agent' ? platformInfo.sshAuthSock : undefined,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
$: {
|
$: {
|
||||||
if (!$values.sshMode) setFieldValue('sshMode', 'userPassword');
|
if (!$values.sshMode) setFieldValue('sshMode', 'userPassword');
|
||||||
if (!$values.sshPort) setFieldValue('sshPort', '22');
|
if (!$values.sshPort) setFieldValue('sshPort', '22');
|
||||||
if (!$values.sshKeyfile && $platformInfo) setFieldValue('sshKeyfile', $platformInfo.defaultKeyFile);
|
if (!$values.sshKeyfile && $platformInfo) setFieldValue('sshKeyfile', $platformInfo.defaultKeyfile);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user