From 332765a72eccdbc4a31212efc10d16aa81af437b Mon Sep 17 00:00:00 2001 From: hotyue <52734432+hotyue@users.noreply.github.com> Date: Mon, 27 Apr 2026 02:28:41 +0000 Subject: [PATCH] =?UTF-8?q?fix(core):=20=E5=BC=BA=E5=88=B6=E6=89=80?= =?UTF-8?q?=E6=9C=89=E4=B8=9A=E5=8A=A1=E6=A8=A1=E5=9D=97=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=B8=8E=E7=8B=AC=E7=AB=8B=E6=88=98=E6=8A=A5=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=BB=9D=E5=AF=B9=20UTC=20=E6=97=B6=E9=97=B4=EF=BC=8C=E5=BD=BB?= =?UTF-8?q?=E5=BA=95=E6=A0=B9=E9=99=A4=E8=B7=A8=E6=97=B6=E5=8C=BA=E6=8E=92?= =?UTF-8?q?=E9=9A=9C=E6=97=B6=E7=9A=84=E6=97=B6=E9=97=B4=E7=BA=BF=E9=94=99?= =?UTF-8?q?=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/mod_google.sh | 3 ++- core/mod_quality.sh | 3 ++- core/mod_trust.sh | 3 ++- core/runner.sh | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/mod_google.sh b/core/mod_google.sh index efeec61..62a727b 100755 --- a/core/mod_google.sh +++ b/core/mod_google.sh @@ -27,7 +27,8 @@ if ! type log >/dev/null 2>&1; then # 日志格式注入 [版本号] 追踪标识 local core_msg=$(printf "[v%-5s] [%-5s] [%-7s] [%s] %s" "$local_ver" "$2" "$1" "$REGION_CODE" "$3") - echo "[$(date '+%Y-%m-%d %H:%M:%S')] $core_msg" >> "${INSTALL_DIR}/logs/sentinel.log" + # [时区对齐] 强制无视本地时区,以绝对 UTC 时间写入日志 + echo "[$(date -u '+%Y-%m-%d %H:%M:%S UTC')] $core_msg" >> "${INSTALL_DIR}/logs/sentinel.log" # 强制推送到 Systemd Journal (如果系统支持) if command -v logger >/dev/null 2>&1; then diff --git a/core/mod_quality.sh b/core/mod_quality.sh index 1cba784..3857f6f 100755 --- a/core/mod_quality.sh +++ b/core/mod_quality.sh @@ -190,7 +190,8 @@ fi # 7. 组装情报级 Markdown 战报 # 提取本地运行态版本与生成时间戳 LOCAL_VER="${AGENT_VERSION:-未知}" -CURRENT_TIME=$(date "+%Y-%m-%d %H:%M:%S") +# [时区对齐] 深海声呐战报落款强制采用绝对 UTC 时间 +CURRENT_TIME=$(date -u "+%Y-%m-%d %H:%M:%S UTC") # [体验修复] 探针返回的 IP 带有星号掩码,强制使用中枢下发的真实 IP 拼接,以防直达链接失效! LINK_IP=$(echo "$PUBLIC_IP" | tr -d '[]') diff --git a/core/mod_trust.sh b/core/mod_trust.sh index b7ea134..e414821 100755 --- a/core/mod_trust.sh +++ b/core/mod_trust.sh @@ -45,7 +45,8 @@ fi log_msg() { local TYPE=$1 local MSG=$2 - local TIME=$(date "+%Y-%m-%d %H:%M:%S") + # [时区对齐] 强制无视本地时区,以绝对 UTC 时间生成日志时间戳 + local TIME=$(date -u "+%Y-%m-%d %H:%M:%S UTC") # [v3.4.0 核心] 提取当前配置中的版本锚点 local local_ver="${AGENT_VERSION:-未知}" diff --git a/core/runner.sh b/core/runner.sh index 798958d..afdf4c9 100755 --- a/core/runner.sh +++ b/core/runner.sh @@ -36,7 +36,7 @@ log() { # 日志格式注入 [版本号] 追踪标识 local core_msg=$(printf "[v%-5s] [%-5s] [%-7s] [%s] %s" "$local_ver" "$level" "$module" "$REGION_CODE" "$msg") - echo "[$(date '+%Y-%m-%d %H:%M:%S')] $core_msg" >> "$LOG_FILE" + echo "[$(date -u '+%Y-%m-%d %H:%M:%S UTC')] $core_msg" >> "$LOG_FILE" # 强制推送到 Systemd Journal (如果系统支持) if command -v logger >/dev/null 2>&1; then