fix: 发布一致性校验、日志轮转与构建脚本对齐
- 新增发布校验脚本(buildsh/lib/verify_release.py + release.sh),核对 tag/清单/资产 三者的 sha256 与体积,并复验清单签名;接入 ./build.sh release-verify 与 .gitea/workflows/release-verify.yml(手动触发) - GcLog 改为常驻 StreamWriter + 按天轮转 + 14 天/64MB 保留策略,避免高峰期反复 开关文件句柄;只清理本模块生成的 gc-*.log,不碰用户文件 - 修复 Applier 验签逻辑:无效签名永远拒绝,仅「未签名」在调用方不强制时放行 - 新增应用器测试(GC.Savedog.Tests):整目录替换、.GC/bin 合并、启动失败回滚、 路径穿越防护、验签;接入 pr-check.yml - GC.Tests 增加日志用例(写入/轮转/清理/用户文件保护) - 同步 PowerShell 打包脚本与 buildsh 一致:GCL 命名、单顶层目录、守护进程收进 .GC/bin、启动器与守护进程压缩单文件、不预置 .GC、prune/strip 对齐、签名 keyId 改为 gc-2026-12、新增 release-verify 与应用器测试任务
This commit is contained in:
1 parent
a5fcaeb658
commit
59a66c8fa8
15 files changed
+981
-93
No files matched your search
+10
-1
@@ -84,12 +84,21 @@ internal sealed class Applier
|
||||
var manifestText = File.Exists(manifestPath) ? File.ReadAllText(manifestPath) : null;
|
||||
var verification = ManifestSignature.Verify(manifestText, require);
|
||||
|
||||
if (verification.IsRejected)
|
||||
// 签名不对(被改过 / 密钥不认识)永远拒绝;仅「没有签名」在明确不强制时放行。
|
||||
// 之前这里不看 require:即使调用方声明 requireSignature=false(开发态、测试),
|
||||
// 未签名清单也会被当成验签失败直接拒掉。
|
||||
var hostile = verification.Trust == ManifestTrust.Invalid;
|
||||
if (hostile || (verification.IsRejected && require))
|
||||
{
|
||||
_log.Error($"清单验签失败({verification.Trust}):{verification.Error}",
|
||||
$"Manifest signature check failed ({verification.Trust}): {verification.Error}");
|
||||
return Refuse(updateDir, request, verification);
|
||||
}
|
||||
if (verification.IsRejected)
|
||||
{
|
||||
_log.Warn($"清单未签名,按调用方要求放行:{verification.Error}",
|
||||
$"Manifest is unsigned; continuing as requested: {verification.Error}");
|
||||
}
|
||||
_log.Info($"清单可信度:{verification.Trust}" +
|
||||
(verification.KeyId != null ? $"({verification.KeyId})" : ""),
|
||||
$"Manifest trust: {verification.Trust}" +
|
||||
|
||||
@@ -37,6 +37,11 @@
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- 应用器测试要直接构造 Applier(internal):只对测试程序集放开可见性 -->
|
||||
<InternalsVisibleTo Include="GC.Savedog.Tests" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- 与启动器共用同一份安全实现,避免两套逻辑各说各话。
|
||||
ManifestLoader 依赖启动器的 RepoVersion 模型,守护进程不需要,排除。 -->
|
||||
|
||||
Reference in new issue
Block a user