- 多进程看门狗: xmpp_watchdog.py (守护 bot + article_processor) - Tier 1 快速健康检查: agents_health_check.py (5min) - Tier 2 全面健康检查: agents_daily_health.py (每日08:00) - TODO 自修复执行器: self_todo_executor.py (10min) - 共享服务注册表: service_registry.py - xmpp_agent_core: /health 免认证 + /send 端点 - Dashboard: SSH检测修复 + kanban版块 + 路径跨平台兼容 - 修复kanban-api-reference.md误导内容 - 修复R02: frp隧道heartbeat保活
57 lines
2.1 KiB
Python
57 lines
2.1 KiB
Python
"""
|
|
service_registry.py — 共享服务注册表
|
|
所有监控组件(watchdog、Tier1、Tier2)统一从此文件读取服务定义。
|
|
新增服务只需在此添加一条记录,三处监控自动生效。
|
|
"""
|
|
import os
|
|
|
|
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
GATEWAY_DIR = os.path.dirname(SCRIPT_DIR)
|
|
BASE = os.path.dirname(GATEWAY_DIR)
|
|
TEMP = os.path.join(GATEWAY_DIR, "temp")
|
|
PYTHON = r"C:\Users\hmo\AppData\Local\Programs\Python\Python310\python.exe"
|
|
|
|
SERVICES = [
|
|
{
|
|
"name": "xmpp_bot",
|
|
"script": os.path.join(BASE, "xmpp_agent_core.py"),
|
|
"args": ["--agent", "xxm"],
|
|
"workdir": BASE,
|
|
"pid_file": os.path.join(TEMP, ".xmpp_bot.pid"),
|
|
"port": 5802,
|
|
"health_url": "http://127.0.0.1:5802/health",
|
|
"accept_401": False, # /health 现在返回 200(免认证)
|
|
"depends_on": [],
|
|
"log_files": lambda: [os.path.join(GATEWAY_DIR, "logs", "xmpp_bot.log"),
|
|
os.path.join(GATEWAY_DIR, "logs", "bridge.log")],
|
|
"description": "XMPP Bot (xxm@yoin.fun)",
|
|
},
|
|
{
|
|
"name": "article_processor",
|
|
"script": os.path.join(os.path.dirname(BASE), "self-growing-knowledge",
|
|
"scripts", "article_processor.py"),
|
|
"args": [],
|
|
"workdir": os.path.join(os.path.dirname(BASE), "self-growing-knowledge"),
|
|
"pid_file": os.path.join(TEMP, ".article_processor.pid"),
|
|
"port": 5810,
|
|
"health_url": "http://127.0.0.1:5810/health",
|
|
"accept_401": False,
|
|
"depends_on": [],
|
|
"log_files": lambda: [os.path.join(GATEWAY_DIR, "logs", "article_processor.log")],
|
|
"description": "微信文章全文抓取服务",
|
|
},
|
|
{
|
|
"name": "dashboard",
|
|
"script": os.path.join(SCRIPT_DIR, "dashboard.py"),
|
|
"args": [],
|
|
"workdir": SCRIPT_DIR,
|
|
"pid_file": None, # dashboard 管理自身进程
|
|
"port": 5803,
|
|
"health_url": "http://127.0.0.1:5803/api/health",
|
|
"accept_401": False,
|
|
"depends_on": ["xmpp_bot"],
|
|
"log_files": lambda: [],
|
|
"description": "AgentsMeeting 管理门户",
|
|
},
|
|
]
|