完善 readiness、发布追溯与敏感治理(07-15-production-trust-closeout-cleanup)
这个提交包含在:
@@ -11,6 +11,11 @@ function requiredEnv(name) {
|
||||
return value;
|
||||
}
|
||||
|
||||
function normalizeBuildSha(value) {
|
||||
const sha = String(value || "").trim().toLowerCase();
|
||||
return /^[0-9a-f]{7,64}$/.test(sha) ? sha.slice(0, 12) : "unknown";
|
||||
}
|
||||
|
||||
function getConfig() {
|
||||
const nodeEnv = process.env.NODE_ENV ?? "development";
|
||||
const serverRoot = path.resolve(__dirname, "..");
|
||||
@@ -21,6 +26,7 @@ function getConfig() {
|
||||
nodeEnv,
|
||||
port: Number(process.env.PORT ?? 3000),
|
||||
host: process.env.HOST ?? "0.0.0.0",
|
||||
buildSha: normalizeBuildSha(process.env.BUILD_SHA),
|
||||
|
||||
metricsEnabled: process.env.METRICS_ENABLED !== "false",
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户