Skip to content

Conversation

@xrgzs
Copy link
Contributor

@xrgzs xrgzs commented May 3, 2025

适配 Cloudreve V4,其API部分发生改动较大,特独立成一个存储。

Close: #8328
Close: #8467

此外,本 PR 还进行了:

  • 对之前的 Cloudreve、OneDrive、OneDrive APP 驱动(使用类似的上传方法)加入了分片上传失败自动重试机制,提高上传成功率。
  • 对 Cloudreve 增加了 feat: add Reference interface to driver #7805 引入的 ref 支持。

文档:AlistGo/docs#433

参数说明

鉴权

Cloudreve V4 支持使用 Access Token 和 Refresh Token 进行鉴权,这意味着挂载鉴权方式分为:

  1. 账号+密码:会自动使用登录接口获取 Access Token 和 Refresh Token,存在验证码问题
  2. 仅 Refresh Token:会自动使用刷新接口续期 Access Token 和 Refresh Token,参数可从浏览器请求或者 Local Storage 中找到
  3. 仅 Access Token:能够临时使用,但会过期,且无法续期
  4. 无:匿名用户,适用于公开分享
  5. 备注填写 ref:/{挂载路径}:从 已挂载的存储 中引用认证、令牌等,同一个 Token 多个网盘使用

根文件夹路径

Cloudreve V4 采用自定义 URI 作为路径。可从网页链接的 ?path= 中获取。

挂载「我的文件」

默认为 cloudreve://my/,列出用户文件。

挂载「分享」

支持挂载文件夹类型的分享,路径填写为:cloudreve://{分享ID}@share/

  • 分享ID为分享链接 /s/ 后面的参数。

  • 目前 Cloudreve V4 不支持「创建带密码的分享」。

启用文件夹大小

Cloudreve V4 服务端统计每个文件夹的大小,启用可能会造成服务端报错,默认禁用。

启用缩略图

Cloudreve V4 服务端为每个文件生成略缩图,启用可能会造成服务端报错,默认禁用。

启用版本上传

启用覆盖上传并保留之前的版本,需要消耗额外的空间。默认禁用,为覆盖上传前删除已有的文件。

自定义 UA

用于自定义请求使用的 User-Agent 头部信息。留空为 Alist 默认。

排序

支持更改请求列表时排序的参数。

上传策略

支持上传到的存储策略如下:

  • 本机存储
  • 从机存储
  • OneDrive
  • S3

上传的存储策略请在 Cloudreve V4 网页端进入相应文件夹中进行设置(需要服务端为 Cloudreve Pro)。

如果分享开启了上传权限,支持上传。需要服务端为用户组勾选「提升匿名用户权限」(需要服务端为 Cloudreve Pro)。

@petercat-assistant
Copy link

Walkthrough

This pull request introduces a new driver for Cloudreve V4, integrating it into the existing system. It includes the implementation of various functionalities such as file listing, linking, directory creation, file movement, renaming, copying, removal, and uploading. Additionally, it handles authentication and token refresh processes.

Changes

File Summary
drivers/all.go Added import for the new Cloudreve V4 driver.
drivers/cloudreve_v4/driver.go Implemented the core functionalities for the Cloudreve V4 driver, including file operations and authentication.
drivers/cloudreve_v4/meta.go Defined additional configurations and initialization for the Cloudreve V4 driver.
drivers/cloudreve_v4/types.go Added type definitions related to Cloudreve V4, including objects, responses, and policies.
drivers/cloudreve_v4/util.go Implemented utility functions for handling requests and uploads in the Cloudreve V4 driver.

@alivemaster
Copy link

Cloudreve V4使用相同的api端点获取用户目录或分享链接的文件列表(分享链接: /api/v4/file?uri=cloudreve://{分享链接ID}@share/)。希望支持分享链接挂载

@xhofe xhofe merged commit ffa03bf into AlistGo:main May 24, 2025
12 checks passed
@xrgzs xrgzs deleted the cloudreve branch May 25, 2025 00:19
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.

cloudreve的v4 希望适配cloudreve v4新版本

3 participants