okfn / docker-ckan

Docker images and Docker Compose setup for CKAN [Not Maintained]
GNU Affero General Public License v3.0
81 stars 91 forks source link

Run the prerun.py script as ckan user #46

Closed amercader closed 4 years ago

amercader commented 4 years ago

This avoids the storage folder (/var/lib/ckan/storage) being owned by root

This is an alternative to #42

amercader commented 4 years ago

@adborden thanks for flagging this I've pushed a new commit to run the prerun.py script as ckan in the dev image as well. I think it makes sense to run all the commands on the prerun.py script as the ckan user, as they are basically setting up CKAN, and every time we run a paster command the storage folder will be created if it doesn't exist (init-db just happened to be the first currently). I see your point about the production.ini being writable by the ckan user. This is not caused by the change on this PR, but by this command on the Dockerfile. I need to think about the implications of changing this so production.ini remains owned by root because then prerun.py won't be able to set the plugins in update_plugins() (I can't remember the specifics but there was a chicken and egg situation because of the usage of ckanext-envvars).