fix: publish the directory page readable by the web server

This commit is contained in:
randogoth 2026-10-11 16:39:39 +03:00
parent 1cf6e30908
commit 92813ccbe3
2 changed files with 18 additions and 0 deletions

View file

@ -210,6 +210,10 @@ def write_directory(target: str, rows: list[sqlite3.Row]) -> list[str]:
)
temporary = destination.with_name("." + destination.name + ".tmp")
temporary.write_bytes(text)
# The web server reads this file straight off disk as another user, so
# it is made readable on purpose. The service runs with a private umask
# to keep the database to itself, and that would otherwise apply here.
temporary.chmod(0o644)
os.replace(temporary, destination)
warnings = [str(f) for f in result.warnings]