Tighten credential modes, pid identity and repo hygiene

This commit is contained in:
gitea committed 2026-09-15 17:40:52 +08:00
1 parent 6b2e0f7463
commit c3ec09d0a0
9 files changed
+282 -163

No files matched your search

+3 -1
View File
@@ -66,7 +66,9 @@ function saveUsageStatsAtomic(stats: CorpUsageStats, targetPath: string = resolv
}
const tempPath = `${targetPath}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2, 8)}.tmp`;
try {
writeFileSync(tempPath, JSON.stringify(stats, null, 2), "utf-8");
// 0o600 like `seal_tokens.json`: usage rows name the enterprises this machine has been
// operating, so keep them owner-only instead of inheriting the 0o644 default.
writeFileSync(tempPath, JSON.stringify(stats, null, 2), { encoding: "utf-8", mode: 0o600 });
renameSync(tempPath, targetPath);
} catch (err) {
try {