This commit is contained in:
krau
2025-06-16 08:31:27 +00:00
parent 06872870a7
commit bdad33d6f3
27 changed files with 740 additions and 26 deletions

View File

@@ -0,0 +1,76 @@
<!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="
Configuration Guide
#
SaveAnyBot uses the toml format for its configuration files. You can learn more about toml syntax on the TOML official website.
SaveAnyBot needs to read a config.toml file in the working directory as its configuration file. If this file is missing, a default file will be created, and the bot will attempt to load configuration from environment variables.
Here is an example of a minimal configuration file:"><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/"><meta property="og:site_name" content="Save Any Bot"><meta property="og:title" content="Configuration Guide"><meta property="og:description" content="Configuration Guide # SaveAnyBot uses the toml format for its configuration files. You can learn more about toml syntax on the TOML official website.
SaveAnyBot needs to read a config.toml file in the working directory as its configuration file. If this file is missing, a default file will be created, and the bot will attempt to load configuration from environment variables.
Here is an example of a minimal configuration file:"><meta property="og:locale" content="en"><meta property="og:type" content="website"><title>Configuration Guide | 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/><link rel=alternate hreflang=zh href=https://sabot.unv.app/deployment/configuration/ title=配置说明><link rel=stylesheet href=/book.min.a22f4c7d8c2bdc5e3d6e34ba11cb59ab50ea5772594e71305bfd5a595dc78b7e.css integrity="sha256-oi9MfYwr3F49bjS6EctZq1DqV3JZTnEwW/1aWV3Hi34=" crossorigin=anonymous><link rel=alternate type=application/rss+xml href=https://sabot.unv.app/en/deployment/configuration/index.xml title="Save Any Bot"></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/>简体中文</a></li></ul></li></ul><ul><li><span>Deployment Guide</span><ul><li><a href=/en/deployment/configuration/ class=active>Configuration Guide</a><ul><li><a href=/en/deployment/configuration/storages/>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></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>Configuration Guide</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=#detailed-configuration>Detailed Configuration</a><ul><li><a href=#global-configuration>Global Configuration</a></li><li><a href=#telegram-configuration>Telegram Configuration</a></li><li><a href=#storage-endpoints-list>Storage Endpoints List</a></li><li><a href=#user-list>User List</a></li><li><a href=#miscellaneous>Miscellaneous</a></li></ul></li></ul></nav></aside></header><article class="markdown book-article"><h1 id=configuration-guide>Configuration Guide
<a class=anchor href=#configuration-guide>#</a></h1><p>SaveAnyBot uses the toml format for its configuration files. You can learn more about toml syntax on the <a href=https://toml.io/>TOML official website</a>.</p><p>SaveAnyBot needs to read a <code>config.toml</code> file in the working directory as its configuration file. If this file is missing, a default file will be created, and the bot will attempt to load configuration from environment variables.</p><p>Here is an example of a minimal configuration 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>telegram</span>]
</span></span><span style=display:flex><span><span style=color:#a6e22e>token</span> = <span style=color:#e6db74>&#34;1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ&#34;</span>
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span>[[<span style=color:#a6e22e>users</span>]]
</span></span><span style=display:flex><span><span style=color:#75715e># telegram user id</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>id</span> = <span style=color:#ae81ff>777000</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>blacklist</span> = <span style=color:#66d9ef>true</span>
</span></span><span style=display:flex><span>
</span></span><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;Local Storage&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>type</span> = <span style=color:#e6db74>&#34;local&#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>base_path</span> = <span style=color:#e6db74>&#34;./downloads&#34;</span>
</span></span></code></pre></div><h2 id=detailed-configuration>Detailed Configuration
<a class=anchor href=#detailed-configuration>#</a></h2><h3 id=global-configuration>Global Configuration
<a class=anchor href=#global-configuration>#</a></h3><ul><li><code>stream</code>: Whether to enable Stream mode, default is <code>false</code>. When enabled, the Bot will stream files directly to storage endpoints (if supported), without downloading them locally.<blockquote class="book-hint warning">Stream mode is very useful for deployment environments with limited disk space, but it also has some drawbacks:<br><ul><li>Cannot use multi-threading to download files from Telegram, resulting in slower speeds.</li><li>Higher task failure rate when the network is unstable.</li><li>Cannot process files in the middle layer, such as automatic file type identification.</li><li>Not supported by all storage endpoints; unsupported endpoints may downgrade to normal mode or fail to upload.</li></ul></blockquote></li><li><code>workers</code>: Number of tasks to process simultaneously, default is 3.</li><li><code>threads</code>: Number of threads used when downloading files, default is 4. Only effective when Stream mode is not enabled.</li><li><code>retry</code>: Number of retries when a task fails, default is 3.</li></ul><h3 id=telegram-configuration>Telegram Configuration
<a class=anchor href=#telegram-configuration>#</a></h3><ul><li><code>token</code>: Your Telegram Bot Token, which can be obtained by creating a Bot through <a href=https://t.me/botfather>BotFather</a>.</li><li><code>app_id</code>, <code>app_hash</code>: Telegram API ID & Hash, obtained by creating an application at <a href=https://my.telegram.org/apps>Telegram API</a>. Default values will be used if not provided.</li><li><code>flood_retry</code>: Number of retries for flood control, default is 5.</li><li><code>rpc_retry</code>: Number of retries for RPC requests, default is 5.</li><li><code>proxy</code>: Proxy configuration, optional.<ul><li><code>enable</code>: Whether to enable the proxy.</li><li><code>url</code>: Proxy address, only supports <code>socks5://</code></li></ul></li></ul><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>telegram</span>]
</span></span><span style=display:flex><span><span style=color:#a6e22e>token</span> = <span style=color:#e6db74>&#34;1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>app_id</span> = <span style=color:#ae81ff>1025907</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>app_hash</span> = <span style=color:#e6db74>&#34;452b0359b988148995f22ff0f4229750&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>flood_retry</span> = <span style=color:#ae81ff>5</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>rpc_retry</span> = <span style=color:#ae81ff>5</span>
</span></span><span style=display:flex><span>[<span style=color:#a6e22e>telegram</span>.<span style=color:#a6e22e>proxy</span>]
</span></span><span style=display:flex><span><span style=color:#a6e22e>enable</span> = <span style=color:#66d9ef>false</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>url</span> = <span style=color:#e6db74>&#34;socks5://127.0.0.1:7890&#34;</span>
</span></span></code></pre></div><h3 id=storage-endpoints-list>Storage Endpoints List
<a class=anchor href=#storage-endpoints-list>#</a></h3><p>The storage endpoints list is used to define the storage locations supported by the Bot. Each storage endpoint needs to specify a name, type, and related configuration, using the double bracket syntax <code>[[storages]]</code>.</p><p>Each storage endpoint requires at least the following fields:</p><ul><li><code>name</code>: Storage endpoint name, used for identification in the Bot, must be unique.</li><li><code>enable</code>: Whether to enable this storage endpoint, default is <code>true</code>.</li><li><code>type</code>: Storage endpoint type, currently supports the following types:<ul><li><code>local</code>: Local disk</li><li><code>alist</code>: Alist</li><li><code>webdav</code>: WebDAV</li><li><code>minio</code>: MinIO (compatible with S3 API)</li><li><code>telegram</code>: Upload to Telegram</li></ul></li></ul><p>Example, this is a configuration that includes local storage and webdav storage:</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;Local Storage&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>type</span> = <span style=color:#e6db74>&#34;local&#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:#75715e># Custom configuration for local type storage</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>base_path</span> = <span style=color:#e6db74>&#34;./downloads&#34;</span>
</span></span><span style=display:flex><span>
</span></span><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;WebDAV&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>type</span> = <span style=color:#e6db74>&#34;webdav&#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:#75715e># Custom configuration for webdav type storage</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>url</span> = <span style=color:#e6db74>&#34;https://example.com/webdav&#34;</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></span><span style=display:flex><span><span style=color:#a6e22e>username</span> = <span style=color:#e6db74>&#34;your_username&#34;</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>password</span> = <span style=color:#e6db74>&#34;your_password&#34;</span>
</span></span></code></pre></div><p>For custom configuration items for all storage endpoints, see <a href=./storages>Storage Configuration</a></p><h3 id=user-list>User List
<a class=anchor href=#user-list>#</a></h3><p>The user list is used to define access control for storage endpoints. Each user needs to specify a Telegram User ID, defined using the double bracket syntax <code>[[users]]</code>.</p><ul><li><code>id</code>: The user&rsquo;s Telegram User ID</li><li><code>storages</code>: Filtered list of storage endpoints, defined by storage endpoint names, default is whitelist mode (i.e., only allows access to storage endpoints in the list)</li><li><code>blacklist</code>: Whether to enable blacklist mode, default is <code>false</code>. If blacklist mode is enabled, the user is allowed to access only storage endpoints that are <strong>not</strong> in the list.</li></ul><p>Example, this is a configuration containing three users: user <code>123123</code> can only access local storage, user <code>456456</code> can only access storage other than WebDAV, and user <code>789789</code> has blacklist mode enabled but no storage endpoints specified, so they can access all storage:</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>users</span>]]
</span></span><span style=display:flex><span><span style=color:#a6e22e>id</span> = <span style=color:#ae81ff>123123</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>storages</span> = [<span style=color:#e6db74>&#34;Local Storage&#34;</span>]
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span>[[<span style=color:#a6e22e>users</span>]]
</span></span><span style=display:flex><span><span style=color:#a6e22e>id</span> = <span style=color:#ae81ff>456456</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>storages</span> = [<span style=color:#e6db74>&#34;WebDAV&#34;</span>]
</span></span><span style=display:flex><span><span style=color:#a6e22e>blacklist</span> = <span style=color:#66d9ef>true</span>
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span>[[<span style=color:#a6e22e>users</span>]]
</span></span><span style=display:flex><span><span style=color:#a6e22e>id</span> = <span style=color:#ae81ff>789789</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>storages</span> = []
</span></span><span style=display:flex><span><span style=color:#a6e22e>blacklist</span> = <span style=color:#66d9ef>true</span>
</span></span></code></pre></div><h3 id=miscellaneous>Miscellaneous
<a class=anchor href=#miscellaneous>#</a></h3><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>no_clean_cache</span> = <span style=color:#66d9ef>false</span> <span style=color:#75715e># Whether not to clear the cache folder when exiting</span>
</span></span><span style=display:flex><span><span style=color:#75715e># Temporary download folder configuration</span>
</span></span><span style=display:flex><span>[<span style=color:#a6e22e>temp</span>]
</span></span><span style=display:flex><span><span style=color:#a6e22e>base_path</span> = <span style=color:#e6db74>&#34;./cache&#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/73b5f1b18e505b93277abbf3a78f889ce1034fc4 title='Last modified by krau | 2025/06/16' target=_blank rel=noopener><img src=/svg/calendar.svg class=book-icon alt>
<span>2025/06/16</span></a></div><div><a class="flex align-center" href=https://github.com/krau/saveany-bot/edit/main/docs/content/en/deployment/configuration/_index.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=#detailed-configuration>Detailed Configuration</a><ul><li><a href=#global-configuration>Global Configuration</a></li><li><a href=#telegram-configuration>Telegram Configuration</a></li><li><a href=#storage-endpoints-list>Storage Endpoints List</a></li><li><a href=#user-list>User List</a></li><li><a href=#miscellaneous>Miscellaneous</a></li></ul></li></ul></nav></div></aside></main></body></html>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Configuration Guide on Save Any Bot</title><link>https://sabot.unv.app/en/deployment/configuration/</link><description>Recent content in Configuration Guide on Save Any Bot</description><generator>Hugo</generator><language>en</language><atom:link href="https://sabot.unv.app/en/deployment/configuration/index.xml" rel="self" type="application/rss+xml"/><item><title>Storage Configuration</title><link>https://sabot.unv.app/en/deployment/configuration/storages/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sabot.unv.app/en/deployment/configuration/storages/</guid><description>&lt;h1 id="storage-configuration">
Storage Configuration
&lt;a class="anchor" href="#storage-configuration">#&lt;/a>
&lt;/h1>
&lt;p>Please first read the &lt;a href="../">Configuration Guide&lt;/a> to understand the basic format of the configuration file.&lt;/p>
&lt;h2 id="alist">
Alist
&lt;a class="anchor" href="#alist">#&lt;/a>
&lt;/h2>
&lt;p>&lt;code>type=alist&lt;/code>&lt;/p>
&lt;p>Stream mode is not supported.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-toml" data-lang="toml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">url&lt;/span> = &lt;span style="color:#e6db74">&amp;#34;https://alist.example.com&amp;#34;&lt;/span> &lt;span style="color:#75715e"># URL of Alist&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">username&lt;/span> = &lt;span style="color:#e6db74">&amp;#34;your_username&amp;#34;&lt;/span> &lt;span style="color:#75715e"># Username for Alist&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">password&lt;/span> = &lt;span style="color:#e6db74">&amp;#34;your_password&amp;#34;&lt;/span> &lt;span style="color:#75715e"># Password for Alist&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">base_path&lt;/span> = &lt;span style="color:#e6db74">&amp;#34;/path/saveanybot&amp;#34;&lt;/span> &lt;span style="color:#75715e"># Base path in Alist, all files will be stored under this path&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">token_exp&lt;/span> = &lt;span style="color:#ae81ff">3600&lt;/span> &lt;span style="color:#75715e"># Auto-refresh time for Alist access token, in seconds&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">token&lt;/span> = &lt;span style="color:#e6db74">&amp;#34;your_token&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Access token for Alist, optional, if not set, username and password will be used for authentication.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># When using token authentication, the token cannot be automatically refreshed&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="local-disk">
Local Disk
&lt;a class="anchor" href="#local-disk">#&lt;/a>
&lt;/h2>
&lt;p>&lt;code>type=local&lt;/code>&lt;/p></description></item></channel></rss>

View File

@@ -0,0 +1,58 @@
<!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="2025-06-16T16:30:45+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><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></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=#minio-s3>MinIO (S3)</a></li><li><a href=#telegram>Telegram</a></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=minio-s3>MinIO (S3)
<a class=anchor href=#minio-s3>#</a></h2><p><code>type=minio</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;minio.example.com&#34;</span> <span style=color:#75715e># Endpoint for MinIO or 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 MinIO or 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 MinIO or 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 MinIO or S3</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>use_ssl</span> = <span style=color:#66d9ef>true</span> <span style=color:#75715e># Whether to use SSL, default is true</span>
</span></span><span style=display:flex><span><span style=color:#a6e22e>base_path</span> = <span style=color:#e6db74>&#34;/path/to/minio&#34;</span> <span style=color:#75715e># Base path in MinIO, all files will be stored under this path</span>
</span></span></code></pre></div><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></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/73b5f1b18e505b93277abbf3a78f889ce1034fc4 title='Last modified by krau | 2025/06/16' target=_blank rel=noopener><img src=/svg/calendar.svg class=book-icon alt>
<span>2025/06/16</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=#minio-s3>MinIO (S3)</a></li><li><a href=#telegram>Telegram</a></li></ul></nav></div></aside></main></body></html>

6
en/deployment/index.html Normal file
View File

@@ -0,0 +1,6 @@
<!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><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/"><meta property="og:site_name" content="Save Any Bot"><meta property="og:title" content="Deployment Guide"><meta property="og:locale" content="en"><meta property="og:type" content="website"><title>Deployment Guide | 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/><link rel=alternate hreflang=zh href=https://sabot.unv.app/deployment/ title=部署指南><link rel=stylesheet href=/book.min.a22f4c7d8c2bdc5e3d6e34ba11cb59ab50ea5772594e71305bfd5a595dc78b7e.css integrity="sha256-oi9MfYwr3F49bjS6EctZq1DqV3JZTnEwW/1aWV3Hi34=" crossorigin=anonymous><link rel=alternate type=application/rss+xml href=https://sabot.unv.app/en/deployment/index.xml title="Save Any Bot"></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/>简体中文</a></li></ul></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/>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></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>Deployment Guide</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></nav></aside></header><article class="markdown book-article"></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/73b5f1b18e505b93277abbf3a78f889ce1034fc4 title='Last modified by krau | 2025/06/16' target=_blank rel=noopener><img src=/svg/calendar.svg class=book-icon alt>
<span>2025/06/16</span></a></div><div><a class="flex align-center" href=https://github.com/krau/saveany-bot/edit/main/docs/content/en/deployment/_index.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><label for=menu-control class="hidden book-menu-overlay"></label></div><aside class=book-toc><div class=book-toc-content><nav id=TableOfContents></nav></div></aside></main></body></html>

111
en/deployment/index.xml Normal file
View File

@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Deployment Guide on Save Any Bot</title><link>https://sabot.unv.app/en/deployment/</link><description>Recent content in Deployment Guide on Save Any Bot</description><generator>Hugo</generator><language>en</language><atom:link href="https://sabot.unv.app/en/deployment/index.xml" rel="self" type="application/rss+xml"/><item><title>Installation and Updates</title><link>https://sabot.unv.app/en/deployment/installation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sabot.unv.app/en/deployment/installation/</guid><description>&lt;h1 id="installation-and-updates">
Installation and Updates
&lt;a class="anchor" href="#installation-and-updates">#&lt;/a>
&lt;/h1>
&lt;h2 id="deploy-from-pre-compiled-files">
Deploy from Pre-compiled Files
&lt;a class="anchor" href="#deploy-from-pre-compiled-files">#&lt;/a>
&lt;/h2>
&lt;p>Download the binary file for your platform from the &lt;a href="https://github.com/krau/SaveAny-Bot/releases">Release&lt;/a> page.&lt;/p>
&lt;p>Create a &lt;code>config.toml&lt;/code> file in the extracted directory, refer to the &lt;a href="../configuration">Configuration Guide&lt;/a> to edit the configuration file.&lt;/p>
&lt;p>Run:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>chmod +x saveany-bot
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>./saveany-bot
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="process-monitoring">
Process Monitoring
&lt;a class="anchor" href="#process-monitoring">#&lt;/a>
&lt;/h3>
&lt;div class="book-tabs">
&lt;input type="radio" class="toggle" name="tabs-daemon" id="tabs-daemon-0" checked="checked" />
&lt;label for="tabs-daemon-0">systemd (Regular Linux)&lt;/label>
&lt;div class="book-tabs-content markdown-inner">
Create a file &lt;code>/etc/systemd/system/saveany-bot.service&lt;/code> and write the following content:
&lt;pre>&lt;code class="language-text">[Unit]
Description=SaveAnyBot
After=systemd-user-sessions.service
[Service]
Type=simple
WorkingDirectory=/yourpath/
ExecStart=/yourpath/saveany-bot
Restart=on-failure
[Install]
WantedBy=multi-user.target&lt;/code>&lt;/pre>
Enable startup on boot and start the service:
&lt;pre>&lt;code class="language-text">systemctl enable --now saveany-bot&lt;/code>&lt;/pre>
&lt;/div>
&lt;input type="radio" class="toggle" name="tabs-daemon" id="tabs-daemon-1" />
&lt;label for="tabs-daemon-1">procd (OpenWrt)&lt;/label>
&lt;div class="book-tabs-content markdown-inner">
&lt;h4>Add Boot Autostart Service&lt;/h4>
Create a file &lt;code>/etc/init.d/saveanybot&lt;/code>, refer to &lt;a href="https://github.com/krau/SaveAny-Bot/blob/main/docs/confs/wrt_init" target="_blank">wrt_init&lt;/a> and modify as needed:
&lt;pre>&lt;code class="language-text">#!/bin/sh /etc/rc.common
#This is the OpenWRT init.d script for SaveAnyBot
START=99
STOP=10
description=&amp;amp;#34;SaveAnyBot&amp;amp;#34;
WORKING_DIR=&amp;amp;#34;/mnt/mmc1-1/SaveAnyBot&amp;amp;#34;
EXEC_PATH=&amp;amp;#34;$WORKING_DIR/saveany-bot&amp;amp;#34;
start() {
echo &amp;amp;#34;Starting SaveAnyBot...&amp;amp;#34;
cd $WORKING_DIR
$EXEC_PATH &amp;amp;amp;
}
stop() {
echo &amp;amp;#34;Stopping SaveAnyBot...&amp;amp;#34;
killall saveany-bot
}
reload() {
stop
start
}&lt;/code>&lt;/pre>
Set permissions:
&lt;pre>&lt;code class="language-text">chmod &amp;#43;x /etc/init.d/saveanybot&lt;/code>&lt;/pre>
Then copy the file to &lt;code>/etc/rc.d&lt;/code> and rename it to &lt;code>S99saveanybot&lt;/code>, also set permissions:
&lt;pre>&lt;code class="language-text">chmod &amp;#43;x /etc/rc.d/S99saveanybot&lt;/code>&lt;/pre>
&lt;h4>Add Shortcut Commands&lt;/h4>
Create a file &lt;code>/usr/bin/sabot&lt;/code>, refer to &lt;a href="https://github.com/krau/SaveAny-Bot/blob/main/docs/confs/wrt_bin" target="_blank">wrt_bin&lt;/a> and modify as needed. Note that the file encoding here only supports ANSI 936.
Then set permissions:
&lt;pre>&lt;code class="language-text">chmod &amp;#43;x /usr/bin/sabot&lt;/code>&lt;/pre>
Usage: &lt;code>sudo sabot start|stop|restart|status|enable|disable&lt;/code>
&lt;/div>
&lt;/div>
&lt;h2 id="deploy-using-docker">
Deploy Using Docker
&lt;a class="anchor" href="#deploy-using-docker">#&lt;/a>
&lt;/h2>
&lt;h3 id="docker-compose">
Docker Compose
&lt;a class="anchor" href="#docker-compose">#&lt;/a>
&lt;/h3>
&lt;p>Download the &lt;a href="https://github.com/krau/SaveAny-Bot/blob/main/docker-compose.yml">docker-compose.yml&lt;/a> file, create a new &lt;code>config.toml&lt;/code> file in the same directory, refer to &lt;a href="https://github.com/krau/SaveAny-Bot/blob/main/config.example.toml">config.example.toml&lt;/a> to edit the configuration file.&lt;/p></description></item></channel></rss>

View File

@@ -0,0 +1,172 @@
<!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="
Installation and Updates
#
Deploy from Pre-compiled Files
#
Download the binary file for your platform from the Release page.
Create a config.toml file in the extracted directory, refer to the Configuration Guide to edit the configuration file.
Run:
chmod +x saveany-bot
./saveany-bot
Process Monitoring
#
systemd (Regular Linux)
Create a file /etc/systemd/system/saveany-bot.service and write the following content:
[Unit]
Description=SaveAnyBot
After=systemd-user-sessions.service
[Service]
Type=simple
WorkingDirectory=/yourpath/
ExecStart=/yourpath/saveany-bot
Restart=on-failure
[Install]
WantedBy=multi-user.target
Enable startup on boot and start the service:
systemctl enable --now saveany-bot
procd (OpenWrt)
Add Boot Autostart Service
Create a file /etc/init.d/saveanybot, refer to wrt_init and modify as needed:
#!/bin/sh /etc/rc.common
#This is the OpenWRT init.d script for SaveAnyBot
START=99
STOP=10
description=&amp;#34;SaveAnyBot&amp;#34;
WORKING_DIR=&amp;#34;/mnt/mmc1-1/SaveAnyBot&amp;#34;
EXEC_PATH=&amp;#34;$WORKING_DIR/saveany-bot&amp;#34;
start() {
echo &amp;#34;Starting SaveAnyBot...&amp;#34;
cd $WORKING_DIR
$EXEC_PATH &amp;amp;
}
stop() {
echo &amp;#34;Stopping SaveAnyBot...&amp;#34;
killall saveany-bot
}
reload() {
stop
start
}
Set permissions:
chmod +x /etc/init.d/saveanybot
Then copy the file to /etc/rc.d and rename it to S99saveanybot, also set permissions:
chmod +x /etc/rc.d/S99saveanybot
Add Shortcut Commands
Create a file /usr/bin/sabot, refer to wrt_bin and modify as needed. Note that the file encoding here only supports ANSI 936.
Then set permissions:
chmod +x /usr/bin/sabot
Usage: sudo sabot start|stop|restart|status|enable|disable
Deploy Using Docker
#
Docker Compose
#
Download the docker-compose.yml file, create a new config.toml file in the same directory, refer to config.example.toml to edit the configuration file."><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/installation/"><meta property="og:site_name" content="Save Any Bot"><meta property="og:title" content="Installation and Updates"><meta property="og:description" content="Installation and Updates # Deploy from Pre-compiled Files # Download the binary file for your platform from the Release page.
Create a config.toml file in the extracted directory, refer to the Configuration Guide to edit the configuration file.
Run:
chmod +x saveany-bot ./saveany-bot Process Monitoring # systemd (Regular Linux) Create a file /etc/systemd/system/saveany-bot.service and write the following content: [Unit] Description=SaveAnyBot After=systemd-user-sessions.service [Service] Type=simple WorkingDirectory=/yourpath/ ExecStart=/yourpath/saveany-bot Restart=on-failure [Install] WantedBy=multi-user.target Enable startup on boot and start the service: systemctl enable --now saveany-bot procd (OpenWrt) Add Boot Autostart Service Create a file /etc/init.d/saveanybot, refer to wrt_init and modify as needed: #!/bin/sh /etc/rc.common #This is the OpenWRT init.d script for SaveAnyBot START=99 STOP=10 description=&amp;#34;SaveAnyBot&amp;#34; WORKING_DIR=&amp;#34;/mnt/mmc1-1/SaveAnyBot&amp;#34; EXEC_PATH=&amp;#34;$WORKING_DIR/saveany-bot&amp;#34; start() { echo &amp;#34;Starting SaveAnyBot...&amp;#34; cd $WORKING_DIR $EXEC_PATH &amp;amp; } stop() { echo &amp;#34;Stopping SaveAnyBot...&amp;#34; killall saveany-bot } reload() { stop start } Set permissions: chmod +x /etc/init.d/saveanybot Then copy the file to /etc/rc.d and rename it to S99saveanybot, also set permissions: chmod +x /etc/rc.d/S99saveanybot Add Shortcut Commands Create a file /usr/bin/sabot, refer to wrt_bin and modify as needed. Note that the file encoding here only supports ANSI 936. Then set permissions: chmod +x /usr/bin/sabot Usage: sudo sabot start|stop|restart|status|enable|disable Deploy Using Docker # Docker Compose # Download the docker-compose.yml file, create a new config.toml file in the same directory, refer to config.example.toml to edit the configuration file."><meta property="og:locale" content="en"><meta property="og:type" content="article"><meta property="article:section" content="deployment"><meta property="article:modified_time" content="2025-06-16T16:30:45+08:00"><title>Installation and Updates | 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/installation/><link rel=alternate hreflang=zh href=https://sabot.unv.app/deployment/installation/ 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/installation/>简体中文</a></li></ul></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/>Storage Configuration</a></li></ul></li><li><a href=/en/deployment/installation/ class=active>Installation and Updates</a></li></ul></li><li><a href=/en/usage/>Usage</a><ul></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>Installation and Updates</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=#deploy-from-pre-compiled-files>Deploy from Pre-compiled Files</a><ul><li><a href=#process-monitoring>Process Monitoring</a></li></ul></li><li><a href=#deploy-using-docker>Deploy Using Docker</a><ul><li><a href=#docker-compose>Docker Compose</a></li><li><a href=#docker>Docker</a></li></ul></li><li><a href=#updates>Updates</a></li></ul></nav></aside></header><article class="markdown book-article"><h1 id=installation-and-updates>Installation and Updates
<a class=anchor href=#installation-and-updates>#</a></h1><h2 id=deploy-from-pre-compiled-files>Deploy from Pre-compiled Files
<a class=anchor href=#deploy-from-pre-compiled-files>#</a></h2><p>Download the binary file for your platform from the <a href=https://github.com/krau/SaveAny-Bot/releases>Release</a> page.</p><p>Create a <code>config.toml</code> file in the extracted directory, refer to the <a href=../configuration>Configuration Guide</a> to edit the configuration file.</p><p>Run:</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-bash data-lang=bash><span style=display:flex><span>chmod +x saveany-bot
</span></span><span style=display:flex><span>./saveany-bot
</span></span></code></pre></div><h3 id=process-monitoring>Process Monitoring
<a class=anchor href=#process-monitoring>#</a></h3><div class=book-tabs><input type=radio class=toggle name=tabs-daemon id=tabs-daemon-0 checked>
<label for=tabs-daemon-0>systemd (Regular Linux)</label><div class="book-tabs-content markdown-inner">Create a file <code>/etc/systemd/system/saveany-bot.service</code> and write the following content:<pre><code class=language-text>[Unit]
Description=SaveAnyBot
After=systemd-user-sessions.service
[Service]
Type=simple
WorkingDirectory=/yourpath/
ExecStart=/yourpath/saveany-bot
Restart=on-failure
[Install]
WantedBy=multi-user.target</code></pre>Enable startup on boot and start the service:<pre><code class=language-text>systemctl enable --now saveany-bot</code></pre></div><input type=radio class=toggle name=tabs-daemon id=tabs-daemon-1>
<label for=tabs-daemon-1>procd (OpenWrt)</label><div class="book-tabs-content markdown-inner"><h4>Add Boot Autostart Service</h4>Create a file <code>/etc/init.d/saveanybot</code>, refer to <a href=https://github.com/krau/SaveAny-Bot/blob/main/docs/confs/wrt_init target=_blank>wrt_init</a> and modify as needed:<pre><code class=language-text>#!/bin/sh /etc/rc.common
#This is the OpenWRT init.d script for SaveAnyBot
START=99
STOP=10
description=&amp;#34;SaveAnyBot&amp;#34;
WORKING_DIR=&amp;#34;/mnt/mmc1-1/SaveAnyBot&amp;#34;
EXEC_PATH=&amp;#34;$WORKING_DIR/saveany-bot&amp;#34;
start() {
echo &amp;#34;Starting SaveAnyBot...&amp;#34;
cd $WORKING_DIR
$EXEC_PATH &amp;amp;
}
stop() {
echo &amp;#34;Stopping SaveAnyBot...&amp;#34;
killall saveany-bot
}
reload() {
stop
start
}</code></pre>Set permissions:<pre><code class=language-text>chmod &#43;x /etc/init.d/saveanybot</code></pre>Then copy the file to <code>/etc/rc.d</code> and rename it to <code>S99saveanybot</code>, also set permissions:<pre><code class=language-text>chmod &#43;x /etc/rc.d/S99saveanybot</code></pre><h4>Add Shortcut Commands</h4>Create a file <code>/usr/bin/sabot</code>, refer to <a href=https://github.com/krau/SaveAny-Bot/blob/main/docs/confs/wrt_bin target=_blank>wrt_bin</a> and modify as needed. Note that the file encoding here only supports ANSI 936.
Then set permissions:<pre><code class=language-text>chmod &#43;x /usr/bin/sabot</code></pre>Usage: <code>sudo sabot start|stop|restart|status|enable|disable</code></div></div><h2 id=deploy-using-docker>Deploy Using Docker
<a class=anchor href=#deploy-using-docker>#</a></h2><h3 id=docker-compose>Docker Compose
<a class=anchor href=#docker-compose>#</a></h3><p>Download the <a href=https://github.com/krau/SaveAny-Bot/blob/main/docker-compose.yml>docker-compose.yml</a> file, create a new <code>config.toml</code> file in the same directory, refer to <a href=https://github.com/krau/SaveAny-Bot/blob/main/config.example.toml>config.example.toml</a> to edit the configuration file.</p><p>Start:</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-bash data-lang=bash><span style=display:flex><span>docker compose up -d
</span></span></code></pre></div><h3 id=docker>Docker
<a class=anchor href=#docker>#</a></h3><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-shell data-lang=shell><span style=display:flex><span>docker run -d --name saveany-bot <span style=color:#ae81ff>\
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> -v /path/to/config.toml:/app/config.toml <span style=color:#ae81ff>\
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> -v /path/to/downloads:/app/downloads <span style=color:#ae81ff>\
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> ghcr.io/krau/saveany-bot:latest
</span></span></code></pre></div><h2 id=updates>Updates
<a class=anchor href=#updates>#</a></h2><p>Use <code>upgrade</code> or <code>up</code> to upgrade to the latest version</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-bash data-lang=bash><span style=display:flex><span>./saveany-bot upgrade
</span></span></code></pre></div><p>If you deployed with Docker, use the following commands to update:</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-bash data-lang=bash><span style=display:flex><span>docker pull ghcr.io/krau/saveany-bot:latest
</span></span><span style=display:flex><span>docker restart saveany-bot
</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/73b5f1b18e505b93277abbf3a78f889ce1034fc4 title='Last modified by krau | 2025/06/16' target=_blank rel=noopener><img src=/svg/calendar.svg class=book-icon alt>
<span>2025/06/16</span></a></div><div><a class="flex align-center" href=https://github.com/krau/saveany-bot/edit/main/docs/content/en/deployment/installation.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=#deploy-from-pre-compiled-files>Deploy from Pre-compiled Files</a><ul><li><a href=#process-monitoring>Process Monitoring</a></li></ul></li><li><a href=#deploy-using-docker>Deploy Using Docker</a><ul><li><a href=#docker-compose>Docker Compose</a></li><li><a href=#docker>Docker</a></li></ul></li><li><a href=#updates>Updates</a></li></ul></nav></div></aside></main></body></html>