v0.1.4-p2
parent
51645be883
commit
fe066f19fe
|
|
@ -40,14 +40,13 @@ REDIS_DEFAULT_TTL=60
|
||||||
|
|
||||||
# Panel access protection
|
# Panel access protection
|
||||||
PANEL_ACCESS_PASSWORD=change_me_panel_password
|
PANEL_ACCESS_PASSWORD=change_me_panel_password
|
||||||
|
|
||||||
# Internal URL used by built-in topic_mcp server inside bot container
|
# Internal URL used by built-in topic_mcp server inside bot container
|
||||||
TOPIC_MCP_INTERNAL_URL=http://host.docker.internal:8000/api/mcp/topic
|
TOPIC_MCP_INTERNAL_URL=http://host.docker.internal:8000/api/mcp/topic
|
||||||
# Template files inside backend container
|
|
||||||
AGENT_MD_TEMPLATES_FILE=templates/agent_md_templates.json
|
|
||||||
TOPIC_PRESETS_TEMPLATES_FILE=templates/topic_presets.json
|
|
||||||
|
|
||||||
# Max upload size for backend validation (MB)
|
# Max upload size for backend validation (MB)
|
||||||
UPLOAD_MAX_MB=200
|
UPLOAD_MAX_MB=200
|
||||||
|
|
||||||
# Workspace files that should use direct download behavior in dashboard
|
# Workspace files that should use direct download behavior in dashboard
|
||||||
WORKSPACE_DOWNLOAD_EXTENSIONS=.pdf,.doc,.docx,.xls,.xlsx,.xlsm,.ppt,.pptx,.odt,.ods,.odp,.wps,.stl,.scad,.zip,.rar
|
WORKSPACE_DOWNLOAD_EXTENSIONS=.pdf,.doc,.docx,.xls,.xlsx,.xlsm,.ppt,.pptx,.odt,.ods,.odp,.wps,.stl,.scad,.zip,.rar
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,6 @@ graph TD
|
||||||
- `DATABASE_ECHO`:SQL 日志输出开关
|
- `DATABASE_ECHO`:SQL 日志输出开关
|
||||||
- 不提供自动数据迁移(如需升级迁移请离线完成后再切换连接串)
|
- 不提供自动数据迁移(如需升级迁移请离线完成后再切换连接串)
|
||||||
- `DATA_ROOT`、`BOTS_WORKSPACE_ROOT`:运行数据与 Bot 工作目录
|
- `DATA_ROOT`、`BOTS_WORKSPACE_ROOT`:运行数据与 Bot 工作目录
|
||||||
- `AGENT_MD_TEMPLATES_FILE`:5 个代理 MD 模板文件路径
|
|
||||||
- `TOPIC_PRESETS_TEMPLATES_FILE`:主题预设模板文件路径
|
|
||||||
- `DEFAULT_*_MD`:可选覆盖值(一般留空,推荐走模板文件)
|
- `DEFAULT_*_MD`:可选覆盖值(一般留空,推荐走模板文件)
|
||||||
- 前端:
|
- 前端:
|
||||||
- 示例文件:`frontend/.env.example`
|
- 示例文件:`frontend/.env.example`
|
||||||
|
|
|
||||||
|
|
@ -49,14 +49,6 @@ APP_HOST=0.0.0.0
|
||||||
APP_PORT=8000
|
APP_PORT=8000
|
||||||
APP_RELOAD=true
|
APP_RELOAD=true
|
||||||
|
|
||||||
# Template files (no hard-coded default content in code)
|
|
||||||
# Agent template file must include:
|
|
||||||
# agents_md, soul_md, user_md, tools_md, identity_md
|
|
||||||
AGENT_MD_TEMPLATES_FILE=templates/agent_md_templates.json
|
|
||||||
# Topic presets template file must include:
|
|
||||||
# { "presets": [ ... ] }
|
|
||||||
TOPIC_PRESETS_TEMPLATES_FILE=templates/topic_presets.json
|
|
||||||
|
|
||||||
# Optional overrides (fallback only; usually keep empty when using template files)
|
# Optional overrides (fallback only; usually keep empty when using template files)
|
||||||
DEFAULT_AGENTS_MD=
|
DEFAULT_AGENTS_MD=
|
||||||
DEFAULT_SOUL_MD=
|
DEFAULT_SOUL_MD=
|
||||||
|
|
|
||||||
|
|
@ -84,17 +84,6 @@ def _normalize_dir_path(path_value: str) -> str:
|
||||||
return str((BACKEND_ROOT / p).resolve())
|
return str((BACKEND_ROOT / p).resolve())
|
||||||
|
|
||||||
|
|
||||||
def _normalize_file_path(path_value: str, fallback: Path) -> Path:
|
|
||||||
raw = str(path_value or "").strip()
|
|
||||||
if not raw:
|
|
||||||
return fallback
|
|
||||||
raw = os.path.expandvars(os.path.expanduser(raw))
|
|
||||||
p = Path(raw)
|
|
||||||
if p.is_absolute():
|
|
||||||
return p
|
|
||||||
return (BACKEND_ROOT / p).resolve()
|
|
||||||
|
|
||||||
|
|
||||||
def _load_json_object(path: Path) -> dict[str, object]:
|
def _load_json_object(path: Path) -> dict[str, object]:
|
||||||
try:
|
try:
|
||||||
with open(path, "r", encoding="utf-8") as f:
|
with open(path, "r", encoding="utf-8") as f:
|
||||||
|
|
@ -224,14 +213,8 @@ TOPIC_MCP_INTERNAL_URL: Final[str] = str(
|
||||||
).strip()
|
).strip()
|
||||||
|
|
||||||
TEMPLATE_ROOT: Final[Path] = (BACKEND_ROOT / "templates").resolve()
|
TEMPLATE_ROOT: Final[Path] = (BACKEND_ROOT / "templates").resolve()
|
||||||
AGENT_MD_TEMPLATES_FILE: Final[Path] = _normalize_file_path(
|
AGENT_MD_TEMPLATES_FILE: Final[Path] = TEMPLATE_ROOT / "agent_md_templates.json"
|
||||||
os.getenv("AGENT_MD_TEMPLATES_FILE", ""),
|
TOPIC_PRESETS_TEMPLATES_FILE: Final[Path] = TEMPLATE_ROOT / "topic_presets.json"
|
||||||
TEMPLATE_ROOT / "agent_md_templates.json",
|
|
||||||
)
|
|
||||||
TOPIC_PRESETS_TEMPLATES_FILE: Final[Path] = _normalize_file_path(
|
|
||||||
os.getenv("TOPIC_PRESETS_TEMPLATES_FILE", ""),
|
|
||||||
TEMPLATE_ROOT / "topic_presets.json",
|
|
||||||
)
|
|
||||||
|
|
||||||
_agent_md_templates_raw = _load_json_object(AGENT_MD_TEMPLATES_FILE)
|
_agent_md_templates_raw = _load_json_object(AGENT_MD_TEMPLATES_FILE)
|
||||||
DEFAULT_AGENTS_MD: Final[str] = _env_text(
|
DEFAULT_AGENTS_MD: Final[str] = _env_text(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue