Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: sftp server support #7643

Merged
merged 3 commits into from
Dec 12, 2024
Merged

feat: sftp server support #7643

merged 3 commits into from
Dec 12, 2024

Conversation

KirCute
Copy link
Contributor

@KirCute KirCute commented Dec 11, 2024

SFTP server endpoint powered by taruti/sftpd (with reference to leffss/sftpd)
Listen on 5222 port by default.

这个跟 FTP 服务器一样,也是除了我试了好像没问题以外什么都不能保证,SFTP 比 FTP 还过分,接口天然就是随机访问的形式的,哪怕客户端就是要顺序读写,也必须以随机读写的形式请求。这两个协议跟用 HTTP 传文件的那些协议设计理念上差距挺大的,适配起来确实很拧巴,就凑合着用吧。

FTP 实现了一个自定义命令SITE SIZE,在使用STOR命令上传文件之前可以先使用这个命令提交文件大小,之后上传的时候就不会在本地产生临时文件,而是直接将数据流转发到存储介质了,不过要利用这个特性可能还需要写一些 FTP 客户端插件。我最开始看到 SFTP 上传文件会提交一个 length 参数,以为是完整的文件大小才写的这个 feat,后来才发现它其实是文件分片的大小,所以这个和 SFTP 没有关系的 feat 只能挤在这个提交里了。

TODO:

  • 添加 DSA、ECDSA、ED25519 算法的 HostKey
  • 添加公钥验证

@xhofe xhofe merged commit 33ba7f1 into AlistGo:main Dec 12, 2024
3 checks passed
@KirCute KirCute deleted the feat/sftp-server branch December 12, 2024 12:56
long2005a1 added a commit to long2005a1/Long-Cloud that referenced this pull request Dec 16, 2024
@KirCute KirCute mentioned this pull request Dec 21, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants