Skip to main content

介绍

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

特性

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

安装方法

pip install i2ftp-server

环境需求

  • Python3.6+
  • i2cylib >= 1.8.14

集成命令

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

默认配置文件路径

/usr/share/i2ftp/server_conf.json

附:通讯协议说明

通讯流程:

  1. 客户端与服务器建立TCP连接
  2. 客户端与服务器建立I2TCP连接
  3. 服务器发送版本号 b"I2FTP x.x"
  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>,<uint64 文件指针偏移量>,<uint64 截止文件指针偏移量>

    • 若单个返回包无法一次传输请求的长度,服务器会依次发送多个数据包,直到满足请求的长度为止。

    • 截止文件指针偏移量文件指针偏移量,则服务器会认为是请求了从文件指针偏移量开始到文件末尾的数据。

    • 返回:<bool 操作是否有效>,[uint64 文件指针偏移量],[bytes 数据内容 最大长度524128 Bytes] (单个或序列)

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

    • 返回:<bool 操作是否有效>,[16 bytes 上传会话ID]
  • 客户端命令 - “通过会话ID上传”:UPLD,<16 bytes 上传会话ID>,<uint64 文件指针偏移量>,<bytes 数据内容 最大长度524128 Bytes>

    • 返回:<bool 上传是否成功>,[int 当前文件指针偏移量]
  • 客户端命令 - “关闭会话”:CLOZ,<16 bytes 会话ID>

    • 返回:<bool 操作是否成功>,[hex_str 若会话为下载会话,则会同时返回文件的MD5校验值]
  • 客户端命令 - “文件/文件夹操作”:FIOP,<int 命令:0-重命名,1-移动,2-复制,3-删除,4-创建目录>,<str 路径1>,[str 路径2]

    • 返回:<bool 操作是否成功>
  • 管理员命令 - “进程控制”:PCTL,[raw 保留字段]

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

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.3.9.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

i2ftps-0.3.9-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: i2ftps-0.3.9.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for i2ftps-0.3.9.tar.gz
Algorithm Hash digest
SHA256 e979e1d8ff02160167ae9e1e5f967f54b1f00163519fff6052a89ff551956ccd
MD5 54dc8a477c3a5e3a12b97ff0049b8439
BLAKE2b-256 e819c0849c0780620b71fb349caaddb67a1e52918baceb5e2e2a67ba87351c2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: i2ftps-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for i2ftps-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 18e970830df3d212580db8a535debb71f1e625a001d65696dd3216eb628624f0
MD5 7b67181a330660028b0111e3e322f0f6
BLAKE2b-256 b634e8fa496b98de08f953940d61484097f0880dd352e84f1f963db1f67d4523

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.9 This release

2 files

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Supported by

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