npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@eflexsystems/node-red-contrib-ftp-server

v1.0.0

Published

NodeRED modules that provides an ftp server so file writes can be handled in a NodeRED flow

Downloads

7

Readme

FTP Server

FTP Server for Node-RED that currently only supports putting files. Uploaded files are emitted from this node via msg.payload of type Buffer.

Written for my Dad so he can wire his IP camera's motion detection directly into Node-RED.

Installation

$ cd ~/.node-red
$ npm install node-red-contrib-ftp-server

Configure Node-RED

Drag the FTP Server node into your workspace and double click to configure:

  • Enter a free port on your Node-RED server
  • Enter a username of your choosing
  • Enter a password of your choosing

NR ftp settings

Dynamic authentication

If you leave the username field empty the node uses the dynamic authentication mode. In this mode every login request has to be handled manually. On each login attempt the node outputs an object containing the username, the password and an authenticate function on the "authenticate" output. You can then manually validate the username and password and must call the authenticate function with the parameter true to accept the authentication or false to reject it.

Here is an example how an authenticate message would look like:

{
    payload: {
        username: "username",
        password: "password"
    },
    authenticate: <function>
}

Here is an example how to handle the login attempts in a function node:

msg.authenticate(
    msg.payload.username === 'username' &&
    msg.payload.password === 'password'
);
msg.payload = undefined;
return msg;

Configure a device to use your Node-RED FTP server

Here's an example of configuring a Foscam IP camera to upload images into Node-RED:

  • Enter the IP address of your Node-RED server as the FTP server address
  • Enter the port, username and password that you chose when you configured the FTP node in Node-RED above.

Now you can configure the motion settings of your IP camera to upload images to FTP.

The images are then emitted from this node as a buffer via msg.payload.

Foscam ftp settings

Enabling extra debugging

Install node-red-contrib-config and drag a config node into your workspace. Configure the node to set a global variable called ftp-server with a JSON value of {"debug": true}. Also make sure that the config tickbox for active is unchecked. Redeploy. Now click the button on the config node. This will trigger all instances of ftp-server to write extra logging to the os syslog next time they're invoked.

TODO

  • TLS support
  • Proper testing