From 9194ffa6b7feaf6d178de818f583ef65e2aafe61 Mon Sep 17 00:00:00 2001 From: Chingfeng Li Date: Mon, 20 Oct 2025 11:57:18 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BA=86auth=5Fkey=EF=BC=8C=E5=88=99?= =?UTF-8?q?=E4=B8=8D=E4=BD=BF=E7=94=A8uuid=E7=94=9F=E6=88=90=EF=BC=9B=20?= =?UTF-8?q?=E9=80=82=E9=85=8D=E5=8D=95=E6=A8=A1=E5=9D=97=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=EF=BC=8C=E9=98=B2=E6=AD=A2=E6=AF=8F=E6=AC=A1=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E8=AE=BE=E5=A4=87=E9=83=BD=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/xiaozhi-server/app.py b/main/xiaozhi-server/app.py index 0edb475b..48ca8c9c 100644 --- a/main/xiaozhi-server/app.py +++ b/main/xiaozhi-server/app.py @@ -51,8 +51,9 @@ async def main(): # auth_key用于jwt认证,比如视觉分析接口的jwt认证 auth_key = config.get("manager-api", {}).get("secret", "") if not auth_key or len(auth_key) == 0 or "你" in auth_key: - auth_key = str(uuid.uuid4().hex) - config["server"]["auth_key"] = auth_key + if not config["server"]["auth_key"]: + auth_key = str(uuid.uuid4().hex) + config["server"]["auth_key"] = auth_key # 添加 stdin 监控任务 stdin_task = asyncio.create_task(monitor_stdin()) From c992ed48daec310c4cd5f6d67a5ee2e10394b20a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 13:19:35 +0000 Subject: [PATCH 2/5] build(deps): bump torchaudio from 2.2.2 to 2.9.0 in /main/xiaozhi-server Bumps [torchaudio](https://github.com/pytorch/audio) from 2.2.2 to 2.9.0. - [Release notes](https://github.com/pytorch/audio/releases) - [Commits](https://github.com/pytorch/audio/compare/v2.2.2...v2.9.0) --- updated-dependencies: - dependency-name: torchaudio dependency-version: 2.9.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- main/xiaozhi-server/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 main/xiaozhi-server/requirements.txt diff --git a/main/xiaozhi-server/requirements.txt b/main/xiaozhi-server/requirements.txt old mode 100755 new mode 100644 index 75964ec9..c9f164f6 --- a/main/xiaozhi-server/requirements.txt +++ b/main/xiaozhi-server/requirements.txt @@ -6,7 +6,7 @@ opuslib_next==1.1.2 numpy==1.26.4 pydub==0.25.1 funasr==1.2.3 -torchaudio==2.2.2 +torchaudio==2.9.0 openai==1.107.0 google-generativeai==0.8.5 edge_tts==7.0.0 From ad6607b7f5b927644d2f2bb337ec322534a619bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 13:19:42 +0000 Subject: [PATCH 3/5] build(deps): bump mem0ai from 0.1.62 to 1.0.0 in /main/xiaozhi-server Bumps [mem0ai](https://github.com/mem0ai/mem0) from 0.1.62 to 1.0.0. - [Release notes](https://github.com/mem0ai/mem0/releases) - [Changelog](https://github.com/mem0ai/mem0/blob/main/docs/changelog.mdx) - [Commits](https://github.com/mem0ai/mem0/compare/0.1.62...v1.0.0) --- updated-dependencies: - dependency-name: mem0ai dependency-version: 1.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- main/xiaozhi-server/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 main/xiaozhi-server/requirements.txt diff --git a/main/xiaozhi-server/requirements.txt b/main/xiaozhi-server/requirements.txt old mode 100755 new mode 100644 index 75964ec9..d7175def --- a/main/xiaozhi-server/requirements.txt +++ b/main/xiaozhi-server/requirements.txt @@ -18,7 +18,7 @@ ruamel.yaml==0.18.15 loguru==0.7.3 requests==2.32.5 cozepy==0.19.0 -mem0ai==0.1.62 +mem0ai==1.0.0 bs4==0.0.2 modelscope==1.23.2 sherpa_onnx==1.12.11 From ff048797a1ab8bbae791cbad4c7252e01387596b Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Mon, 20 Oct 2025 21:25:37 +0800 Subject: [PATCH 4/5] =?UTF-8?q?auth=5Fkey=E4=BC=98=E5=85=88=E7=BA=A7?= =?UTF-8?q?=EF=BC=9A=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6server.auth=5Fkey?= =?UTF-8?q?=20>=20manager-api.secret=20>=20=E8=87=AA=E5=8A=A8=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/app.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/main/xiaozhi-server/app.py b/main/xiaozhi-server/app.py index 48ca8c9c..bc6f0b54 100644 --- a/main/xiaozhi-server/app.py +++ b/main/xiaozhi-server/app.py @@ -46,14 +46,19 @@ async def main(): check_ffmpeg_installed() config = load_config() - # 默认使用manager-api的secret作为auth_key - # 如果secret为空,则生成随机密钥 - # auth_key用于jwt认证,比如视觉分析接口的jwt认证 - auth_key = config.get("manager-api", {}).get("secret", "") + # auth_key优先级:配置文件server.auth_key > manager-api.secret > 自动生成 + # auth_key用于jwt认证,比如视觉分析接口的jwt认证、ota接口的token生成与websocket认证 + # 获取配置文件中的auth_key + auth_key = config["server"].get("auth_key", "") + + # 验证auth_key,无效则尝试使用manager-api.secret if not auth_key or len(auth_key) == 0 or "你" in auth_key: - if not config["server"]["auth_key"]: + auth_key = config.get("manager-api", {}).get("secret", "") + # 验证secret,无效则生成随机密钥 + if not auth_key or len(auth_key) == 0 or "你" in auth_key: auth_key = str(uuid.uuid4().hex) - config["server"]["auth_key"] = auth_key + + config["server"]["auth_key"] = auth_key # 添加 stdin 监控任务 stdin_task = asyncio.create_task(monitor_stdin()) From c139701468869b1b706545bed0ce877e23c7efb9 Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Mon, 20 Oct 2025 23:38:59 +0800 Subject: [PATCH 5/5] =?UTF-8?q?update:=E4=BF=AE=E5=A4=8Dmanager-api?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/xiaozhi/common/exception/ErrorCode.java | 16 ++++++++-------- .../src/main/resources/i18n/messages.properties | 4 +++- .../resources/i18n/messages_en_US.properties | 4 +++- .../resources/i18n/messages_zh_CN.properties | 4 +++- .../resources/i18n/messages_zh_TW.properties | 5 ++++- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/main/manager-api/src/main/java/xiaozhi/common/exception/ErrorCode.java b/main/manager-api/src/main/java/xiaozhi/common/exception/ErrorCode.java index 63b625b5..82b16ec5 100644 --- a/main/manager-api/src/main/java/xiaozhi/common/exception/ErrorCode.java +++ b/main/manager-api/src/main/java/xiaozhi/common/exception/ErrorCode.java @@ -82,14 +82,6 @@ public interface ErrorCode { int DEVICE_ALREADY_ACTIVATED = 10063; // 默认模型删除错误 int DEFAULT_MODEL_DELETE_ERROR = 10064; - // 设备相关错误码 - int MAC_ADDRESS_ALREADY_EXISTS = 10090; // Mac地址已存在 - // 模型相关错误码 - int MODEL_PROVIDER_NOT_EXIST = 10091; // 供应器不存在 - int LLM_NOT_EXIST = 10092; // 设置的LLM不存在 - int MODEL_REFERENCED_BY_AGENT = 10093; // 该模型配置已被智能体引用,无法删除 - int LLM_REFERENCED_BY_INTENT = 10094; // 该LLM模型已被意图识别配置引用,无法删除 - // 登录相关错误码 int ADD_DATA_FAILED = 10065; // 新增数据失败 int UPDATE_DATA_FAILED = 10066; // 修改数据失败 @@ -127,6 +119,14 @@ public interface ErrorCode { int VOICEPRINT_UNREGISTER_PROCESS_ERROR = 10090; // 声纹注销处理失败 int VOICEPRINT_IDENTIFY_REQUEST_ERROR = 10091; // 声纹识别请求失败 + // 设备相关错误码 + int MAC_ADDRESS_ALREADY_EXISTS = 10161; // Mac地址已存在 + // 模型相关错误码 + int MODEL_PROVIDER_NOT_EXIST = 10162; // 供应器不存在 + int LLM_NOT_EXIST = 10092; // 设置的LLM不存在 + int MODEL_REFERENCED_BY_AGENT = 10093; // 该模型配置已被智能体引用,无法删除 + int LLM_REFERENCED_BY_INTENT = 10094; // 该LLM模型已被意图识别配置引用,无法删除 + // 服务端管理相关错误码 int INVALID_SERVER_ACTION = 10095; // 无效服务端操作 int SERVER_WEBSOCKET_NOT_CONFIGURED = 10096; // 未配置服务端WebSocket地址 diff --git a/main/manager-api/src/main/resources/i18n/messages.properties b/main/manager-api/src/main/resources/i18n/messages.properties index 45eff87b..77689569 100644 --- a/main/manager-api/src/main/resources/i18n/messages.properties +++ b/main/manager-api/src/main/resources/i18n/messages.properties @@ -166,4 +166,6 @@ 10157=\u8BF7\u6C42\u5931\u8D25 10158=\u8BF7\u6C42\u5931\u8D25\uFF0C\u72B6\u6001\u7801{0} 10159=\u97F3\u8272ID\u5DF2\u5B58\u5728 -10160=\u706B\u5C71\u5F15\u64CE\u97F3\u8272ID\u683C\u5F0F\u9519\u8BEF\uFF0C\u5FC5\u987B\u4EE5S_\u5F00\u5934 \ No newline at end of file +10160=\u706B\u5C71\u5F15\u64CE\u97F3\u8272ID\u683C\u5F0F\u9519\u8BEF\uFF0C\u5FC5\u987B\u4EE5S_\u5F00\u5934 +10161=Mac\u5730\u5740\u5DF2\u5B58\u5728 +10162=\u6A21\u578B\u4F9B\u5E94\u5668\u4E0D\u5B58\u5728 \ No newline at end of file diff --git a/main/manager-api/src/main/resources/i18n/messages_en_US.properties b/main/manager-api/src/main/resources/i18n/messages_en_US.properties index 98cd91db..04354f63 100644 --- a/main/manager-api/src/main/resources/i18n/messages_en_US.properties +++ b/main/manager-api/src/main/resources/i18n/messages_en_US.properties @@ -166,4 +166,6 @@ 10157=Request failed 10158=Clone Voice: 10159=Voice ID already exists -10160=Huoshan Engine voice ID format error, must start with S_ \ No newline at end of file +10160=Huoshan Engine voice ID format error, must start with S_ +10161=Mac address already exists +10162=Model provider does not exist \ No newline at end of file diff --git a/main/manager-api/src/main/resources/i18n/messages_zh_CN.properties b/main/manager-api/src/main/resources/i18n/messages_zh_CN.properties index 563ee766..6fb10371 100644 --- a/main/manager-api/src/main/resources/i18n/messages_zh_CN.properties +++ b/main/manager-api/src/main/resources/i18n/messages_zh_CN.properties @@ -166,4 +166,6 @@ 10157=\u8BF7\u6C42\u5931\u8D25 10158=\u514B\u9686\u8272\u97F3: 10159=\u97F3\u8272ID\u5DF2\u5B58\u5728 -10160=\u706B\u5C71\u5F15\u64CE\u97F3\u8272ID\u683C\u5F0F\u9519\u8BEF\uFF0C\u5FC5\u987B\u4EE5S_\u5F00\u5934 \ No newline at end of file +10160=\u706B\u5C71\u5F15\u64CE\u97F3\u8272ID\u683C\u5F0F\u9519\u8BEF\uFF0C\u5FC5\u987B\u4EE5S_\u5F00\u5934 +10161=Mac\u5730\u5740\u5DF2\u5B58\u5728 +10162=\u6A21\u578B\u4F9B\u5E94\u5668\u4E0D\u5B58\u5728 \ No newline at end of file diff --git a/main/manager-api/src/main/resources/i18n/messages_zh_TW.properties b/main/manager-api/src/main/resources/i18n/messages_zh_TW.properties index 4f7ebabf..0f5d316c 100644 --- a/main/manager-api/src/main/resources/i18n/messages_zh_TW.properties +++ b/main/manager-api/src/main/resources/i18n/messages_zh_TW.properties @@ -166,4 +166,7 @@ 10157=\u8ACB\u6C42\u5931\u6557 10158=\u514B\u9686\u8A9E\u97F3: 10159=\u97F3\u8272ID\u5DF2\u5B58\u5728 -10160=\u706B\u5C71\u5F15\u64CE\u97F3\u8272ID\u683C\u5F0F\u932F\u8AA4\uFF0C\u5FC5\u9808\u4EE5S_\u958B\u982D \ No newline at end of file +10160=\u706B\u5C71\u5F15\u64CE\u97F3\u8272ID\u683C\u5F0F\u932F\u8AA4\uFF0C\u5FC5\u9808\u4EE5S_\u958B\u982D +10161=Mac\u5730\u5740\u5DF2\u5B58\u5728 +10162=\u6A21\u578B\u63D0\u4F9B\u5546\u4E0D\u5B58\u5728 +