mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-09-08 09:06:38 +08:00
chore: update config example and docker compose file
This commit is contained in:
+58
-27
@@ -4,8 +4,6 @@ retry = 3 # 下载失败重试次数
|
|||||||
[telegram]
|
[telegram]
|
||||||
# Bot Token
|
# Bot Token
|
||||||
token = ""
|
token = ""
|
||||||
# 允许使用的用户 id 列表
|
|
||||||
admins = [777000]
|
|
||||||
# Telegram API 配置, 若不配置也可运行, 将使用默认的 API ID 和 API HASH
|
# Telegram API 配置, 若不配置也可运行, 将使用默认的 API ID 和 API HASH
|
||||||
# 推荐使用自己的 API ID 和 API HASH (https://my.telegram.org)
|
# 推荐使用自己的 API ID 和 API HASH (https://my.telegram.org)
|
||||||
# app_id = 123456
|
# app_id = 123456
|
||||||
@@ -17,37 +15,70 @@ enable = false
|
|||||||
url = "socks5://127.0.0.1:7890"
|
url = "socks5://127.0.0.1:7890"
|
||||||
|
|
||||||
|
|
||||||
[storage]
|
# 存储配置列表
|
||||||
[storage.alist] # Alist
|
[[storages]]
|
||||||
|
# 标识名, 需要唯一
|
||||||
|
name = "本机1"
|
||||||
|
# 存储类型, 目前可用: local , alist , webdav
|
||||||
|
type = "local"
|
||||||
enable = true
|
enable = true
|
||||||
base_path = "/telegram" # 保存路径
|
base_path = "./downloads"
|
||||||
username = "admin" # 用户名
|
|
||||||
password = "password" # 密码
|
|
||||||
url = "https://alist.com" # Alist 地址
|
|
||||||
token_exp = 86400 # token 过期时间, 单位: 秒
|
|
||||||
# 可直接使用 token 授权, 此时不能自动刷新登录信息
|
|
||||||
# 配置 token 后, username , password , token_exp 将被忽略
|
|
||||||
token = "jwt_token"
|
|
||||||
|
|
||||||
[storage.local] # 本地磁盘
|
[[storages]]
|
||||||
|
name = "本机2"
|
||||||
|
type = "local"
|
||||||
enable = true
|
enable = true
|
||||||
base_path = "downloads/" # 保存路径
|
base_path = "./downloads/2"
|
||||||
|
|
||||||
[storage.webdav] # WebDav
|
[[storages]]
|
||||||
|
name = "MyAlist"
|
||||||
|
type = "alist"
|
||||||
enable = true
|
enable = true
|
||||||
base_path = "/telegram"
|
base_path = '/'
|
||||||
username = "admin"
|
url = 'https://alist.com'
|
||||||
password = "password"
|
username = 'admin'
|
||||||
url = "https://alist.com/dav"
|
password = 'password'
|
||||||
|
token_exp = 86400
|
||||||
|
# alist 可直接使用 token 登录, 此时 username, password, token_exp 将被忽略
|
||||||
|
# 请自行在 alist 侧配置合理的 token 过期时间
|
||||||
|
# token = ""
|
||||||
|
|
||||||
|
|
||||||
[log]
|
[[storages]]
|
||||||
# 日志等级
|
name = "MyWebdav"
|
||||||
level = "DEBUG"
|
type = "webdav"
|
||||||
|
base_path = '/path/telegram'
|
||||||
|
enable = true
|
||||||
|
url = 'https://example.com/dav'
|
||||||
|
username = 'username'
|
||||||
|
password = 'password'
|
||||||
|
|
||||||
[temp]
|
|
||||||
base_path = "cache/" # 下载文件临时目录, 请不要在此目录下存放任何其他文件
|
|
||||||
cache_ttl = 30 # 临时文件保存时间, 单位: 秒
|
|
||||||
|
|
||||||
[db]
|
# 用户列表
|
||||||
path = "data/data.db" # 数据库文件路径
|
[[users]]
|
||||||
|
# user id
|
||||||
|
id = 123456
|
||||||
|
# 存储名称过滤列表
|
||||||
|
storages = ["MyAlist", "本机1"]
|
||||||
|
# 开启黑名单模式, 过滤列表中的存储将无法使用, 默认为白名单模式
|
||||||
|
blacklist = false
|
||||||
|
|
||||||
|
[[users]]
|
||||||
|
id = 114514
|
||||||
|
# 将列表留空并开启黑名单模式以允许使用所有存储
|
||||||
|
storages = []
|
||||||
|
blacklist = true
|
||||||
|
|
||||||
|
|
||||||
|
# [log]
|
||||||
|
# # 日志等级
|
||||||
|
# level = "DEBUG"
|
||||||
|
|
||||||
|
# [temp]
|
||||||
|
# # 下载文件临时目录, 请不要在此目录下存放任何其他文件
|
||||||
|
# base_path = "cache/"
|
||||||
|
# # 临时文件保存时间, 单位: 秒
|
||||||
|
# cache_ttl = 30
|
||||||
|
|
||||||
|
# [db]
|
||||||
|
# path = "data/data.db" # 数据库文件路径
|
||||||
|
|||||||
+1
-23
@@ -3,30 +3,8 @@ services:
|
|||||||
image: ghcr.io/krau/saveany-bot:latest
|
image: ghcr.io/krau/saveany-bot:latest
|
||||||
container_name: saveany-bot
|
container_name: saveany-bot
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
|
||||||
- SAVEANY_TELEGRAM_TOKEN=bot_token
|
|
||||||
- SAVEANY_TELEGRAM_ADMINS=admin_id1,admin_id2
|
|
||||||
# 推荐使用自己的 API ID 和 API HASH (https://my.telegram.org)
|
|
||||||
# 若不配置也可运行, 将使用默认的 API ID 和 API HASH
|
|
||||||
# - SAVEANY_TELEGRAM_APP_ID=app_id
|
|
||||||
# - SAVEANY_TELEGRAM_APP_HASH=app_hash
|
|
||||||
|
|
||||||
# 本地存储
|
|
||||||
- SAVEANY_STORAGE_LOCAL_ENABLE=true
|
|
||||||
- SAVEANY_STORAGE_LOCAL_BASE_PATH=/app/downloads
|
|
||||||
# Alist
|
|
||||||
- SAVEANY_STORAGE_ALIST_ENABLE=true
|
|
||||||
- SAVEANY_STORAGE_ALIST_BASE_PATH=/saveany
|
|
||||||
- SAVEANY_STORAGE_ALIST_URL=https://example.com
|
|
||||||
- SAVEANY_STORAGE_ALIST_USERNAME=username
|
|
||||||
- SAVEANY_STORAGE_ALIST_PASSWORD=password
|
|
||||||
# webdav
|
|
||||||
- SAVEANY_STORAGE_WEBDAV_ENABLE=true
|
|
||||||
- SAVEANY_STORAGE_WEBDAV_BASE_PATH=/saveany
|
|
||||||
- SAVEANY_STORAGE_WEBDAV_URL=https://example.com
|
|
||||||
- SAVEANY_STORAGE_WEBDAV_USERNAME=username
|
|
||||||
- SAVEANY_STORAGE_WEBDAV_PASSWORD=password
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
|
- ./config.toml:/app/config.toml
|
||||||
- ./downloads:/app/downloads
|
- ./downloads:/app/downloads
|
||||||
- ./cache:/app/cache
|
- ./cache:/app/cache
|
||||||
Reference in New Issue
Block a user