HibiAPI / hibiapi /configs /general.yml
DengFengLai's picture
DF.
0a1b571
# _ _ _ _ _ _____ _____
# | | | (_) | (_) /\ | __ \_ _|
# | |__| |_| |__ _ / \ | |__) || |
# | __ | | '_ \| | / /\ \ | ___/ | |
# | | | | | |_) | |/ ____ \| | _| |_
# |_| |_|_|_.__/|_/_/ \_\_| |_____|
#
# An alternative implement of Imjad API
data:
temp-expiry: 7 # 临时文件目录文件过期时间, 单位为天
path: ./data # data目录所在位置
server:
host: 127.0.0.1 # 监听主机
port: 8080 # 端口
gzip: true
# 限定来源域名, 支持通配符, 参考:
# https://fastapi.tiangolo.com/advanced/middleware/#trustedhostmiddleware
allowed: ["*"]
cors:
origins:
- "http://localhost.tiangolo.com"
- "https://localhost.tiangolo.com"
- "http://localhost"
- "http://localhost:8080"
credentials: true
methods: ["*"]
headers: ["*"]
allowed-forward: null # Reference: https://stackoverflow.com/questions/63511413
limit: # 单IP速率限制策略
enabled: true
max: 60 # 每个单位时间内最大请求数
interval: 60 # 单位时间长度, 单位为秒
cache:
enabled: true # 设置是否启用缓存
ttl: 3600 # 缓存默认生存时间, 单位为秒
uri: "mem://" # 缓存URI
controllable: true # 配置是否可以通过Cache-Control请求头刷新缓存
log:
level: INFO # 日志等级, 可选 [TRACE,DEBUG,INFO,WARNING,ERROR]
format: > # 输出日志格式, 如果没有必要请不要修改
<level>
<v>{level:<8}</v>
[{time:YYYY/MM/DD} {time:HH:mm:ss.SSS} <d>{module}:{name}:{line}</d>]</level>
{message}
# file: logs/{time.log}
file: null # 日志输出文件位置, 相对于data目录, 为空则不保存
sentry:
enabled: false
sample: 1
dsn: ""
pii: false
content:
slogan: | # 在文档附加的标语, 可以用于自定义内容
![](https://img.shields.io/github/stars/mixmoe/HibiAPI?color=brightgreen&logo=github&style=for-the-badge)
robots: | # 提供的robots.txt内容, 用于提供搜索引擎抓取
User-agent: *
Disallow: /api/
authorization:
enabled: false # 是否开启验证
allowed:
- username: admin # 用户名
password: admin # 密码