fix: chmod ais snapshot 644 — mkstemp's 0600 made nginx 403 it

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
type-two 2026-07-30 11:31:12 +10:00
parent e4af0fb01d
commit 59775718f3

View File

@ -113,6 +113,7 @@ def writer(out_path):
with os.fdopen(fd, "w") as f:
f.write(body)
os.replace(tmp, out_path) # atomic — readers never see a torn file
os.chmod(out_path, 0o644) # mkstemp births 0600 — nginx (other uid) must read it
with open(os.path.join(jobs, "godsigh-ais.status"), "w") as f:
f.write(json.dumps({"ts": int(now), "ships": len(rows), "msgs": stats["msgs"]}))
print(f"[ais] {len(rows)} ships · {stats['msgs']} msgs", flush=True)