Skip to content

transferring files between devices by WebDAV, support end-to-end encryption

Notifications You must be signed in to change notification settings

HSwift/filedrop

Repository files navigation

filedrop

使用多种协议在不同设备之间传输分享文件,支持多个储存容器,可配置AES-128-OFB端到端加密,实现安全的跨设备文件分享。

使用方法

  1. 创建配置文件
❯ ./filedrop config --init

this operation will clear the original configuration file!
set a new container, name: test-container
provider type (must be in (webdav)): webdav
enable end-to-end encryption [y/N]: y
16 bytes encryption key (empty to auto generating):
storage root ('/filedrop'):
url: http://webdav.server/
username: test
password:
initialize the configuration file successfully, if you want to modify it, please edit /home/user/.config/filedrop/filedrop.toml

根据提示输入配置信息,创建存储容器,选择存储协议,并配置存储协议的认证和链接信息。如需启用端到端加密,可以选择自定义密钥或自动生成的高强度密钥。本次创建的存储容器会被设置为默认容器。

注意:以上所以信息会以明文形式存储在filedrop/filedrop.toml文件中,有被其他软件和用户窃取的风险。

  1. 上传文件
filedrop up <filepath> [-c CONTAINER]

在第一次运行时,会根据对应容器配置中的root选项在远程创建对应的目录。文件上传完成后,会生成一个6位字母数字混合的code。上传的文件会以code,base64(filename) 的形式保存在该目录中。如果启用了端到端加密,文件内容会使用AES-128-OFB加密存储,但文件名仍然是明文

可以通过-c CONTAINER指定其他的存储容器。

  1. 下载文件到当前目录
filedrop down [code] [-c CONTAINER]

给出code时,会下载code所代表的文件。省略code时,会下载最新上传的文件。如果本地有同名文件,请自行选择是否覆盖。

  1. 列出文件
filedrop list [-c CONTAINER]

列出对应容器内的所有文件,显示文件代码、上传日期、文件类型、文件名和文件大小。

  1. 删除文件
filedrop remove <code> [-c CONTAINER]

删除对应容器内,给定code所代表的文件。

  1. 清理文件
filedrop prune <hours=24> [-c CONTAINER]

清理对应容器内,上传时间超过给定小时数的文件,默认为24小时。

可选的存储协议

坚果云[webdav]

  1. 注册一个坚果云帐号
  2. 注册完成后,在右上角查看"用户信息"
  3. 查看"安全选项"选项卡
  4. 在"第三方应用管理"中添加一个应用,应用名称任意,然后生成密码
  5. 在filedrop中添加一个container,设置url为 https://dav.jianguoyun.com/dav/ ,并配置用户名和密码。

Linux服务器[sftp]

  1. 打开服务器的sshd
  2. 在服务器中添加filedrop专用帐号或使用普通用户帐号
  3. 在filedrop中添加一个container,设置ssh的用户名,密码(可选),主机名,端口(可选,默认22),私钥文件(可选,默认为$HOME/.ssh/id_rsa)。但url中的路径会被忽略。

TODO

  • 支持SFTP协议
  • 支持上传文件夹
  • 支持文件夹同步

About

transferring files between devices by WebDAV, support end-to-end encryption

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages