mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-29 03:23:57 +08:00
修复分布式部署时jwt密钥同步问题
This commit is contained in:
@@ -46,8 +46,13 @@ async def main():
|
|||||||
check_ffmpeg_installed()
|
check_ffmpeg_installed()
|
||||||
config = load_config()
|
config = load_config()
|
||||||
|
|
||||||
# 生成随机密钥并添加到配置中
|
# 默认使用manager-api的secret作为auth_key
|
||||||
config["server"]["auth_key"] = str(uuid.uuid4().hex)
|
# 如果secret为空,则生成随机密钥
|
||||||
|
# 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
|
||||||
|
|
||||||
# 添加 stdin 监控任务
|
# 添加 stdin 监控任务
|
||||||
stdin_task = asyncio.create_task(monitor_stdin())
|
stdin_task = asyncio.create_task(monitor_stdin())
|
||||||
|
|||||||
Reference in New Issue
Block a user