add:ota管理与固件上传与下载 (#931)

* 新增ota管理与固件上传于下载

* feat: 支持通过OTA更新websocket地址

* update:合并最新代码

* update:优化OTA增删改查

* update:一个临时下载链接最多只能下载3次,防止盗链和流量攻击

* update:OTA固件增删改查

---------

Co-authored-by: kevin1sMe <linjiang1205@gmail.com>
Co-authored-by: hrz <1710360675@qq.com>
This commit is contained in:
@AI人
2025-04-22 23:36:23 +08:00
committed by GitHub
co-authored by kevin1sMe hrz
parent 13c0a966ec
commit 78fa5d3110
45 changed files with 1831 additions and 530 deletions
@@ -69,6 +69,11 @@ def get_config_from_api(config):
"url": config["manager-api"].get("url", ""),
"secret": config["manager-api"].get("secret", ""),
}
if config.get("server"):
config_data["server"] = {
"ip": config["server"].get("ip", ""),
"port": config["server"].get("port", ""),
}
return config_data
+1 -1
View File
@@ -3,7 +3,7 @@ import sys
from loguru import logger
from config.config_loader import load_config
SERVER_VERSION = "0.3.9"
SERVER_VERSION = "0.3.10"
def get_module_abbreviation(module_name, module_dict):
+3
View File
@@ -5,6 +5,9 @@
# 先启动manager-api和manager-web,注册一个账号,第一个注册的账号为管理员
# 使用管理员,进入【参数管理】页面,找到【server.secret】,复制它到参数值,注意每次从零部署,server.secret都会变化
# 打开本data目录下的.config.yaml文件,修改manager-api.secret为刚才复制出来的server.secret
server:
ip: 0.0.0.0
port: 8000
manager-api:
# 你的manager-api的地址,最好使用局域网ip
url: http://127.0.0.1:8002/xiaozhi
+1 -1
View File
@@ -24,7 +24,7 @@ class WebSocketServer:
async def start(self):
server_config = self.config["server"]
host = server_config["ip"]
host = server_config.get("ip", "0.0.0.0")
port = int(server_config.get("port", 8000))
self.logger.bind(tag=TAG).info(
+5 -1
View File
@@ -47,6 +47,10 @@ services:
- SPRING_DATASOURCE_DRUID_PASSWORD=123456
- SPRING_DATA_REDIS_HOST=xiaozhi-esp32-server-redis
- SPRING_DATA_REDIS_PORT=6379
volumes:
# 配置文件目录
- ./uploadfile:/app/uploadfile
xiaozhi-esp32-server-db:
image: mysql:latest
container_name: xiaozhi-esp32-server-db
@@ -59,7 +63,7 @@ services:
networks:
- default
expose:
- "3306"
- 3306
volumes:
- ./mysql/data:/var/lib/mysql
environment: