支持local_config启动 添加注册表description字段 (#13)

Closes #11

* Update README and MQTTClient for installation instructions and code improvements

* feat: 支持local_config启动
add: 增加对crt path的说明,为传入config.py的相对路径
move: web component

* add: registry description

---------

Co-authored-by: Harvey Que <Q-Query@outlook.com>
This commit is contained in:
Xuwznln
2025-04-20 18:24:45 +08:00
committed by GitHub
parent 22a02bdb06
commit 35ada068cc
39 changed files with 114 additions and 34 deletions

View File

@@ -28,9 +28,9 @@ class MQConfig:
key_content = ""
# 指定
ca_file = ""
cert_file = ""
key_file = ""
ca_file = "" # 相对config.py所在目录的路径
cert_file = "" # 相对config.py所在目录的路径
key_file = "" # 相对config.py所在目录的路径
# OSS上传配置
@@ -97,7 +97,7 @@ def load_config(config_path=None):
BasicConfig.config_path = os.path.abspath(os.path.dirname(config_path))
if not os.path.exists(config_path):
logger.error(f"配置文件 {config_path} 不存在")
return
exit(1)
try:
module_name = "lab_" + os.path.basename(config_path).replace(".py", "")
@@ -114,10 +114,5 @@ def load_config(config_path=None):
traceback.print_exc()
exit(1)
else:
try:
import unilabos.config.local_config as local_config # type: ignore
_update_config_from_module(local_config)
logger.info("已加载默认配置 unilabos.config.local_config")
except ImportError:
pass
config_path = os.path.join(os.path.dirname(__file__), "local_config.py")
load_config(config_path)