跳到主要内容

配置文件

配置文件

这是 python-openbmclapi 的默认配置文件。

config/config.yml
advanced:
auto_update: false
copy_from_another_storage: true
debug: false
download_threads: 64
file_check_mode: size
header_bytes: 4096
io_buffer: 16777216
language: zh_cn
min_rate: 500
min_rate_timestamp: 1000
request_buffer: 8192
skip_sign: false
timeout: 30
url: https://openbmclapi.bangbang93.com/
cache:
buffer: 536870912
check: 360
enable: true
time: 1800
cluster:
byoc: false
download_access_logs: true
download_retry_delay: 60
enable: true
id: ""
public_host: ""
public_port: 8800
reconnect:
delay: 60
retry: -1
secret: ""
timeout:
enable: 120
keepalive: 300
dashboard:
password: ""
username: admin
websocket: true
storages:
bmclapi:
path: ./bmclapi
type: file
width: 0
web:
force_ssl: false
port: 8080
server_name: TTB-Network
ssl_port: 8800
x_forwarded_for: 0

配置项

advanced

该部分为进阶配置,仅作调试使用,在正常使用 python-openbmclapi 时不需要更改该部分的配置项。

参数类型默认值是否必填描述
auto_updatebooleanfalse是否启用自动更新(自动更新时会下载最新版本的 Release 压缩包)。
copy_from_another_storagebooleantrue是否在同步文件时使用已配置储存进行同步。
debugbooleanfalse是否启用调试模式。
download_threadsint64最高下载线程。
header_bytesint4096新连接读取数据头大小。
io_bufferint16777216数据传输缓存大小。
languagestring'zh_cn'语言。
min_rateint500最小读取速率(Bytes)。
min_rate_timestampint1000最小读取速率时间。
request_bufferint8192请求缓存大小。
skip_signbooleanfalse是否跳过签名检测。
timeoutint30超时时间。
urlstring'https://openbmclapi.bangbang93.com/'OpenBMCLAPI 的 BaseURL。

cache

该部分为对文件缓存的配置。

参数类型默认值是否必填描述
bufferint536870912缓存大小(Bytes)。
checkint360检查过时文件时间(秒)。
enablebooleantrue是否启用缓存。
timeint1800缓存保留时间(秒)。

cluster

该部分为节点配置。

参数类型默认值是否必填描述
byocbooleanfalse是否不使用 BMCLAPI 分发的证书, 同 CLUSTER_BYOC
enablebooleantrue是否启用节点。
download_access_logsbooleantrue是否启用下载日志。
download_retry_delayinttrue下载时重试延迟时间。
idstring''OpenBMCLAPI 的 CLUSTER_ID
public_hostboolean''实际开放的公网主机名, 同 CLUSTER_IP
public_portint8800实际开放的公网端口, 同 CLUSTER_PUBLIC_PORT
reconnect.delayint60重连间隔。
reconnect.retryint-1重连次数,-1 为无限次数。
secretstring''OpenBMCLAPI 的 CLUSTER_SECRET
timeout.enableint120发送启用数据包超时时间。
timeout.keepaliveint300发送保活数据包超时时间。

dashboard

该部分为仪表盘配置。

参数类型默认值是否必填说明
passwordstringundefined仪表盘的密码(若未配置程序会自动生成)。
usernamestring'admin'仪表盘用户名。
websocketbooleantrue是否启用 WebSocket。

storages

该部分为储存配置。

储存类型分为两种:file(本地存储)和 webdav(WebDAV)。

使用本地储存

config/config.yml
bmclapi: # 你的存储名字,可以使用任何英文名称
path: ./bmclapi
type: file
width: 0
参数类型是否必填说明
pathstring存储路径。
typestring储存类型,可选值为 file(本地存储)和 webdav(WebDAV)。
widthint选用存储下载权重,-1 为禁用,不选择,但会下载文件。

使用 WebDAV 储存

config/config.yml
bmclapi_webdav:
path: /bmclapidev
type: webdav
width: 2
endpoint: http://localhost:5244/dav
username: user
password: password
参数类型是否必填说明
pathstring存储路径。
typestring储存类型,可选值为 file(本地存储)和 webdav(WebDAV)。
widthint选用存储下载权重,-1 为禁用,不选择,但会下载文件。
endpointstring你的 WebDAV 端点。
usernamestringWebDAV 用户名。
passwordstringWebDAV 用户密码。

web

该部分为 Web 相关的配置。

参数类型默认值是否必填
force_sslbooleanfalse
portint8080
server_namestringTTB-Network