Skip to main content

A FTP server based on I2TCP

Project description

介绍

本项目为一款基于I2TCP通讯协议 的文件传输服务器, 有效密钥长度达到512bit,同时嵌有类Google双重认证机制, 确保服务能在公网环境下安全存活。

特性

  • 支持文件断点续传
  • 支持文件哈希校验
  • 仅允许访问设定目录下的文件
  • 可设置只读模式
  • 512 bits有效密钥长度
  • 动态token身份认证
  • 可选TLS加密

安装方法

pip install i2ftp-server

环境需求

  • Python3.7+
  • i2cylib >= 1.8.6

集成命令

  • i2ftps-setup 服务器配置向导
  • i2ftps 服务器启动/停止

默认配置文件路径

/usr/share/i2ftp/server_conf.json

附:通讯协议说明

通讯流程:

  1. 客户端与服务器建立TCP连接
  2. 客户端与服务器建立I2TCP连接
  3. 服务器发送版本号
  4. 客户端发送User指令
  5. 服务器响应User指令

协议结构:

底层 TCP/IPI2TCPUser 顶层

User层数据包:

  • 客户端命令 - “查询”:LIST,<PATH>

    返回:<bool 路径是否存在>,{'文件1':{is_dir:<bool 是否是文件夹> size:<int 大小>, time:<float 文件修改时间戳>}}

  • 客户端命令 - “请求下载”:GETF,<PATH>

    返回:<bool 请求是否接受>,[16 bytes 下载会话ID]

  • 客户端命令 - “通过会话ID下载”:DOWN,<16 bytes 下载会话ID>,<int 文件指针偏移量>

    返回:<bool 操作是否有效>,[bytes 数据内容 最大长度8192 Bytes]

  • 客户端命令 - “请求上传”:PULF,<PATH>,<str_hex 文件哈希校验值>

    返回:<bool 操作是否有效>,[16 bytes 上传会话ID]

  • 客户端命令 - “通过会话ID上传”:UPLD,<16 bytes 上传会话ID>,<int 文件指针偏移量>,<bytes 数据内容 最大长度8192 Bytes>

    返回:<bool 上传是否成功>,[int 当前文件指针偏移量]

  • 客户端命令 - “关闭会话”:CLOZ,<16 bytes 会话ID>

    返回:<bool 操作是否成功>,[hex_str 若会话为下载会话,则会同时返回文件的SHA256校验值]

  • 客户端命令 - “文件/文件夹操作”:FIOP,<int 命令:0-重命名,1-移动,2-复制,3-删除,4-创建目录>,<str 路径1>,[str 路径2]

    返回:<bool 操作是否成功>

  • 管理员命令 - “进程控制”:PCTL,[raw 保留字段]

    返回:<bool 操作是否成功>,<int 进程PID>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

i2ftps-0.0.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

i2ftps-0.0.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file i2ftps-0.0.1.tar.gz.

File metadata

  • Download URL: i2ftps-0.0.1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.0

File hashes

Hashes for i2ftps-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9e7dc80e7ff893f06ecbe7fa3939b1c2006686213b1c08d39d95251838cd6ec5
MD5 cc46b268ecd37048a7c47c1f25eaf62b
BLAKE2b-256 8548dae13606a07b4a7f50279d1472d4c335e0beaf9ffa1416c96eb09885fbc2

See more details on using hashes here.

File details

Details for the file i2ftps-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: i2ftps-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.0

File hashes

Hashes for i2ftps-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb071eefe527f6c5456ea04d0bf5fa4daaa604b00c6453860d2c35117cb01fb3
MD5 5ffc15e7060cf85d60ca41eed2240342
BLAKE2b-256 71355af02cfbdbcfc1d103440dfaec10c85f0852f8239cbf8195acb77fd0099d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page