matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.83k stars 2.12k forks source link

Write signing keys with file mode 0640 #16740

Closed elara-leitstellentechnik closed 11 months ago

elara-leitstellentechnik commented 11 months ago

Fixes #1528. Fixes #6364.

Pull Request Checklist

elara-leitstellentechnik commented 11 months ago

Your suggestion doesn't work as the type of argparse.FileType is not a PathLike or similar, but just the opened file.

I therefore refactored the script a bit. This has the nice benefit, that the file is properly closed now as well (which I believe it wasn't before.