From a24a5331658f257c5a5748bec0f49cf1359e3cc3 Mon Sep 17 00:00:00 2001 From: hotyue <52734432+hotyue@users.noreply.github.com> Date: Thu, 23 Apr 2026 13:40:12 +0000 Subject: [PATCH] =?UTF-8?q?fix(agent):=20=E4=BF=AE=E5=A4=8D=20webhook=20?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=20Python=20=E4=B8=A5=E6=A0=BC=E7=BC=A9?= =?UTF-8?q?=E8=BF=9B=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E7=9A=84=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B=E5=B4=A9=E6=BA=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/agent_daemon.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/core/agent_daemon.sh b/core/agent_daemon.sh index a4abeaf..30e9553 100755 --- a/core/agent_daemon.sh +++ b/core/agent_daemon.sh @@ -242,18 +242,18 @@ 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) - # ================================================================= + # ================== [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 终极防御版)