959.js 中文文档教程

发布于 7年前 浏览 16 项目主页 更新于 3年前

959.js

一个用纯 ECMAScript 6 编写的简单 FTP 服务器。

Features:

  • User management through simple JSON configuration file
  • Implements RFC 959 (but without active data transfer)
  • Implements RFC 697 (CWD)
  • CHMOD of files
  • Working directories per user
  • port ranges for passive mode
  • instant configuration reloading. you do not have to restart the ftp server when you change the ftp-config.json

Planned features:

我计划实现以下功能。 欢迎拉取请求。

  • Simple installation: npm install -g 959.js && 959.js
  • configurable configuration file name
  • Docker image
  • Windows compatibility
  • Anonymous support
  • Testing…
  • Remove moment.js dependency
  • TLS support (FTPS, FTPES)
  • RFC 2428 (IPv6)
  • RFC 7151 (Virtual Hosts)
  • RFC 3659

Usage

因为没有发布 npm 模块,你需要直接 git clone 这个存储库并运行以下命令:

grunt babel && node dist/user.js [YOUR_USERNAME] [YOUR_PASSWORD]

这输出如下:

sha512#9ba1f63365a6caf66e46348f43cdef956015bea997adeb06e69007ee3ff517df10fc5eb860da3d43b82c2a040c931119d2dfc6d08e253742293a868cc2d82015

复制这个字符串并将其放入名为 ftp-config.json 的文件中

{
  "users": [
    {
      "directory": "/var/ftp/[YOUR_USERNAME]",
      "username": "[YOUR_USERNAME]",
      "password": "sha512#9ba1f63365a6caf66e46348f43cdef956015bea997adeb06e69007ee3ff517df10fc5eb860da3d43b82c2a040c931119d2dfc6d08e253742293a868cc2d82015"
    }
  ]
}

之后为此,您可以像下面这样启动您的 FTP 服务器:

sudo node dist/server.js

sudo 是必需的,因为它必须绑定到端口 21。

要配置使用的被动端口,您可以像这样编辑配置文件:

{
    "passivePorts": ["10000-11000", "1337"],
    "users": [
        // ...
    ]
}

License

版权所有(c) 2017 蒂姆德克尔 根据麻省理工学院许可获得许可。

959.js

A simple FTP server written in pure ECMAScript 6.

Features:

  • User management through simple JSON configuration file
  • Implements RFC 959 (but without active data transfer)
  • Implements RFC 697 (CWD)
  • CHMOD of files
  • Working directories per user
  • port ranges for passive mode
  • instant configuration reloading. you do not have to restart the ftp server when you change the ftp-config.json

Planned features:

I plan implementing the following features. Pull requests are welcomed.

  • Simple installation: npm install -g 959.js && 959.js
  • configurable configuration file name
  • Docker image
  • Windows compatibility
  • Anonymous support
  • Testing…
  • Remove moment.js dependency
  • TLS support (FTPS, FTPES)
  • RFC 2428 (IPv6)
  • RFC 7151 (Virtual Hosts)
  • RFC 3659

Usage

Because there is no npm module published, you need to git clone this repository directly and run the following command:

grunt babel && node dist/user.js [YOUR_USERNAME] [YOUR_PASSWORD]

This outputs something like:

sha512#9ba1f63365a6caf66e46348f43cdef956015bea997adeb06e69007ee3ff517df10fc5eb860da3d43b82c2a040c931119d2dfc6d08e253742293a868cc2d82015

Copy this string and put it in a file named ftp-config.json

{
  "users": [
    {
      "directory": "/var/ftp/[YOUR_USERNAME]",
      "username": "[YOUR_USERNAME]",
      "password": "sha512#9ba1f63365a6caf66e46348f43cdef956015bea997adeb06e69007ee3ff517df10fc5eb860da3d43b82c2a040c931119d2dfc6d08e253742293a868cc2d82015"
    }
  ]
}

After this, you can start your FTP-Server like the following:

sudo node dist/server.js

sudo is necessary, because it has to be bound to port 21.

To configure the passive ports used you can edit the configuration file like this:

{
    "passivePorts": ["10000-11000", "1337"],
    "users": [
        // ...
    ]
}

License

Copyright (c) 2017 Timm Decker Licensed under the MIT license.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文