feat: 添加WS TOKEN 认证功能

This commit is contained in:
TOM88812
2025-02-13 17:06:48 +08:00
parent 19bfc0f605
commit c358774e97
4 changed files with 129 additions and 26 deletions
+17 -6
View File
@@ -5,7 +5,18 @@ server:
port: 8000
# 服务器是否只接受来自esp32-小智的连接,为了安全起见,建议设置为true
# Whether the server only accepts connections from ESP32-Ash is recommended to be set to true for security purposes
only_esp32_xiaozhi_connect: false
only_esp32_xiaozhi_connect: true
# 认证配置
auth:
enabled: true # 是否启用认证
tokens:
- token: "your-secure-token-1" # 设备1的token
name: "device1" # 设备标识
- token: "your-secure-token-2" # 设备2的token
name: "device2"
# 可选:设备白名单
#allowed_devices:
# - "24:0A:C4:1D:3B:F0" # MAC地址列表
xiaozhi:
type: hello
@@ -27,7 +38,7 @@ delete_audio: true
selected_module:
ASR: FunASR
VAD: SileroVAD
LLM: ChatGLMLLM
LLM: DifyLLM
TTS: EdgeTTS
ASR:
@@ -46,7 +57,7 @@ LLM:
# 可在这里找到你的 api_key https://bailian.console.aliyun.com/?apiKey=1#/api-key
base_url: https://dashscope.aliyuncs.com/compatible-mode/v1
model_name: qwen-turbo
api_key: 你的阿里云dashscope api key
api_key: 你的deepseek api key
DeepSeekLLM:
# 可在这里找到你的api key https://platform.deepseek.com/
model_name: deepseek-chat
@@ -56,12 +67,12 @@ LLM:
# 可在这里找到你的api key https://bigmodel.cn/usercenter/proj-mgmt/apikeys
model_name: glm-4-flash
url: https://open.bigmodel.cn/api/paas/v4/
api_key: 你的bigmodel api key
api_key: 你的ChatGLMLLM api key
DifyLLM:
# 建议使用本地部署的dify接口,国内部分区域访问dify公有云接口可能会受限
# 如果使用DifyLLM,配置文件里prompt(提示词)是无效的,需要在dify控制台设置提示词
base_url: 你的私有化部署的dify接口地址
api_key: 你的dify api key
base_url: https://api.dify.cn/v1
api_key: 你的DifyLLM api key
TTS:
EdgeTTS:
voice: zh-CN-XiaoxiaoNeural