From d643d6eb59c3198ecf1b5e86cd6879244fbcae11 Mon Sep 17 00:00:00 2001 From: amercader Date: Wed, 8 Aug 2018 15:09:45 +0200 Subject: [PATCH 1/3] Fix sysadmin creation on 2.8 Whitespace changes meant that the check to see if the sysadmin exists no longer works on CKAN 2.8. --- rootfs/setup/app/prerun.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 2e24eeae19ea1f3bc60d26aee44cbc606c9a7d4e Mon Sep 17 00:00:00 2001 From: Pance Ribarski Date: Fri, 10 Aug 2018 11:10:50 +0200 Subject: [PATCH 2/3] fix calling extra-scripts.sh --- rootfs/setup/app/start_ckan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/setup/app/start_ckan.sh b/rootfs/setup/app/start_ckan.sh index ca5799e..e9cae46 100755 --- a/rootfs/setup/app/start_ckan.sh +++ b/rootfs/setup/app/start_ckan.sh @@ -8,7 +8,7 @@ UWSGI_OPTS="--plugins http,python,gevent --socket /tmp/uwsgi.sock --uid 92 --gid # Check whether http basic auth password protection is enabled and enable basicauth routing on uwsgi respecfully if [ $? -eq 0 ] then - extra_scripts.sh + /bin/sh extra_scripts.sh if [ "$PASSWORD_PROTECT" = true ] then if [ "$HTPASSWD_USER" ] || [ "$HTPASSWD_PASSWORD" ] From 6bc2cae8d2afe587b1b294ac2cfd4359c86f5d75 Mon Sep 17 00:00:00 2001 From: amercader Date: Mon, 13 Aug 2018 15:23:47 +0200 Subject: [PATCH 3/3] Remove uWSGI --plugins options As we are now installing uwsgi via pip these plugins are shipped as part of the code and there's no need to load the plugin, otherwise you get these alarming (but harmless) messages: open("./http_plugin.so"): No such file or directory [core/utils.c line 3721] !!! UNABLE to load uWSGI plugin: Error loading shared library ./http_plugin.so: No such file or directory !!! open("./python_plugin.so"): No such file or directory [core/utils.c line 3721] !!! UNABLE to load uWSGI plugin: Error loading shared library ./python_plugin.so: No such file or directory !!! open("./gevent_plugin.so"): No such file or directory [core/utils.c line 3721] !!! UNABLE to load uWSGI plugin: Error loading shared library ./gevent_plugin.so: No such file or directory !!! --- rootfs/setup/app/start_ckan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/setup/app/start_ckan.sh b/rootfs/setup/app/start_ckan.sh index ca5799e..8f103c2 100755 --- a/rootfs/setup/app/start_ckan.sh +++ b/rootfs/setup/app/start_ckan.sh @@ -3,7 +3,7 @@ python prerun.py # 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 ]