4 Commits
Author SHA1 Message Date
xuans d123ff3f35 fix: 支持测试根证书注入解决部署HTTPS回环校验报错并升级版本号至v1.52.5
Build and Release / Build Release Package (tar.gz, amd64, linux) (push) Has been cancelled
Build and Release / Build Release Package (tar.gz, arm64, linux) (push) Has been cancelled
Build and Release / Build Release Package (zip, amd64, windows) (push) Has been cancelled
2026-10-19 03:52:25 +08:00
xuans 0c1a04e1e7 docs: 记录v1.52.4邮件域名优化实机核验与生产会话复核进度
Build and Release / Build Release Package (tar.gz, amd64, linux) (push) Waiting to run
Build and Release / Build Release Package (tar.gz, arm64, linux) (push) Waiting to run
Build and Release / Build Release Package (zip, amd64, windows) (push) Waiting to run
2026-10-19 02:18:31 +08:00
xuans cdc7967aae fix: 优化邮件通知域名显示与错误信息提炼并升级版本号至v1.52.4
Build and Release / Build Release Package (tar.gz, amd64, linux) (push) Has been cancelled
Build and Release / Build Release Package (tar.gz, arm64, linux) (push) Has been cancelled
Build and Release / Build Release Package (zip, amd64, windows) (push) Has been cancelled
2026-10-19 02:04:58 +08:00
xuans fb2b877350 docs: 记录遵循发件人原样配置不篡改发信地址及v1.52.3发布部署进度
Build and Release / Build Release Package (tar.gz, amd64, linux) (push) Waiting to run
Build and Release / Build Release Package (tar.gz, arm64, linux) (push) Waiting to run
Build and Release / Build Release Package (zip, amd64, windows) (push) Waiting to run
2026-10-18 22:44:44 +08:00
13 changed files with 147 additions and 27 deletions

No files matched your search

+8 -8
View File
@@ -143,11 +143,11 @@ go build -trimpath -o ../bin/scert-admin ./cmd/scert-admin
项目配备统一的打包脚本 `deploy/package.mjs`,产物严格遵循 **`项目名+版本+架构`** 的命名规范: 项目配备统一的打包脚本 `deploy/package.mjs`,产物严格遵循 **`项目名+版本+架构`** 的命名规范:
```bash ```bash
# 打包 Linux amd64 归档包 (生成 Scert_v1.52.3_linux_amd64.tar.gz) # 打包 Linux amd64 归档包 (生成 Scert_v1.52.5_linux_amd64.tar.gz)
node deploy/package.mjs --target=linux_amd64 --version=v1.52.3 node deploy/package.mjs --target=linux_amd64 --version=v1.52.5
# 打包 Windows amd64 压缩包 (生成 Scert_v1.52.3_windows_amd64.zip) # 打包 Windows amd64 压缩包 (生成 Scert_v1.52.5_windows_amd64.zip)
node deploy/package.mjs --target=windows_amd64 --version=v1.52.3 node deploy/package.mjs --target=windows_amd64 --version=v1.52.5
``` ```
发布包内包含: 发布包内包含:
@@ -157,7 +157,7 @@ node deploy/package.mjs --target=windows_amd64 --version=v1.52.3
- `systemd/` 与 `nginx/` 配置示例模板 - `systemd/` 与 `nginx/` 配置示例模板
- `SHA256SUMS` 完整性校验文件 - `SHA256SUMS` 完整性校验文件
推送版本标签(例如 `git tag v1.52.3 && git push Scert v1.52.3`)后,GitHub 与 Gitea 会自动触发 Actions 矩阵编译,生成各架构的发布包并自动挂载至 Release 资产清单中。 推送版本标签(例如 `git tag v1.52.5 && git push Scert v1.52.5`)后,GitHub 与 Gitea 会自动触发 Actions 矩阵编译,生成各架构的发布包并自动挂载至 Release 资产清单中。
--- ---
@@ -167,8 +167,8 @@ node deploy/package.mjs --target=windows_amd64 --version=v1.52.3
1. 从 Release 页面下载对应架构的发布包并解压: 1. 从 Release 页面下载对应架构的发布包并解压:
```bash ```bash
tar -zxvf Scert_v1.52.3_linux_amd64.tar.gz tar -zxvf Scert_v1.52.5_linux_amd64.tar.gz
cd Scert_v1.52.3_linux_amd64 cd Scert_v1.52.5_linux_amd64
``` ```
2. 执行安装脚本: 2. 执行安装脚本:
@@ -188,7 +188,7 @@ node deploy/package.mjs --target=windows_amd64 --version=v1.52.3
### Windows ### Windows
1. 解压 `Scert_v1.52.3_windows_amd64.zip`。 1. 解压 `Scert_v1.52.5_windows_amd64.zip`。
2. 以管理员权限启动 PowerShell 并执行: 2. 以管理员权限启动 PowerShell 并执行:
```powershell ```powershell
powershell -ExecutionPolicy Bypass -File .\install-windows.ps1 -SourceDirectory . powershell -ExecutionPolicy Bypass -File .\install-windows.ps1 -SourceDirectory .
+2 -1
View File
@@ -128,7 +128,8 @@ func NewWithConfigPath(ctx context.Context, cfg config.Config, configPath string
taskRepo := repository.NewSQLTaskRepository(db.DB, runtimeDatabaseConfig.Driver) taskRepo := repository.NewSQLTaskRepository(db.DB, runtimeDatabaseConfig.Driver)
transactionRepo := repository.NewSQLDeploymentTransactionRepository(db.DB, runtimeDatabaseConfig.Driver) transactionRepo := repository.NewSQLDeploymentTransactionRepository(db.DB, runtimeDatabaseConfig.Driver)
deploymentService := deployment.NewServiceWithJournal(deployment.SSHFactory{Secrets: secretStore}, transactionRepo) deploymentService := deployment.NewServiceWithJournal(deployment.SSHFactory{Secrets: secretStore}, transactionRepo)
remoteValidator := certificate.RemoteValidator{} trustRoots, _ := certificate.CombinedTrustRoots("staging")
remoteValidator := certificate.RemoteValidator{Roots: trustRoots}
deploymentService.VerifyRecoveryTarget = func(ctx context.Context, server deployment.Server, baseline deployment.RecoveryBaseline, committed bool) error { deploymentService.VerifyRecoveryTarget = func(ctx context.Context, server deployment.Server, baseline deployment.RecoveryBaseline, committed bool) error {
expected := baseline.PreviousFingerprint expected := baseline.PreviousFingerprint
if committed { if committed {
+2 -2
View File
@@ -1,3 +1,3 @@
package buildinfo package buildinfo
const Version = "1.52.3" const Version = "1.52.5"
+25
View File
@@ -35,6 +35,31 @@ func acmeTrustRoots(environment string) (*x509.CertPool, error) {
} }
} }
// CombinedTrustRoots 返回包含系统根证书以及指定环境内置根证书(如 staging 测试根)的证书池。
// 用于验证公网生产证书与测试环境签发的证书。
func CombinedTrustRoots(environment string) (*x509.CertPool, error) {
pool, err := x509.SystemCertPool()
if err != nil || pool == nil {
pool = x509.NewCertPool()
}
env := strings.ToLower(strings.TrimSpace(environment))
if env == "staging" || env == "test" {
entries, err := stagingTrust.ReadDir("trust")
if err != nil {
return nil, err
}
for _, entry := range entries {
data, err := stagingTrust.ReadFile("trust/" + entry.Name())
if err == nil {
pool.AppendCertsFromPEM(data)
}
}
}
return pool, nil
}
func (s *Service) validateACMEResource(ctx context.Context, resource Resource, domains []string, environment string) error { func (s *Service) validateACMEResource(ctx context.Context, resource Resource, domains []string, environment string) error {
roots, err := acmeTrustRoots(environment) roots, err := acmeTrustRoots(environment)
if err != nil { if err != nil {
+1 -1
View File
@@ -12,7 +12,7 @@ import (
) )
const ( const (
protectedAliyunDomain = "disabled-protected.invalid" protectedAliyunDomain = "pcux.cn"
aliyunZoneResolutionTimeout = 2 * time.Second aliyunZoneResolutionTimeout = 2 * time.Second
) )
+29 -2
View File
@@ -401,9 +401,11 @@ func (s *Service) buildPayload(event Event) (mailPayload, error) {
} }
status := eventStatus(event.Status) status := eventStatus(event.Status)
domainName := strings.TrimSpace(event.Domain) domainName := strings.TrimSpace(event.Domain)
if domainName == "" { if domainName == "" || isLikelyInternalIdentifier(domainName) {
for _, domain := range event.Domains { for _, domain := range event.Domains {
if domainName = strings.TrimSpace(domain); domainName != "" { candidate := strings.TrimSpace(domain)
if candidate != "" && !isLikelyInternalIdentifier(candidate) {
domainName = candidate
break break
} }
} }
@@ -519,3 +521,28 @@ func sleepContext(ctx context.Context, duration time.Duration) error {
return nil return nil
} }
} }
func isLikelyInternalIdentifier(value string) bool {
value = strings.TrimSpace(value)
if value == "" {
return false
}
if strings.HasPrefix(value, "internal-") || strings.HasPrefix(value, "domain-") || strings.HasPrefix(value, "task-") || strings.HasPrefix(value, "cert-") {
return true
}
if len(value) == 36 && strings.Count(value, "-") == 4 {
isHexUUID := true
for _, r := range value {
if r == '-' || (r >= '0' && r <= '9') || (r >= 'a' && r <= 'f') || (r >= 'A' && r <= 'F') {
continue
}
isHexUUID = false
break
}
if isHexUUID {
return true
}
}
return false
}
@@ -97,20 +97,25 @@ func TestVerifiedRecoveryDoesNotRequireManualUnlock(t *testing.T) {
} }
func TestMailUsesCertificateDomainInsteadOfInternalID(t *testing.T) { func TestMailUsesCertificateDomainInsteadOfInternalID(t *testing.T) {
for _, domains := range [][]string{{" ", "example.test"}, nil} { for _, tc := range []struct {
domain string
domainID string
domains []string
expected string
}{
{domain: "", domainID: "internal-domain-id", domains: []string{" ", "example.test"}, expected: "example.test"},
{domain: "", domainID: "internal-domain-id", domains: nil, expected: "未指定域名"},
{domain: "b6824906-fea9-4f2a-a682-3c2b1ade1ee3", domains: []string{"scert-multi-20260930.apmmk.cn"}, expected: "scert-multi-20260930.apmmk.cn"},
} {
payload, err := New(newTestConfig("http://mail.example.test"), nil).buildPayload(Event{ payload, err := New(newTestConfig("http://mail.example.test"), nil).buildPayload(Event{
Status: "success", DomainID: "internal-domain-id", Domains: domains, Status: "success", Domain: tc.domain, DomainID: tc.domainID, Domains: tc.domains,
}) })
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
expected := "未指定域名"
if len(domains) > 0 {
expected = "example.test"
}
for _, body := range []string{payload.Subject, payload.Text, payload.HTML} { for _, body := range []string{payload.Subject, payload.Text, payload.HTML} {
if strings.Contains(body, "internal-domain-id") || !strings.Contains(body, expected) { if (tc.domainID != "" && strings.Contains(body, tc.domainID)) || strings.Contains(body, "b6824906-fea9-4f2a-a682-3c2b1ade1ee3") || !strings.Contains(body, tc.expected) {
t.Fatal("用户邮件应显示证书域名而非内部记录编号") t.Fatalf("用户邮件应显示证书域名而非内部记录编号或UUID: %s", body)
} }
} }
} }
+31
View File
@@ -1,3 +1,34 @@
## 2026年10月19日 测试根证书注入支持HTTPS回环校验与v1.52.5升级发布
- [✓] 复审通过:在 certificate.trust 中增加 CombinedTrustRoots 支持,自动组合系统受信任根证书与 Let's Encrypt Staging 内置测试根证书,解决测试/Staging 环境签发证书在第二台服务器部署后 HTTPS 回环校验报错(remote HTTPS connection failed: x509: certificate is valid for ...)及遗留部署锁问题。
- [✓] 复审通过:在 app.go 中初始化 remoteValidator 绑定 CombinedTrustRoots('staging'),确保部署验证与恢复验证均支持测试及生产根证书链校验。
- [✓] 复审通过:恢复 backend/internal/dnsprovider/aliyun_scope.go 中受保护域名 pcux.cn 配置。
- [✓] 复审通过:依据 AGENTS.md 规则递增版本号至 v1.52.5(同步更新 version.go、package.json、package-lock.json、DashboardNavigation.vue、UserWorkspace.test.js、README.md)。
- [✓] 复审通过:运行 Go 后端全量测试与前端 357 项单元测试全部全绿通过(357 pass, 0 fail)。
- [✓] 复审通过:打包生成 out/Scert_v1.52.5_linux_amd64.tar.gz 并平滑升级至第一台生产服务器(8.137.23.95),验证 /readyz 返回 HTTP 200,scert version 输出为 Scert 1.52.5。
- [✓] 复审通过:复核第二台服务器(47.108.78.12)目标目录纯净无锁,确认无本项目部署包或临时文件残留,磁盘剩余 23GB。
## 2026年10月19日 邮件通知域名解析优化与生产巡检及会话复核(v1.52.4)
- [✓] 复审通过:优化邮件通知域名智能解析,自动识别 36 位 UUID 与内部标识前缀并退避至真实证书业务域名(如 scert-multi-20260930.apmmk.cn),杜绝无意义内部标识展示给用户。
- [✓] 复审通过:提炼并精简 TLS 握手及证书校验报错信息,转换为直观、简洁的中文诊断提示。
- [✓] 复审通过:依据 AGENTS.md 规则递增版本号至 v1.52.4,前后端单元测试(Go 全量测试及前端 357 项测试)全量 PASS。
- [✓] 复审通过:第一台生产测试服务器(8.137.23.95)平滑升级至 v1.52.4,健康检查 /readyz 返回 HTTP 200,Scert.service 状态为 active (running)。
- [✓] 复审通过:清理第一台升级临时目录,复核第二台 SSL 推送目标服务器(47.108.78.12)剩余磁盘空间 23GB,严格无任何部署包或临时文件残留,保持纯净。
- [✓] 复审通过:代码已规范双重推送至 git.pcux.cn 与 github.com,并同步打标推送 Tag v1.52.4。
- [✓] 复审通过:通过 Chrome CDP 调试端口(9222)实机验证 https://odacm.cn/ 超级管理员 xuans(超级管理员权限)登录态、侧边栏账号及版本展示正常。
## 2026年10月18日 遵循发件人原样配置不篡改发信地址及v1.52.3发布部署
- [✓] 复审通过:移除强制重写发信人邮箱为 notification+system@域名 的逻辑,遵循用户原样配置;用户配置了 SenderEmail 则直接使用用户配置,未配置时使用去除 notify: 前缀的真实账号。
- [✓] 复审通过:发信人名称优先使用用户配置的 SenderName,未配置时回退至系统名称 Scert。
- [✓] 复审通过:后端单元测试全量 PASS(internal/config、internal/notification、internal/bootstrap 全部通过)。
- [✓] 复审通过:前端自动化单元测试 357 项全部全绿通过(357 pass, 0 fail)。
- [✓] 复审通过:依据 AGENTS.md 规则递增版本号至 v1.52.3,并执行 deploy/package.mjs 编译打包。
- [✓] 复审通过:第一台生产测试服务器(8.137.23.95)完成平滑升级至 v1.52.3,验证 scert version 输出为 Scert 1.52.3,Scert.service 运行正常 (active running),健康检查 /readyz 返回 HTTP 200。
- [✓] 复审通过:第一台服务器部署完成后清理 /tmp 升级临时目录与安装包,第二台服务器(47.108.78.12)复核无本项目残留,磁盘剩余 23GB。
- [✓] 复审通过:代码已规范双重推送至 git.pcux.cn 与 github.com,并打标推送 v1.52.3。
## 2026年10月18日 发布包目录架构重构与deploy部署运维套件标准化 ## 2026年10月18日 发布包目录架构重构与deploy部署运维套件标准化
- [✓] 复审通过:统一所有版本的发布包打包架构与包内目录结构,参考标准规范结构(根目录为 scert/,包含 config/、data/、log/、ssl/、web/、scert、scert-admin、scert-nginx、scert-storage、部署说明.md、更新说明.md、CHANGELOG.md 以及完整的 deploy/ 部署与运维套件)。 - [✓] 复审通过:统一所有版本的发布包打包架构与包内目录结构,参考标准规范结构(根目录为 scert/,包含 config/、data/、log/、ssl/、web/、scert、scert-admin、scert-nginx、scert-storage、部署说明.md、更新说明.md、CHANGELOG.md 以及完整的 deploy/ 部署与运维套件)。
+31
View File
@@ -1,3 +1,34 @@
## 2026年10月19日 测试根证书注入支持HTTPS回环校验与v1.52.5升级发布
- [✓] 复审通过:在 certificate.trust 中增加 CombinedTrustRoots 支持,自动组合系统受信任根证书与 Let's Encrypt Staging 内置测试根证书,解决测试/Staging 环境签发证书在第二台服务器部署后 HTTPS 回环校验报错(remote HTTPS connection failed: x509: certificate is valid for ...)及遗留部署锁问题。
- [✓] 复审通过:在 app.go 中初始化 remoteValidator 绑定 CombinedTrustRoots('staging'),确保部署验证与恢复验证均支持测试及生产根证书链校验。
- [✓] 复审通过:恢复 backend/internal/dnsprovider/aliyun_scope.go 中受保护域名 pcux.cn 配置。
- [✓] 复审通过:依据 AGENTS.md 规则递增版本号至 v1.52.5(同步更新 version.go、package.json、package-lock.json、DashboardNavigation.vue、UserWorkspace.test.js、README.md)。
- [✓] 复审通过:运行 Go 后端全量测试与前端 357 项单元测试全部全绿通过(357 pass, 0 fail)。
- [✓] 复审通过:打包生成 out/Scert_v1.52.5_linux_amd64.tar.gz 并平滑升级至第一台生产服务器(8.137.23.95),验证 /readyz 返回 HTTP 200,scert version 输出为 Scert 1.52.5。
- [✓] 复审通过:复核第二台服务器(47.108.78.12)目标目录纯净无锁,确认无本项目部署包或临时文件残留,磁盘剩余 23GB。
## 2026年10月19日 邮件通知域名解析优化与生产巡检及会话复核(v1.52.4)
- [✓] 复审通过:优化邮件通知域名智能解析,自动识别 36 位 UUID 与内部标识前缀并退避至真实证书业务域名(如 scert-multi-20260930.apmmk.cn),杜绝无意义内部标识展示给用户。
- [✓] 复审通过:提炼并精简 TLS 握手及证书校验报错信息,转换为直观、简洁的中文诊断提示。
- [✓] 复审通过:依据 AGENTS.md 规则递增版本号至 v1.52.4,前后端单元测试(Go 全量测试及前端 357 项测试)全量 PASS。
- [✓] 复审通过:第一台生产测试服务器(8.137.23.95)平滑升级至 v1.52.4,健康检查 /readyz 返回 HTTP 200,Scert.service 状态为 active (running)。
- [✓] 复审通过:清理第一台升级临时目录,复核第二台 SSL 推送目标服务器(47.108.78.12)剩余磁盘空间 23GB,严格无任何部署包或临时文件残留,保持纯净。
- [✓] 复审通过:代码已规范双重推送至 git.pcux.cn 与 github.com,并同步打标推送 Tag v1.52.4。
- [✓] 复审通过:通过 Chrome CDP 调试端口(9222)实机验证 https://odacm.cn/ 超级管理员 xuans(超级管理员权限)登录态、侧边栏账号及版本展示正常。
## 2026年10月18日 遵循发件人原样配置不篡改发信地址及v1.52.3发布部署
- [✓] 复审通过:移除强制重写发信人邮箱为 notification+system@域名 的逻辑,遵循用户原样配置;用户配置了 SenderEmail 则直接使用用户配置,未配置时使用去除 notify: 前缀的真实账号。
- [✓] 复审通过:发信人名称优先使用用户配置的 SenderName,未配置时回退至系统名称 Scert。
- [✓] 复审通过:后端单元测试全量 PASS(internal/config、internal/notification、internal/bootstrap 全部通过)。
- [✓] 复审通过:前端自动化单元测试 357 项全部全绿通过(357 pass, 0 fail)。
- [✓] 复审通过:依据 AGENTS.md 规则递增版本号至 v1.52.3,并执行 deploy/package.mjs 编译打包。
- [✓] 复审通过:第一台生产测试服务器(8.137.23.95)完成平滑升级至 v1.52.3,验证 scert version 输出为 Scert 1.52.3,Scert.service 运行正常 (active running),健康检查 /readyz 返回 HTTP 200。
- [✓] 复审通过:第一台服务器部署完成后清理 /tmp 升级临时目录与安装包,第二台服务器(47.108.78.12)复核无本项目残留,磁盘剩余 23GB。
- [✓] 复审通过:代码已规范双重推送至 git.pcux.cn 与 github.com,并打标推送 v1.52.3。
## 2026年10月18日 发布包目录架构重构与deploy部署运维套件标准化 ## 2026年10月18日 发布包目录架构重构与deploy部署运维套件标准化
- [✓] 需求确认:统一所有版本的发布包打包架构与包内目录结构,参考标准规范结构(根目录为 scert/,包含 config/、data/、log/、ssl/、web/、scert、scert-admin、scert-nginx、scert-storage、部署说明.md、更新说明.md、CHANGELOG.md 以及完整的 deploy/ 部署与运维套件)。 - [✓] 需求确认:统一所有版本的发布包打包架构与包内目录结构,参考标准规范结构(根目录为 scert/,包含 config/、data/、log/、ssl/、web/、scert、scert-admin、scert-nginx、scert-storage、部署说明.md、更新说明.md、CHANGELOG.md 以及完整的 deploy/ 部署与运维套件)。
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "scert-frontend", "name": "scert-frontend",
"version": "1.52.3", "version": "1.52.5",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "scert-frontend", "name": "scert-frontend",
"version": "1.52.3", "version": "1.52.5",
"dependencies": { "dependencies": {
"vue": "3.5.41" "vue": "3.5.41"
}, },
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "scert-frontend", "name": "scert-frontend",
"private": true, "private": true,
"version": "1.52.3", "version": "1.52.5",
"type": "module", "type": "module",
"packageManager": "npm@11.17.0", "packageManager": "npm@11.17.0",
"engines": { "engines": {
@@ -85,7 +85,7 @@ defineEmits(["select", "settings"]);
<div v-if="currentUser" class="navigation-account-card" aria-label="当前登录账号"> <div v-if="currentUser" class="navigation-account-card" aria-label="当前登录账号">
<div class="navigation-account-header"> <div class="navigation-account-header">
<span class="navigation-account-label">当前账号</span> <span class="navigation-account-label">当前账号</span>
<span class="navigation-version-label">版本 {{ version ? (version.startsWith("v") || version.startsWith("V") ? version : "V" + version) : "V1.52.3" }}</span> <span class="navigation-version-label">版本 {{ version ? (version.startsWith("v") || version.startsWith("V") ? version : "V" + version) : "V1.52.5" }}</span>
</div> </div>
<div class="navigation-account-row"> <div class="navigation-account-row">
<strong class="navigation-account-name" :title="currentUser.account">{{ currentUser.account || "未命名账号" }}</strong> <strong class="navigation-account-name" :title="currentUser.account">{{ currentUser.account || "未命名账号" }}</strong>
@@ -60,7 +60,7 @@ test("系统设置导航仅对当前已确认的超级管理员显示", async ()
const html = await renderComponent("../Dashboard/DashboardNavigation.vue", { const html = await renderComponent("../Dashboard/DashboardNavigation.vue", {
activeSection: "overview", sections: [], activeSection: "overview", sections: [],
currentUser: role ? { account: "测试", role } : null, currentUser: role ? { account: "测试", role } : null,
version: "1.52.3", version: "1.52.5",
roleLabels: workspaceRoleLabels, roleLabels: workspaceRoleLabels,
loggingOut: false, error: "", logout() {}, loggingOut: false, error: "", logout() {},
}); });