From 23ea08f981b68769270691951a7c6d90b8d62901 Mon Sep 17 00:00:00 2001 From: hotyue <52734432+hotyue@users.noreply.github.com> Date: Thu, 23 Apr 2026 13:17:36 +0000 Subject: [PATCH] =?UTF-8?q?feat(agent):=20Webhook=20=E8=BF=BD=E5=8A=A0=20/?= =?UTF-8?q?trigger=5Fquality=20=E8=B7=AF=E7=94=B1=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=BC=82=E6=AD=A5=E6=8B=89=E8=B5=B7=E6=B7=B1=E6=B5=B7?= =?UTF-8?q?=E5=A3=B0=E5=91=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/agent_daemon.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/agent_daemon.sh b/core/agent_daemon.sh index e623cb01..8c5e7bfa 100755 --- a/core/agent_daemon.sh +++ b/core/agent_daemon.sh @@ -242,6 +242,20 @@ class AgentHandler(http.server.BaseHTTPRequestHandler): except Exception as e: print(f"Log transmission failed: {e}") + # ================== [v4.0.0 新增: 触发深海声呐] ================== + elif req_path == '/trigger_quality': + self.send_response(200) + self.send_header("Content-type", "text/plain") + self.end_headers() + self.wfile.write(b"Action Accepted: trigger_quality\n") + + script_path = '/opt/ip_sentinel/core/mod_quality.sh' + if os.path.exists(script_path): + # 使用 Popen 且丢弃输入输出,实现绝对的异步脱离,不阻塞 Webhook 主线程 + subprocess.Popen(['bash', script_path], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + # ================================================================= + + # 路由 5: 节点重命名展示别名同步接口 (Base64 终极防御版) elif req_path == '/trigger_rename': b64_alias = query.get('b64', [''])[0]