Zoho

Zoho WorkDrive 是由 Zoho 创建的云存储解决方案。

配置

下面是制作 Zoho 配置的示例。 首先运行

rclone config

这将引导你完成交互式设置过程:

No remotes found, make a new one?
n) New remote
s) Set configuration password
n/s> n
name> remote
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
[snip]
XX / Zoho
   \ "zoho"
[snip]
Storage> zoho
** See help for zoho backend at: https://rclone.cn/zoho/ **

OAuth Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id> 
OAuth Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> 
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n
Remote config
Use web browser to automatically authenticate rclone with remote?
 * Say Y if the machine running rclone has a web browser you can use
 * Say N if running rclone on a (remote) machine without web browser access
If not sure try Y. If Y failed, try N.
y) Yes (default)
n) No
y/n> 
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=LVn0IHzxej1ZkmQw31d0wQ
Log in and authorize rclone for access
Waiting for code...
Got code
Choose a number from below, or type in your own value
 1 / MyTeam
   \ "4u28602177065ff22426787a6745dba8954eb"
Enter a Team ID> 1
Choose a number from below, or type in your own value
 1 / General
   \ "4u2869d2aa6fca04f4f2f896b6539243b85b1"
Enter a Workspace ID> 1
Configuration complete.
Options:
- type: zoho
- token: {"access_token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","token_type":"Zoho-oauthtoken","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","expiry":"2020-10-12T00:54:52.370275223+02:00"}
- root_folder_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Keep this "remote" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> 

请参考 远程设置文档 了解如何在没有可用互联网浏览器的机器上进行设置。

Rclone 会在你的本地计算机上运行一个 Web 服务器,用于从 Zoho WorkDrive 收集授权令牌。这个过程仅从你的浏览器打开的那一刻开始,直到令牌返回为止。Web 服务器运行在 http://127.0.0.1:53682/。如果本地端口 53682 受到防火墙保护,你可能需要临时解除防火墙限制以完成授权。

配置完成后,你可以像这样使用 rclone

查看顶级目录

rclone lsd remote:

创建一个新目录

rclone mkdir remote:directory

列出目录的内容

rclone ls remote:directory

/home/local/directory 同步到远程路径,并删除该路径中多余的文件。

rclone sync --interactive /home/local/directory remote:directory

Zoho 路径可以按需设置深度,例如 remote:directory/subdirectory

修改时间和哈希值

目前,Zoho WorkDrive 不支持修改时间。

不支持任何哈希算法。

使用信息

要查看当前的配额,你可以使用 rclone about remote: 命令,该命令将显示你当前的使用情况。

受限文件名的字符

仅会替换控制字符和无效的 UTF - 8 字符。此外,大多数 Unicode 全角字符完全不支持,在上传时会从文件名中删除。

标准选项

以下是 Zoho(Zoho WorkDrive)特有的标准选项。

–zoho - client - id

OAuth 客户端 ID。

通常留空。

属性:

  • 配置项:client_id
  • 环境变量:RCLONE_ZOHO_CLIENT_ID
  • 类型:字符串
  • 是否必需:否

–zoho - client - secret

OAuth 客户端密钥。

通常留空。

属性:

  • 配置项:client_secret
  • 环境变量:RCLONE_ZOHO_CLIENT_SECRET
  • 类型:字符串
  • 是否必需:否

–zoho - region

要连接的 Zoho 区域。

你必须使用你的组织注册所在的区域。如果不确定,请使用你在浏览器中连接时使用的顶级域名。

属性:

  • 配置项:region
  • 环境变量:RCLONE_ZOHO_REGION
  • 类型:字符串
  • 是否必需:否
  • 示例:
    • “com”
      • 美国 / 全球
    • “eu”
      • 欧洲
    • “in”
      • 印度
    • “jp”
      • 日本
    • “com.cn”
      • 中国
    • “com.au”
      • 澳大利亚

高级选项

以下是 Zoho(Zoho WorkDrive)特有的高级选项。

–zoho - token

OAuth 访问令牌,以 JSON 格式存储。

属性:

  • 配置项:token
  • 环境变量:RCLONE_ZOHO_TOKEN
  • 类型:字符串
  • 是否必需:否

–zoho - auth - url

认证服务器 URL。

留空则使用提供商的默认值。

属性:

  • 配置项:auth_url
  • 环境变量:RCLONE_ZOHO_AUTH_URL
  • 类型:字符串
  • 是否必需:否

–zoho - token - url

令牌服务器 URL。

留空则使用提供商的默认值。

属性:

  • 配置项:token_url
  • 环境变量:RCLONE_ZOHO_TOKEN_URL
  • 类型:字符串
  • 是否必需:否

–zoho - client - credentials

使用客户端凭证 OAuth 流程。

这将使用 RFC 6749 中描述的 OAUTH2 客户端凭证流程。

属性:

  • 配置项:client_credentials
  • 环境变量:RCLONE_ZOHO_CLIENT_CREDENTIALS
  • 类型:布尔值
  • 默认值:false

–zoho - upload - cutoff

切换到大型文件上传 API 的阈值(>= 10 MiB)。

属性:

  • 配置项:upload_cutoff
  • 环境变量:RCLONE_ZOHO_UPLOAD_CUTOFF
  • 类型:SizeSuffix
  • 默认值:10Mi

–zoho - encoding

后端的编码方式。

有关更多信息,请参阅 概述中的编码部分

属性:

  • 配置项:encoding
  • 环境变量:RCLONE_ZOHO_ENCODING
  • 类型:Encoding
  • 默认值:Del,Ctl,InvalidUtf8

–zoho - description

远程存储的描述。

属性:

  • 配置项:description
  • 环境变量:RCLONE_ZOHO_DESCRIPTION
  • 类型:字符串
  • 是否必需:否

设置你自己的 client_id

对于 Zoho,我们建议你设置自己的 client_id。为此,你必须完成以下步骤。

  1. 登录到 [Zoho API 控制台](https://api - console.zoho.com)。

  2. 创建一个类型为“基于服务器的应用程序”的新客户端。名称和网站无关紧要,但你必须添加重定向 URL http://localhost:53682/

  3. 客户端创建完成后,你可以转到设置选项卡并在其他区域启用它。

现在,客户端 ID 和客户端密钥可以与 rclone 一起使用。