mirror of https://github.com/Mai-with-u/MaiBot.git
移除.env文件
parent
54e9007b8d
commit
4dbe919cfe
|
|
@ -7,7 +7,7 @@ version 0.3.0 - 2026-01-11
|
|||
- [x] 使用 python 方法作为配置项说明(提案)
|
||||
- [x] 取消`bot_config_template.toml`
|
||||
- [x] 取消`model_config_template.toml`
|
||||
- [ ] 取消`template_env`
|
||||
- [x] 取消`template_env`
|
||||
- [x] 配置类中的所有原子项目应该只包含以下类型: `str`, `int`, `float`, `bool`, `list`, `dict`, `set`
|
||||
- [x] 禁止使用 `Union` 类型
|
||||
- [x] 禁止使用`tuple`类型,使用嵌套`dataclass`替代
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import asyncio
|
||||
|
||||
from fastapi import FastAPI, APIRouter
|
||||
from rich.traceback import install
|
||||
from typing import Optional
|
||||
from uvicorn import Config, Server as UvicornServer
|
||||
import asyncio
|
||||
import os
|
||||
from rich.traceback import install
|
||||
|
||||
install(extra_lines=3)
|
||||
|
||||
|
|
@ -97,7 +97,11 @@ global_server = None
|
|||
|
||||
def get_global_server() -> Server:
|
||||
"""获取全局服务器实例"""
|
||||
from src.config.config import global_config
|
||||
|
||||
global global_server
|
||||
if global_server is None:
|
||||
global_server = Server(host=os.environ["HOST"], port=int(os.environ["PORT"]))
|
||||
global_server = Server(
|
||||
host=global_config.maim_message.ws_server_host, port=global_config.maim_message.ws_server_port
|
||||
)
|
||||
return global_server
|
||||
|
|
|
|||
|
|
@ -512,6 +512,11 @@ class ExperimentalConfig(ConfigBase):
|
|||
|
||||
class MaimMessageConfig(ConfigBase):
|
||||
"""maim_message配置类"""
|
||||
ws_server_host: str = "127.0.0.1"
|
||||
"""旧版基于WS的服务器主机地址"""
|
||||
|
||||
ws_server_port: int = 8080
|
||||
"""旧版基于WS的服务器端口号"""
|
||||
|
||||
auth_token: list[str] = Field(default_factory=lambda: [])
|
||||
"""认证令牌,用于旧版API验证,为空则不启用验证"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue