From 40a82ab0d105d330ced28d1e2232a3225b6f3686 Mon Sep 17 00:00:00 2001 From: krau <71133316+krau@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:33:14 +0800 Subject: [PATCH] docs: add Rclone support to documentation for configuration and usage --- README.md | 1 + README_zh.md | 1 + .../en/deployment/configuration/storages.md | 56 +++++++++++++++++++ docs/content/zh/_index.md | 1 + .../zh/deployment/configuration/storages.md | 56 +++++++++++++++++++ 5 files changed, 115 insertions(+) diff --git a/README.md b/README.md index d14c7d7..1ee7dc5 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ - S3 - WebDAV - Local filesystem + - Rclone (via command line) - Telegram (re-upload to specified chats) ## 📦 Quick Start diff --git a/README_zh.md b/README_zh.md index da80fd8..8907c82 100644 --- a/README_zh.md +++ b/README_zh.md @@ -33,6 +33,7 @@ - S3 - WebDAV - 本地磁盘 + - Rclone - Telegram (重传回指定聊天) ## 快速开始 diff --git a/docs/content/en/deployment/configuration/storages.md b/docs/content/en/deployment/configuration/storages.md index 6b6ca8f..73daed6 100644 --- a/docs/content/en/deployment/configuration/storages.md +++ b/docs/content/en/deployment/configuration/storages.md @@ -80,4 +80,60 @@ chat_id = "123456789" # Telegram chat ID, the bot will send files to this chat force_file = false # Force sending as file, default is false skip_large = false # Skip large files, default is false. If enabled, files exceeding Telegram's limit will not be uploaded. spilt_size_mb = 2000 # Split size in MB, default is 2000 MB (2 GB). Files larger than this will be split into multiple parts (zip format). Ignored when skip_large is true. +``` + +## Rclone + +`type=rclone` + +Supports multiple cloud storage services through the [rclone](https://rclone.org/) command-line tool. You need to install rclone and configure remote storage first. + +```toml +# Remote name configured in rclone, can be any remote defined in rclone.conf +remote = "mydrive" +# Base path in the remote storage, all files will be stored under this path +base_path = "/telegram" +# Path to rclone config file, optional, leave empty to use default path (~/.config/rclone/rclone.conf) +config_path = "" +# Additional flags to pass to rclone commands, optional +flags = ["--transfers", "4", "--checkers", "8"] +``` + +### Configuring rclone Remote + +First, you need to configure an rclone remote. Run `rclone config` for interactive configuration, or directly edit the `rclone.conf` file. + +rclone supports many cloud storage services, including but not limited to: +- Google Drive +- Dropbox +- OneDrive +- Amazon S3 and compatible services +- SFTP +- FTP +- For more services, please refer to the [rclone official documentation](https://rclone.org/overview/) + +### Usage Examples + +After configuring Google Drive, you can configure the storage like this: + +```toml +[[storages]] +name = "GoogleDrive" +type = "rclone" +enable = true +remote = "gdrive" +base_path = "/SaveAnyBot" +``` + +If using a custom rclone config file: + +```toml +[[storages]] +name = "MyRemote" +type = "rclone" +enable = true +remote = "myremote" +base_path = "/backup" +config_path = "/path/to/rclone.conf" +flags = ["--progress"] ``` \ No newline at end of file diff --git a/docs/content/zh/_index.md b/docs/content/zh/_index.md index 4900995..a8df905 100644 --- a/docs/content/zh/_index.md +++ b/docs/content/zh/_index.md @@ -29,6 +29,7 @@ title: 介绍 - S3 - WebDAV - 本地磁盘 + - Rclone (通过命令行调用) - Telegram (重传回指定聊天) ## [贡献者](https://github.com/krau/SaveAny-Bot/graphs/contributors) diff --git a/docs/content/zh/deployment/configuration/storages.md b/docs/content/zh/deployment/configuration/storages.md index 09df5dc..37a8564 100644 --- a/docs/content/zh/deployment/configuration/storages.md +++ b/docs/content/zh/deployment/configuration/storages.md @@ -86,4 +86,60 @@ skip_large = false # 超过该大小的文件将被分割成多个部分上传.(使用 zip 格式) # 当 skip_large 启用时, 该选项无效. spilt_size_mb = 2000 +``` + +## Rclone + +`type=rclone` + +通过 [rclone](https://rclone.org/) 命令行工具支持多种云存储服务. 需要先安装 rclone 并配置好远程存储. + +```toml +# rclone 配置的远程名称, 可以是任何在 rclone.conf 中配置的远程 +remote = "mydrive" +# 在远程存储中的基础路径, 所有文件将存储在此路径下 +base_path = "/telegram" +# rclone 配置文件的路径, 可选, 留空使用默认路径 (~/.config/rclone/rclone.conf) +config_path = "" +# 传递给 rclone 命令的额外参数, 可选 +flags = ["--transfers", "4", "--checkers", "8"] +``` + +### 配置 rclone 远程 + +首先需要配置 rclone 远程, 运行 `rclone config` 命令进行交互式配置, 或直接编辑 `rclone.conf` 文件. + +rclone 支持多种云存储服务, 包括但不限于: +- Google Drive +- Dropbox +- OneDrive +- Amazon S3 及兼容服务 +- SFTP +- FTP +- 更多服务请参考 [rclone 官方文档](https://rclone.org/overview/) + +### 使用示例 + +配置 Google Drive 后, 可以这样配置存储: + +```toml +[[storages]] +name = "GoogleDrive" +type = "rclone" +enable = true +remote = "gdrive" +base_path = "/SaveAnyBot" +``` + +如果使用自定义的 rclone 配置文件: + +```toml +[[storages]] +name = "MyRemote" +type = "rclone" +enable = true +remote = "myremote" +base_path = "/backup" +config_path = "/path/to/rclone.conf" +flags = ["--progress"] ``` \ No newline at end of file