Hi all,
This has come up again. So proposal below.
Issue is that, with the default settings, you get 0o644 permissions for "small" files and 0o600 permissions for "big" ones.
(Depending on which upload handler is used.)
History:
* Claude and I discussed this a bit.
* We are agreed the inconsistent default isn't great.
* We noted just setting FILE_UPLOAD_PERMISSION solves this.
* Given FILE_UPLOAD_PERMISSION = None, Claude suggested a patch which would "guess" the permissions to use from the process umask.
* I didn't like this:
* too clever, and ultimately not our business.
* Would work for default settings but get in the way once you started using the related file upload settings. (And so would need an opt-out.)
* In the end we just added a note to the deployment checklist.
This wasn't good enough. (Clearly.)
Proposal: we should change the default for FILE_UPLOAD_PERMISSION to 0o644 (or maybe 0o664), and document that as a backward incompatible change. This would be correct for almost all users. If you're deliberately leveraging `FILE_UPLOAD_PERMISSION = None` it's an easy switch back to the current behaviour.
Can I ask you to comment? Thanks.
Kind Regards,
Carlton