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

@jovercao/sftpd

v0.1.3

Published

A sftp server by nodejs.

Downloads

4

Readme

SFTPD

Sftpd is the sftp server by nodejs, with permission virtual path.

中文文档

Configuration

Cofigure file is 3 parts:

  1. App configuration,it's store at the executable file path, filename: app.config.json.
  2. User configuration, it's store at user home dir, filename: .sftpd.json.
  3. Workspace configuration, it's store at cwd, filename: .sftpd.json.

The configuration load order: App configuration -> User configuration -> Workspace configuration,The post-loaded configuration overrides the previously loaded configuration.

Settings:

# example/app.config.json

{
  // The host cert file,the ${appRoot} variable is dir of then executable file。
  "hostKeyFile": "${appRoot}/host_rsa",
  // default data dir, user root dir on that "dataDir/username"
  "dataDir": "${appRoot}/datas",
  // Greetings message
  "greeting": "Good luck!",
  // banner message
  "banner": "Wellcome to SFTP test server.",
  "ident": "sftp server by jover",
  // use debug mode
  "debug": true,
  // The maximum of connections for server
  "maxConnections": 1000,
  // user list
  "users": [
    {
      "username": "test1",
      // Password, encryption by hmac-sha256,and format with base64 encoding.
      "password": "4Dp32BhmHO533HGr5Pp3wFuZT216jc5hGLjxGGV+BOw=",
      // User root dir, the location of virtual path "/"
      "rootDir": "${appRoot}/datas/testUser",
      // The maximum of connections on for user
      "maxConnections": 1,
      "permission": {
        "MKDIR": true,
        "RMDIR": true,
        // read file
        "READ": true,
        // write file
        "WRITE": true,
        // Remove file
        "REMOVE": true,
        // Create file
        "CREATE": true
      }
    },
    {
      "username": "test2",
      "password": "4Dp32BhmHO533HGr5Pp3wFuZT216jc5hGLjxGGV+BOw=",
      "permission": {
        "MKDIR": true,
        "RMDIR": true,
        "READ": true,
        "WRITE": true,
        "REMOVE": true,
        "CREATE": true
      }
    }
  ],
  // server listen port
  "port": "22",
  // Is enable ttl,default value false
  "ttlEnable": false,
  // lock
  "ipLockTimes": 5,
  // If connections count is over ipLockTimes in ipLockSpan by same ip, the ip will be locked.
  "ipLockSpan": 300,
  // If not locked, the connections cout will be clean after ipLockTTL seconds.
  "ipLockTTL": 30,

  // log4js configrations see:`https://github.com/log4js-node/log4js-node`
  // "log": {...}
}

Developement

npm install
npm run example

Command

Pls look for help:

sftpd -h

Version

1.0.3

  • add reconfigure command, support hot reload config
  • add stop command, stop service

Thanks

sftpd is base by ssh2, thanks mscdex。