fix: ensure updater outputs are world-readable
This commit is contained in:
@@ -14,6 +14,7 @@ def atomic_replace(src_path: str, dst_path: str) -> None:
|
|||||||
tmp = dst_path + ".tmp"
|
tmp = dst_path + ".tmp"
|
||||||
shutil.copyfile(src_path, tmp)
|
shutil.copyfile(src_path, tmp)
|
||||||
os.replace(tmp, dst_path)
|
os.replace(tmp, dst_path)
|
||||||
|
os.chmod(dst_path, 0o644)
|
||||||
|
|
||||||
def download_maxmind_mmdb() -> None:
|
def download_maxmind_mmdb() -> None:
|
||||||
if not LICENSE_KEY:
|
if not LICENSE_KEY:
|
||||||
@@ -86,6 +87,7 @@ def update_nren_asns() -> None:
|
|||||||
f.write(f"{a}\n")
|
f.write(f"{a}\n")
|
||||||
tmp_path = f.name
|
tmp_path = f.name
|
||||||
os.replace(tmp_path, out_txt)
|
os.replace(tmp_path, out_txt)
|
||||||
|
os.chmod(out_txt, 0o644)
|
||||||
|
|
||||||
def write_meta():
|
def write_meta():
|
||||||
meta = {
|
meta = {
|
||||||
@@ -95,6 +97,7 @@ def write_meta():
|
|||||||
}
|
}
|
||||||
with open(os.path.join(OUT_DIR, "metadata.json"), "w") as f:
|
with open(os.path.join(OUT_DIR, "metadata.json"), "w") as f:
|
||||||
json.dump(meta, f, indent=2)
|
json.dump(meta, f, indent=2)
|
||||||
|
os.chmod(os.path.join(OUT_DIR, "metadata.json"), 0o644)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
os.makedirs(OUT_DIR, exist_ok=True)
|
os.makedirs(OUT_DIR, exist_ok=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user