Skip to content

Commit

Permalink
Move data directory creation to thunorctl.py
Browse files Browse the repository at this point in the history
Data directories for plate-files and downloads were previously
created in settings.py from within the container, but this can
lead to incorrect permissions on the host. Add directory
creation to thunorctl.py on the host and explicitly chmod
to ensure directories are writable. Keep in settings.py
for dev mode/startup check.
  • Loading branch information
alubbock committed Feb 5, 2023
1 parent 325c6e0 commit 557c396
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions thunorctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,14 @@ def deploy(self):

self._mkdir('_state/postgres-data')

# Make data directories
self._mkdir('_state/thunor-files/plate-files')
self._mkdir('_state/thunor-files/downloads')
# Ensure directories are writable by container
if os.name == 'posix':
os.chmod('_state/thunor-files/plate-files', 0o777)
os.chmod('_state/thunor-files/downloads', 0o777)

self._log.debug('Set DJANGO_HOSTNAME in thunor-app.env to {}'.format(
self.args.hostname))

Expand Down

0 comments on commit 557c396

Please sign in to comment.