mirror of
https://github.com/hotyue/IP-Sentinel.git
synced 2026-09-05 07:28:14 +08:00
refactor(daemon): 动态注入节点防撞身份与运行时版本号至 UA 请求头及交互播报中
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user