OpenDataServices / cove

CoVE is an web application to Convert, Validate and Explore data following certain open data standards - including 360Giving, Open Contracting Data Standard, IATI and the Beneficial Ownership Data Standard
http://cove.opendataservices.coop
Other
43 stars 11 forks source link

Media File Permissions #1098

Open odscjames opened 5 years ago

odscjames commented 5 years ago

This is a follow up from #1095

1095 was fixed by a temporary server fix of adding:

FILE_UPLOAD_PERMISSIONS = 0o644

by hand. This issue is to sort this out properly.

We could add that to every cove*.setting ...... however it only covers the initially uploaded file, not any other files.

However, I added two things to our salt scripts to hopefully make sure new media files are correct in the future - https://github.com/OpenDataServices/opendataservices-deploy/commit/8f8032674f4d2c9d8e9e12f7038922835355ca6a - and to fix any existing problems - https://github.com/OpenDataServices/opendataservices-deploy/commit/e21877ca12fd562954040ebe662da8eb5f0ea117

This might be enough - maybe we don't need FILE_UPLOAD_PERMISSIONS ? James and David to discuss.

odscjames commented 5 years ago

Yes, if we try and upload a large file (17MB test file) we still get this problem. So we do need to set FILE_UPLOAD_PERMISSIONS

odscjames commented 5 years ago

https://docs.djangoproject.com/en/2.1/ref/settings/#file-upload-max-memory-size is relevant - larger than 2.5mb gets written to tmp (it seems) then copied, and thus get different file permissions.