- 修复config.py中auth配置读取路径问题 - 在main.py中添加uvicorn自动启动功能 - 禁用FastAPI文档页面增强安全性 - 使服务器端口和监听地址可配置 - 添加完整的配置验证和测试
14 lines
316 B
Python
14 lines
316 B
Python
import tomllib
|
|
|
|
with open("config.toml", "rb") as f:
|
|
config = tomllib.load(f)
|
|
|
|
app_id = config["appId"]
|
|
key = config["key"]
|
|
secret = config["secret"]
|
|
avaliable_secrets = set(config["auth"]["avaliableSecrets"])
|
|
|
|
# Server configuration
|
|
server_host = config["server"]["host"]
|
|
server_port = config["server"]["port"]
|