Skip to content

feat(drivers): add filen.io driver - #3153

Open
XyzenSun wants to merge 1 commit into
OpenListTeam:mainfrom
XyzenSun:feat/filen-driver
Open

XyzenSun wants to merge 1 commit into
OpenListTeam:mainfrom
XyzenSun:feat/filen-driver

Conversation

@XyzenSun

@XyzenSun XyzenSun commented Oct 1, 2026

Copy link
Copy Markdown

Summary / 摘要

新增 Filen(filen.io)网盘驱动,基于官方 filen-sdk-go 实现。

Filen 是一个端到端加密网盘(免费 10GB,邀请用户可额外获得30G),rclone 已原生支持且 SDK 已趋于稳定(rclone 的 filen 后端即基于此 SDK)。此网盘免费额度较慷慨,推荐接入,此前AList 仓库曾有相关需求 issue(AlistGo/alist#6726)(AlistGo/alist#7531),当时因官方API未开放无法实现。

功能:

  • 除Copy外(Filen.io API不支持)的文件操作:List / Get / Link / MakeDir / Move / Rename / Remove/ Put / GetDetails
  • 端到端加密:下载通过流式解密(提供商支持 Range 请求);上传按 1 mb 分块加密,BLAKE3 校验
  • meta声明 OnlyProxy / NoLinkURL:因文件内容加密存储,需要对端解密,无法提供直链,WebDAV 策略限制为本地代理/代理网址(与 Mega、ProtonDrive 行为一致)
  • 认证:邮箱 + 密码;API Key 为可选——留空时自动登录获取并回填到存储配置,后续挂载直接复用(无需安装 Filen CLI 导出 key)(不支持Filen.io V1账号,官方SDK已不支持)
  • 支持填写 TOTP 2FA 密钥(secret),开启两步验证的账号登录时自动生成动态码

依赖说明:

go.mod 新增 filen-sdk-go v0.0.39(直接依赖)及 3 个 indirect 依赖。SDK 依赖 rclone 的 fs 包做错误定义,而 OpenList 已依赖 rclone ,无需新增。go.sum 仅增量追加,既有条目无改动。

  • This PR has breaking changes. / 此 PR 包含破坏性变更。
  • This PR changes public API, config, storage format, or migration behavior. / 此 PR 修改了公开 API、配置、存储格式或迁移行为。
  • This PR requires corresponding changes in related repositories. / 此 PR 需要关联仓库同步修改。

Related repository PRs / 关联仓库 PR:

  • OpenList-Frontend: 无需修改
  • OpenList-Docs: 待合并后提交

Related Issues / 关联 Issue

与Openlist无直接issue关联,与Alist中(AlistGo/alist#6726)(AlistGo/alist#7531)关联

Testing / 测试

  • go test ./...

(filen 驱动编译、vet、测试通过;go test 输出中 189/123/chaoxing 等其他驱动的 non-constant format string 警告为 main 分支既有问题,与本 PR 无关)

  • Manual test / 手动测试:

SDK 独立验证(测试程序直连 filen-sdk-go,真实账号):初始化(V2 认证)、用户信息、创建目录、上传(分块加密 + BLAKE3)、列目录、下载并逐字节比对、重命名、移动、删除(回收站)、清空回收站——全部通过。

OpenList 端到端验证(API 层):

  • 挂载(api_key 留空自动登录 + 回填持久化)
  • fs/list / fs/mkdir / fs/get / fs/put / fs/rename / fs/move / fs/remove
  • 15 MB 大文件(15 个加密分块)上传/下载 MD5 一致
  • Range 请求内容一致
  • 空文件(0 字节)上传
  • multipart 分片上传(/api/fs/multipart/*)完整流程
  • WebDAV 策略选项正确受限(无 302)

WebUI / 移动端验收:图片、音频、视频预览播放正常,上传下载功能正常,桌面端与手机端均验证通过。详见下方截图:
PC端(MacOS 26 Chrome149):
截屏2026-10-01 09 44 58
截屏2026-10-01 09 45 07
截屏2026-10-01 09 45 29
截屏2026-10-01 09 46 00
移动端:(Android14 Chrome137)
微信图片_20261001101414_24_130
微信图片_20261001101415_25_130
微信图片_20261001101416_26_130

Checklist / 检查清单

  • I have read CONTRIBUTING. / 我已阅读 CONTRIBUTING。
  • I confirm this contribution follows the repository license, contribution policy, and code of conduct. / 我确认此贡献符合仓库许可证、贡献规范和行为准则。
  • I have formatted the changed code with gofmt, go fmt, or prettier where applicable. / 我已按适用情况使用 gofmt、go fmt 或 prettier 格式化变更代码。
  • I have requested review from relevant maintainers or code owners where applicable. / 我已在适用情况下请求相关维护者或代码所有者审查。

AI Disclosure / AI 使用声明

  • This PR includes AI-assisted content. / 此 PR 包含 AI 辅助内容。

Tools used / 使用工具:

  • Pi

Usage scope / 使用范围:

  • Code generation / 代码生成

  • Documentation / 文档

  • Tests / 测试

  • I have reviewed and validated all AI-assisted content included in this PR. / 我已审核并验证此 PR 中的所有 AI 辅助内容。

  • I have ensured that all AI-assisted commits include Co-Authored-By attribution. / 我已确保所有 AI 辅助提交都包含 Co-Authored-By 归属信息。

  • I can reproduce all AI-assisted content included in this PR without any AI tools. / 我可以在没有任何 AI 工具的情况下重现此 PR 中包含的所有 AI 辅助内容。

Add native Filen (filen.io) cloud storage driver based on the official
filen-sdk-go.

Features:
- List/Get/Link/MakeDir/Move/Rename/Remove/Put/GetDetails
- E2E encryption: downloads stream via RangeReader with client-side
  decryption, uploads are chunked (1 MiB) and encrypted
- Auth: email + password, with optional API key; when the API key is
  empty the driver logs in automatically and persists the obtained
  key back to the storage config
- Optional TOTP 2FA secret support for accounts with two-factor
  authentication enabled
@XyzenSun

XyzenSun commented Oct 1, 2026

Copy link
Copy Markdown
Author

补充一下:https://github.com/XyzenSun/OpenList-Filen/actions/runs/36805662241 构建CI正常

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.

1 participant