Socket
Socket
Sign inDemoInstall

node-red-contrib-ftp-sftp

Package Overview
Dependencies
14
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.6.2 to 1.7.0

2

package.json
{
"name": "node-red-contrib-ftp-sftp",
"version": "1.6.2",
"version": "1.7.0",
"description": "A node-red node that support FTP and SFTP file transfer using $() environment variables to control the ftp connection details",

@@ -5,0 +5,0 @@ "main": "sftp.js",

@@ -17,2 +17,7 @@

Configuration
-------
process.env.SFTP_SSH_KEY_FILE - If you want to use private SSH key set this environment variable
SFTP

@@ -19,0 +24,0 @@ -------

@@ -31,3 +31,5 @@ /**

// -- DID validate it works with list/dir
const fs = require('fs');
module.exports = function (RED) {

@@ -44,17 +46,46 @@ 'use strict';

console.log("hmac: " + n.hmac);
console.log("cipher: " + n.cipher);
console.log("[http://wwww.HardingPoint.com] SFTP - Config - hmac: " + n.hmac);
console.log("[http://wwww.HardingPoint.com] SFTP - Config - cipher: " + n.cipher);
this.options = {
host: n.host || 'localhost',
port: n.port || 21,
username: n.username,
password: n.password,
algorithms: {
// hmac: ['hmac-sha2-256', 'hmac-sha2-512', 'hmac-sha1', 'hmac-sha1-96'],
// cipher: ['aes256-cbc']
hmac: n.hmac,
cipher: n.cipher
}
};
var keyFile = null;
var keyData = null;
if (process.env.SFTP_SSH_KEY_FILE){
keyFile = process.env.SFTP_SSH_KEY_FILE;
try{
keyData = fs.readFileSync(keyFile);
} catch (e){
keyData = null;
console.log("[http://wwww.HardingPoint.com] SFTP - Read Key File [" + keyFile + "] Exception : " + e);
}
}
if (keyFile && keyData) {
console.log("[http://wwww.HardingPoint.com] SFTP - Using privateKey: " + keyFile);
this.options = {
host: n.host || 'localhost',
port: n.port || 21,
username: n.username,
privateKey: keyData,
algorithms: {
// hmac: ['hmac-sha2-256', 'hmac-sha2-512', 'hmac-sha1', 'hmac-sha1-96'],
// cipher: ['aes256-cbc']
hmac: n.hmac,
cipher: n.cipher
}
};
} else {
console.log("[http://wwww.HardingPoint.com] SFTP - Using User/Pwd");
this.options = {
host: n.host || 'localhost',
port: n.port || 21,
username: n.username,
password: n.password,
algorithms: {
// hmac: ['hmac-sha2-256', 'hmac-sha2-512', 'hmac-sha1', 'hmac-sha1-96'],
// cipher: ['aes256-cbc']
hmac: n.hmac,
cipher: n.cipher
}
};
}
}

@@ -61,0 +92,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc