From f1f8d82e2891f1825bc191a5b7576e0d1cd5cad0 Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Thu, 5 Oct 2023 12:47:30 +0000 Subject: [PATCH] doc: config file comments --- README.md | 29 ++++++++++++++++++++++++++++- README_en.md | 27 +++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e5767b0..c423224 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ python main.py 你可以在 `http://localhost:3000/` 打开管理页面。 -## Usage +## 用法 1. 创建一个 channel,按照说明填写配置,然后创建一个新的 key。 @@ -135,6 +135,33 @@ response = openai.ChatCompletion.create( print(response) ``` +### 配置文件 + +配置文件位于`data/config.yaml` + +```yaml +database: + # SQLite 数据库文件路径 + path: ./data/free_one_api.db + type: sqlite +router: + # 后端监听端口 + port: 3000 + # 管理页登录密码 + token: '12345678' +watchdog: + heartbeat: + # 自动停用渠道前的心跳失败次数 + fail_limit: 3 + # 心跳检测间隔(秒) + interval: 1800 + # 单个渠道心跳检测超时时间(秒) + timeout: 300 +web: + # 前端页面路径 + frontend_path: ./web/dist/ +``` + ## 快速体验 ### Demo diff --git a/README_en.md b/README_en.md index 2ce95eb..a0b52d0 100644 --- a/README_en.md +++ b/README_en.md @@ -135,6 +135,33 @@ response = openai.ChatCompletion.create( print(response) ``` +### Configurations + +Configuration file is saved at `data/config.yaml` + +```yaml +database: + # SQLite DB file path + path: ./data/free_one_api.db + type: sqlite +router: + # Backend listen port + port: 3000 + # Admin page login password + token: '12345678' +watchdog: + heartbeat: + # Max fail times + fail_limit: 3 + # Heartbeat check interval (seconds) + interval: 1800 + # Single channel heartbeat check timeout (seconds) + timeout: 300 +web: + # Frontend page path + frontend_path: ./web/dist/ +``` + ## Quick Test ### Demo