Files
SaveAny-Bot/en/deployment/configuration/storages/index.html
2026-03-11 11:38:19 +00:00

89 lines
19 KiB
HTML

<!doctype html><html lang=en dir=ltr><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content='
Storage Configuration
#
Please first read the Configuration Guide to understand the basic format of the configuration file.
Alist
#
type=alist
Stream mode is not supported.
url = "https://alist.example.com" # URL of Alist
username = "your_username" # Username for Alist
password = "your_password" # Password for Alist
base_path = "/path/saveanybot" # Base path in Alist, all files will be stored under this path
token_exp = 3600 # Auto-refresh time for Alist access token, in seconds
token = "your_token"
# Access token for Alist, optional, if not set, username and password will be used for authentication.
# When using token authentication, the token cannot be automatically refreshed
Local Disk
#
type=local'><meta name=theme-color media="(prefers-color-scheme: light)" content="#ffffff"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#343a40"><meta name=color-scheme content="light dark"><meta property="og:url" content="https://sabot.unv.app/en/deployment/configuration/storages/"><meta property="og:site_name" content="Save Any Bot"><meta property="og:title" content="Storage Configuration"><meta property="og:description" content='Storage Configuration # Please first read the Configuration Guide to understand the basic format of the configuration file.
Alist # type=alist
Stream mode is not supported.
url = "https://alist.example.com" # URL of Alist username = "your_username" # Username for Alist password = "your_password" # Password for Alist base_path = "/path/saveanybot" # Base path in Alist, all files will be stored under this path token_exp = 3600 # Auto-refresh time for Alist access token, in seconds token = "your_token" # Access token for Alist, optional, if not set, username and password will be used for authentication. # When using token authentication, the token cannot be automatically refreshed Local Disk # type=local'><meta property="og:locale" content="en"><meta property="og:type" content="article"><meta property="article:section" content="deployment"><meta property="article:modified_time" content="2026-01-30T13:34:29+08:00"><title>Storage Configuration | Save Any Bot</title><link rel=icon href=/favicon.png><link rel=manifest href=/manifest.json><link rel=canonical href=https://sabot.unv.app/en/deployment/configuration/storages/><link rel=alternate hreflang=zh href=https://sabot.unv.app/deployment/configuration/storages/ title=存储端配置><link rel=stylesheet href=/book.min.a22f4c7d8c2bdc5e3d6e34ba11cb59ab50ea5772594e71305bfd5a595dc78b7e.css integrity="sha256-oi9MfYwr3F49bjS6EctZq1DqV3JZTnEwW/1aWV3Hi34=" crossorigin=anonymous></head><body dir=ltr><input type=checkbox class="hidden toggle" id=menu-control>
<input type=checkbox class="hidden toggle" id=toc-control><main class="container flex"><aside class=book-menu><div class=book-menu-content><nav><h2 class=book-brand><a class="flex align-center" href=/en/><img src=/logo.png alt=Logo class=book-icon><span>Save Any Bot</span></a></h2><ul class=book-languages><li><input type=checkbox id=languages class=toggle>
<label for=languages class=flex><a role=button class="flex flex-auto"><img src=/svg/translate.svg class=book-icon alt=Languages>
English</a></label><ul><li><a href=/deployment/configuration/storages/>简体中文</a></li></ul></li></ul><ul><li><a href=https://github.com/krau/SaveAny-Bot target=_blank rel=noopener>🔗 GitHub</a></li></ul><ul><li><span>Deployment Guide</span><ul><li><a href=/en/deployment/configuration/>Configuration Guide</a><ul><li><a href=/en/deployment/configuration/storages/ class=active>Storage Configuration</a></li></ul></li><li><a href=/en/deployment/installation/>Installation and Updates</a></li></ul></li><li><a href=/en/usage/>Usage</a><ul><li><a href=/en/usage/silent/>Silent Mode</a></li><li><a href=/en/usage/rules/>Storage Rules</a></li><li><a href=/en/usage/watch/>Watch Chats</a></li><li><a href=/en/usage/directlinks/>Direct Download Links</a></li><li><a href=/en/usage/aria2/>Aria2 Download</a></li><li><a href=/en/usage/ytdlp/>yt-dlp Video Download</a></li><li><a href=/en/usage/transfer/>Storage Transfer</a></li><li><a href=/en/usage/parsers/>Save Files Outside Telegram</a></li><li><a href=/en/usage/api/>HTTP API</a></li></ul></li><li><a href=/en/help/>Frequently Asked Questions</a><ul></ul></li><li><a href=/en/contribute/>Contributing</a><ul></ul></li></ul></nav><script>(function(){var e=document.querySelector("aside .book-menu-content");addEventListener("beforeunload",function(){localStorage.setItem("menu.scrollTop",e.scrollTop)}),e.scrollTop=localStorage.getItem("menu.scrollTop")})()</script></div></aside><div class=book-page><header class=book-header><div class="flex align-center justify-between"><label for=menu-control><img src=/svg/menu.svg class=book-icon alt=Menu></label><h3>Storage Configuration</h3><label for=toc-control><img src=/svg/toc.svg class=book-icon alt="Table of Contents"></label></div><aside class="hidden clearfix"><nav id=TableOfContents><ul><li><a href=#alist>Alist</a></li><li><a href=#local-disk>Local Disk</a></li><li><a href=#webdav>WebDAV</a></li><li><a href=#s3>S3</a></li><li><a href=#telegram>Telegram</a></li><li><a href=#rclone>Rclone</a><ul><li><a href=#configuring-rclone-remote>Configuring rclone Remote</a></li><li><a href=#usage-examples>Usage Examples</a></li></ul></li></ul></nav></aside></header><article class="markdown book-article"><h1 id=storage-configuration>Storage Configuration
<a class=anchor href=#storage-configuration>#</a></h1><p>Please first read the <a href=../>Configuration Guide</a> to understand the basic format of the configuration file.</p><h2 id=alist>Alist
<a class=anchor href=#alist>#</a></h2><p><code>type=alist</code></p><p>Stream mode is not supported.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-toml data-lang=toml><span style=display:flex><span><span style=color:#a6e22e>url</span> = <span style=color:#e6db74>&#34;https://alist.example.com&#34;</span> <span style=color:#75715e># URL of Alist</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>username</span> = <span style=color:#e6db74>&#34;your_username&#34;</span> <span style=color:#75715e># Username for Alist</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>password</span> = <span style=color:#e6db74>&#34;your_password&#34;</span> <span style=color:#75715e># Password for Alist</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>base_path</span> = <span style=color:#e6db74>&#34;/path/saveanybot&#34;</span> <span style=color:#75715e># Base path in Alist, all files will be stored under this path</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>token_exp</span> = <span style=color:#ae81ff>3600</span> <span style=color:#75715e># Auto-refresh time for Alist access token, in seconds</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>token</span> = <span style=color:#e6db74>&#34;your_token&#34;</span>
</span></span><span style=display:flex><span><span style=color:#75715e># Access token for Alist, optional, if not set, username and password will be used for authentication.</span>
</span></span><span style=display:flex><span><span style=color:#75715e># When using token authentication, the token cannot be automatically refreshed</span>
</span></span></code></pre></div><h2 id=local-disk>Local Disk
<a class=anchor href=#local-disk>#</a></h2><p><code>type=local</code></p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-toml data-lang=toml><span style=display:flex><span><span style=color:#a6e22e>base_path</span> = <span style=color:#e6db74>&#34;./downloads&#34;</span> <span style=color:#75715e># Base path for local storage, all files will be stored under this path</span>
</span></span></code></pre></div><h2 id=webdav>WebDAV
<a class=anchor href=#webdav>#</a></h2><p><code>type=webdav</code></p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-toml data-lang=toml><span style=display:flex><span><span style=color:#a6e22e>url</span> = <span style=color:#e6db74>&#34;https://webdav.example.com&#34;</span> <span style=color:#75715e># URL of WebDAV</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>username</span> = <span style=color:#e6db74>&#34;your_username&#34;</span> <span style=color:#75715e># Username for WebDAV</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>password</span> = <span style=color:#e6db74>&#34;your_password&#34;</span> <span style=color:#75715e># Password for WebDAV</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>base_path</span> = <span style=color:#e6db74>&#34;/path/to/webdav&#34;</span> <span style=color:#75715e># Base path in WebDAV, all files will be stored under this path</span>
</span></span></code></pre></div><h2 id=s3>S3
<a class=anchor href=#s3>#</a></h2><p><code>type=s3</code></p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-toml data-lang=toml><span style=display:flex><span><span style=color:#a6e22e>endpoint</span> = <span style=color:#e6db74>&#34;s3.example.com&#34;</span> <span style=color:#75715e># Endpoint for S3, defaults to AWS S3 endpoint if not set</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>region</span> = <span style=color:#e6db74>&#34;us-east-1&#34;</span> <span style=color:#75715e># Region for S3</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>access_key_id</span> = <span style=color:#e6db74>&#34;your_access_key_id&#34;</span> <span style=color:#75715e># Access key ID for S3</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>secret_access_key</span> = <span style=color:#e6db74>&#34;your_secret_access_key&#34;</span> <span style=color:#75715e># Secret access key for S3</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>bucket_name</span> = <span style=color:#e6db74>&#34;your_bucket_name&#34;</span> <span style=color:#75715e># Bucket name for S3</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>base_path</span> = <span style=color:#e6db74>&#34;/path/to/s3&#34;</span> <span style=color:#75715e># Base path in S3, all files will be stored under this path</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>virtual_host</span> = <span style=color:#66d9ef>false</span> <span style=color:#75715e># Use virtual-host style URL, default is false</span>
</span></span></code></pre></div><p>Example of virtual-host-style URL:</p><pre tabindex=0><code>https://your_bucket_name.s3.example.com/path/to/s3/your_file
</code></pre><p>Example of path-style URL (when <code>virtual_host</code> is false):</p><pre tabindex=0><code>https://s3.example.com/your_bucket_name/path/to/s3/your_file
</code></pre><p>If you are using a third-party S3-compatible service, it usually uses path-style URLs. AWS S3 typically uses virtual-host-style URLs. Please refer to your S3-compatible service documentation for details.</p><h2 id=telegram>Telegram
<a class=anchor href=#telegram>#</a></h2><p><code>type=telegram</code></p><p>Stream mode is not supported.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-toml data-lang=toml><span style=display:flex><span><span style=color:#a6e22e>chat_id</span> = <span style=color:#e6db74>&#34;123456789&#34;</span> <span style=color:#75715e># Telegram chat ID, the bot will send files to this chat</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>force_file</span> = <span style=color:#66d9ef>false</span> <span style=color:#75715e># Force sending as file, default is false</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>skip_large</span> = <span style=color:#66d9ef>false</span> <span style=color:#75715e># Skip large files, default is false. If enabled, files exceeding Telegram&#39;s limit will not be uploaded.</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>spilt_size_mb</span> = <span style=color:#ae81ff>2000</span> <span style=color:#75715e># 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.</span>
</span></span></code></pre></div><h2 id=rclone>Rclone
<a class=anchor href=#rclone>#</a></h2><p><code>type=rclone</code></p><p>Supports multiple cloud storage services through the <a href=https://rclone.org/>rclone</a> command-line tool. You need to install rclone and configure remote storage first.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-toml data-lang=toml><span style=display:flex><span><span style=color:#75715e># Remote name configured in rclone, can be any remote defined in rclone.conf</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>remote</span> = <span style=color:#e6db74>&#34;mydrive&#34;</span>
</span></span><span style=display:flex><span><span style=color:#75715e># Base path in the remote storage, all files will be stored under this path</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>base_path</span> = <span style=color:#e6db74>&#34;/telegram&#34;</span>
</span></span><span style=display:flex><span><span style=color:#75715e># Path to rclone config file, optional, leave empty to use default path (~/.config/rclone/rclone.conf)</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>config_path</span> = <span style=color:#e6db74>&#34;&#34;</span>
</span></span><span style=display:flex><span><span style=color:#75715e># Additional flags to pass to rclone commands, optional</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>flags</span> = [<span style=color:#e6db74>&#34;--transfers&#34;</span>, <span style=color:#e6db74>&#34;4&#34;</span>, <span style=color:#e6db74>&#34;--checkers&#34;</span>, <span style=color:#e6db74>&#34;8&#34;</span>]
</span></span></code></pre></div><h3 id=configuring-rclone-remote>Configuring rclone Remote
<a class=anchor href=#configuring-rclone-remote>#</a></h3><p>First, you need to configure an rclone remote. Run <code>rclone config</code> for interactive configuration, or directly edit the <code>rclone.conf</code> file.</p><p>rclone supports many cloud storage services, including but not limited to:</p><ul><li>Google Drive</li><li>Dropbox</li><li>OneDrive</li><li>Amazon S3 and compatible services</li><li>SFTP</li><li>FTP</li><li>For more services, please refer to the <a href=https://rclone.org/overview/>rclone official documentation</a></li></ul><h3 id=usage-examples>Usage Examples
<a class=anchor href=#usage-examples>#</a></h3><p>After configuring Google Drive, you can configure the storage like this:</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-toml data-lang=toml><span style=display:flex><span>[[<span style=color:#a6e22e>storages</span>]]
</span></span><span style=display:flex><span><span style=color:#a6e22e>name</span> = <span style=color:#e6db74>&#34;GoogleDrive&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>type</span> = <span style=color:#e6db74>&#34;rclone&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>enable</span> = <span style=color:#66d9ef>true</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>remote</span> = <span style=color:#e6db74>&#34;gdrive&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>base_path</span> = <span style=color:#e6db74>&#34;/SaveAnyBot&#34;</span>
</span></span></code></pre></div><p>If using a custom rclone config file:</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-toml data-lang=toml><span style=display:flex><span>[[<span style=color:#a6e22e>storages</span>]]
</span></span><span style=display:flex><span><span style=color:#a6e22e>name</span> = <span style=color:#e6db74>&#34;MyRemote&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>type</span> = <span style=color:#e6db74>&#34;rclone&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>enable</span> = <span style=color:#66d9ef>true</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>remote</span> = <span style=color:#e6db74>&#34;myremote&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>base_path</span> = <span style=color:#e6db74>&#34;/backup&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>config_path</span> = <span style=color:#e6db74>&#34;/path/to/rclone.conf&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>flags</span> = [<span style=color:#e6db74>&#34;--progress&#34;</span>]
</span></span></code></pre></div></article><footer class=book-footer><div class="flex flex-wrap justify-between"><div><a class="flex align-center" href=https://github.com/krau/saveany-bot/commit/8b86330f5c823cffe8e7d503f736699a0c9d981c title='Last modified by Krau | 2026/01/30' target=_blank rel=noopener><img src=/svg/calendar.svg class=book-icon alt>
<span>2026/01/30</span></a></div><div><a class="flex align-center" href=https://github.com/krau/saveany-bot/edit/main/docs/content/en/deployment/configuration/storages.md target=_blank rel=noopener><img src=/svg/edit.svg class=book-icon alt>
<span>Edit this page</span></a></div></div><script>(function(){function e(e){const t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}document.querySelectorAll("pre code").forEach(t=>{t.addEventListener("click",function(){if(window.getSelection().toString())return;e(t.parentElement),navigator.clipboard&&navigator.clipboard.writeText(t.parentElement.textContent)})})})()</script></footer><div class=book-comments></div><label for=menu-control class="hidden book-menu-overlay"></label></div><aside class=book-toc><div class=book-toc-content><nav id=TableOfContents><ul><li><a href=#alist>Alist</a></li><li><a href=#local-disk>Local Disk</a></li><li><a href=#webdav>WebDAV</a></li><li><a href=#s3>S3</a></li><li><a href=#telegram>Telegram</a></li><li><a href=#rclone>Rclone</a><ul><li><a href=#configuring-rclone-remote>Configuring rclone Remote</a></li><li><a href=#usage-examples>Usage Examples</a></li></ul></li></ul></nav></div></aside></main></body></html>