diff --git a/rootfs/setup/app/prerun.py b/rootfs/setup/app/prerun.py index 21dc9b1..ab0c51e 100644 --- a/rootfs/setup/app/prerun.py +++ b/rootfs/setup/app/prerun.py @@ -3,6 +3,7 @@ import sys import subprocess import psycopg2 import urllib2 +import re ckan_ini = os.environ.get('CKAN_INI', '/srv/app/production.ini') @@ -85,7 +86,7 @@ def create_sysadmin(): command = ['paster', '--plugin=ckan', 'user', name, '-c', ckan_ini] out = subprocess.check_output(command) - if 'User: \nNone\n' not in out: + if 'User:None' not in re.sub(r'\s', '', out): print '[prerun] Sysadmin user exists, skipping creation' return diff --git a/rootfs/setup/app/start_ckan.sh b/rootfs/setup/app/start_ckan.sh index ef8f1d4..d0dc6e7 100755 --- a/rootfs/setup/app/start_ckan.sh +++ b/rootfs/setup/app/start_ckan.sh @@ -16,7 +16,7 @@ then fi # Set the common uwsgi options -UWSGI_OPTS="--plugins http,python,gevent --socket /tmp/uwsgi.sock --uid 92 --gid 92 --http :5000 --master --enable-threads --paste config:/srv/app/production.ini --lazy-apps --gevent 2000 -p 2 -L" +UWSGI_OPTS="--socket /tmp/uwsgi.sock --uid 92 --gid 92 --http :5000 --master --enable-threads --paste config:/srv/app/production.ini --lazy-apps --gevent 2000 -p 2 -L" # Check whether http basic auth password protection is enabled and enable basicauth routing on uwsgi respecfully if [ $? -eq 0 ]