mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix: Fix issue with key formatting introduced in 1.2.0 (#6896)
This commit is contained in:
@@ -3,7 +3,6 @@ import { formatPrivateKey } from '@utils/utilities';
|
||||
|
||||
import mysql2 from 'mysql2/promise';
|
||||
import type { Client, ConnectConfig } from 'ssh2';
|
||||
import { rm } from 'fs/promises';
|
||||
|
||||
import type { Mysql2Pool } from '../helpers/interfaces';
|
||||
|
||||
@@ -107,12 +106,6 @@ export async function createPool(
|
||||
dstPort: credentials.port as number,
|
||||
};
|
||||
|
||||
if (sshAuthenticateWith === 'privateKey') {
|
||||
sshClient.on('end', async () => {
|
||||
await rm(tunnelConfig.privateKey as string);
|
||||
});
|
||||
}
|
||||
|
||||
const poolSetup = new Promise<mysql2.Pool>((resolve, reject) => {
|
||||
sshClient
|
||||
.on('ready', () => {
|
||||
|
||||
@@ -8,9 +8,6 @@ import type { Server } from 'net';
|
||||
import { createServer } from 'net';
|
||||
|
||||
import pgPromise from 'pg-promise';
|
||||
|
||||
import { rm } from 'fs/promises';
|
||||
|
||||
import type { PgpDatabase } from '../helpers/interfaces';
|
||||
|
||||
async function createSshConnectConfig(credentials: IDataObject) {
|
||||
@@ -143,9 +140,6 @@ export async function configurePostgres(
|
||||
});
|
||||
|
||||
sshClient.on('end', async () => {
|
||||
if (tunnelConfig.privateKey) {
|
||||
await rm(tunnelConfig.privateKey as string, { force: true });
|
||||
}
|
||||
if (proxy) proxy.close();
|
||||
});
|
||||
}).catch((err) => {
|
||||
|
||||
@@ -236,11 +236,9 @@ export function formatPrivateKey(privateKey: string): string {
|
||||
const passRegex = /Proc-Type|DEK-Info/;
|
||||
if (passRegex.test(part)) {
|
||||
part = part.replace(/:\s+/g, ':');
|
||||
formattedPrivateKey += part.replace(/\\n/g, '\n');
|
||||
formattedPrivateKey += part.replace(/\s+/g, '\n');
|
||||
formattedPrivateKey += part.replace(/\\n/g, '\n').replace(/\s+/g, '\n');
|
||||
} else {
|
||||
formattedPrivateKey += part.replace(/\\n/g, '\n');
|
||||
formattedPrivateKey += part.replace(/\s+/g, '\n');
|
||||
formattedPrivateKey += part.replace(/\\n/g, '\n').replace(/\s+/g, '\n');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
2
pnpm-lock.yaml
generated
2
pnpm-lock.yaml
generated
@@ -1,4 +1,4 @@
|
||||
lockfileVersion: '6.0'
|
||||
lockfileVersion: '6.1'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
|
||||
Reference in New Issue
Block a user