Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Mar 26, 2024
1 parent 9f547cd commit 3891f0f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
24 changes: 24 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,30 @@ serve-limit:
# 上行速率限制 (KiB/s), 0 表示无限制
upload-rate: 0

# API 速率限制. 注意: 该功能仅限制对 /api 路径的访问, 不会影响 openbmclapi 基本功能
api-rate-limit:
# 未登录用户的速率限制, 以访问 IP 为准 (会被 trusted-x-forwarded-for 标志影响)
anonymous:
per-minute: 10 # 每分钟最多请求数, 0 表示不限制
per-hour: 120 # 每小时最多请求数, 0 表示不限制
# 已登录用户的速率限制, 以用户名为准
logged:
per-minute: 120
per-hour: 6000

# 通知设置
notification:
# 启用邮件通知
enable-email: false
# 邮件 SMTP 服务器及其端口
email-smtp: smtp.example.com:25
# 通知者邮箱用户名
email-sender: [email protected]
# 通知者邮箱密码
email-sender-password: example-password
# 启用 Webhook (TODO)
enable-webhook: true

# 内置的仪表板
dashboard:
# 是否启用
Expand Down
13 changes: 13 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ serve-limit:
enable: false
max-conn: 16384
upload-rate: 10240
api-rate-limit:
anonymous:
per-minute: 10
per-hour: 120
logged:
per-minute: 120
per-hour: 6000
notification:
enable-email: false
email-smtp: smtp.example.com:25
email-sender: [email protected]
email-sender-password: example-password
enable-webhook: true
dashboard:
enable: true
username: ""
Expand Down
2 changes: 1 addition & 1 deletion notify/email/email.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var tmpl = func() *template.Template {
},
"tojson": json.Marshal,
})
template.Must(t.ParseFS(tmplFS))
template.Must(t.ParseFS(tmplFS, "**/*.gohtml"))
return t
}()

Expand Down

0 comments on commit 3891f0f

Please sign in to comment.