refactor(daemon): 动态注入节点防撞身份与运行时版本号至 UA 请求头及交互播报中

This commit is contained in:
hotyue
2026-04-15 03:57:02 +00:00
parent 43f2e98459
commit 9aef79831c
2 changed files with 13 additions and 7 deletions
+3 -2
View File
@@ -1,7 +1,7 @@
#!/bin/bash
# ==========================================================
# 脚本名称: agent_daemon.sh (受控节点 Webhook 守护进程 v3.4.0 版本锚点版)
# 脚本名称: agent_daemon.sh (受控节点 Webhook 守护进程 - 动态锚点版)
# 核心功能: 智能防打扰注册、进程自检、模块级路由分发(403拦截)
# ==========================================================
@@ -223,7 +223,8 @@ class AgentHandler(http.server.BaseHTTPRequestHandler):
req = urllib.request.Request(
config.get('TG_API_URL', ''),
data=data,
headers={'User-Agent': 'IP-Sentinel-Agent/3.0.4'}
# [动态化] 彻底消灭硬编码,使用运行态版本号
headers={'User-Agent': f'IP-Sentinel-Agent/{local_ver}'}
)
urllib.request.urlopen(req, timeout=10)