Make the temp directories world-readable so that docker containers can access them regardless of which user created them

This commit is contained in:
Micah Lee 2021-06-10 14:41:26 -07:00
parent 429d1e3f08
commit a711ec1ded
No known key found for this signature in database
GPG key ID: 403C2657CD994F73

View file

@ -1,4 +1,5 @@
import os import os
import stat
import platform import platform
import tempfile import tempfile
@ -30,6 +31,20 @@ class Common(object):
prefix=os.path.join(cache_dir, "safe-") prefix=os.path.join(cache_dir, "safe-")
) )
# Make the folders world-readable to ensure that the container has permission
# to access it even if it's owned by root or someone else
permissions = (
stat.S_IRUSR
| stat.S_IWUSR
| stat.S_IXUSR
| stat.S_IRGRP
| stat.S_IXGRP
| stat.S_IROTH
| stat.S_IXOTH
)
os.chmod(self.pixel_dir.name, permissions)
os.chmod(self.safe_dir.name, permissions)
# Name of input and out files # Name of input and out files
self.document_filename = None self.document_filename = None
self.save_filename = None self.save_filename = None