diff --git a/01-basic.sh b/01-basic.sh index 68cbc26..a80cbe4 100755 --- a/01-basic.sh +++ b/01-basic.sh @@ -149,7 +149,6 @@ fi systemctl restart postgresql - ##### # MariaDB ##### diff --git a/30-ckan.sh b/30-ckan.sh index d084442..15d4b22 100755 --- a/30-ckan.sh +++ b/30-ckan.sh @@ -91,10 +91,8 @@ cp ${SOURCE_DIR}/ckan/etc/uwsgi/apps-available/ckan.ini /etc/uwsgi/apps-availabl cp ${SOURCE_DIR}/ckan/etc/uwsgi/apps-available/ckan-datapusher.ini /etc/uwsgi/apps-available/ckan-datapusher.ini ln -s /etc/uwsgi/apps-available/ckan.ini /etc/uwsgi/apps-enabled/ckan.ini ln -s /etc/uwsgi/apps-available/ckan-datapusher.ini /etc/uwsgi/apps-enabled/ckan-datapusher.ini -cp ${SOURCE_DIR}/ckan/etc/nginx/apps-available/ckan /etc/nginx/apps-available/ckan -ln -s /etc/nginx/apps-available/ckan /etc/nginx/apps-enabled/ckan -cp ${SOURCE_DIR}/ckan/etc/nginx/sites-available/ckan-datapusher /etc/nginx/sites-available/ckan-datapusher -ln -s /etc/nginx/sites-available/ckan-datapusher /etc/nginx/sites-enabled/ckan-datapusher +cp ${SOURCE_DIR}/ckan/etc/nginx/sites-available/ckan /etc/nginx/sites-available/ckan +ln -s /etc/nginx/sites-available/ckan /etc/nginx/sites-enabled/ckan # Restart services systemctl restart uwsgi @@ -105,4 +103,4 @@ cp ${SOURCE_DIR}/ckan/srv/ckan/cron-pageviews.sh /srv/ckan/cron-pageviews.sh cp ${SOURCE_DIR}/ckan/etc/cron.d/ckan /etc/cron.d/ckan # Add portal application definition -${SOURCE_DIR}/basic/portal-app-manager.py ckan "/ckan/" "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}" +${SOURCE_DIR}/basic/portal-app-manager.py ckan "https://{host}:8003/" "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}" diff --git a/ckan/etc/ckan/ckan.ini b/ckan/etc/ckan/ckan.ini index ab7b742..19a07af 100644 --- a/ckan/etc/ckan/ckan.ini +++ b/ckan/etc/ckan/ckan.ini @@ -57,7 +57,6 @@ ckan.datastore.default_fts_index_method = gist ## Site Settings ckan.site_url = http://127.0.0.1 -ckan.root_path = /ckan/{{LANG}} #ckan.use_pylons_response_cleanup_middleware = true ## Authorization Settings diff --git a/ckan/etc/ckan/datapusher_settings.py b/ckan/etc/ckan/datapusher_settings.py index 4ab99c0..e7a44b8 100644 --- a/ckan/etc/ckan/datapusher_settings.py +++ b/ckan/etc/ckan/datapusher_settings.py @@ -11,7 +11,7 @@ NAME = 'datapusher' SQLALCHEMY_DATABASE_URI = 'sqlite:////var/lib/ckan/datapusher-jobs.db' HOST = '0.0.0.0' -PORT = 8003 +PORT = 8004 FROM_EMAIL = 'ckan@spotter.ngo' #ADMINS = ['yourname@example.com'] # where to send emails diff --git a/ckan/etc/nginx/apps-available/ckan b/ckan/etc/nginx/apps-available/ckan deleted file mode 100644 index 997c6df..0000000 --- a/ckan/etc/nginx/apps-available/ckan +++ /dev/null @@ -1,8 +0,0 @@ -location /ckan { - uwsgi_pass unix:///run/uwsgi/app/ckan/socket; - include uwsgi_params; - uwsgi_param SCRIPT_NAME /ckan; - - access_log /var/log/nginx/ckan.access.log; - error_log /var/log/nginx/ckan.error.log; -} diff --git a/ckan/etc/nginx/sites-available/ckan-datapusher b/ckan/etc/nginx/sites-available/ckan similarity index 50% rename from ckan/etc/nginx/sites-available/ckan-datapusher rename to ckan/etc/nginx/sites-available/ckan index f476d1f..b0c1567 100644 --- a/ckan/etc/nginx/sites-available/ckan-datapusher +++ b/ckan/etc/nginx/sites-available/ckan @@ -5,6 +5,21 @@ server { access_log /var/log/nginx/ckan.access.log; error_log /var/log/nginx/ckan.error.log; + location / { + uwsgi_pass unix:///run/uwsgi/app/ckan/socket; + include uwsgi_params; + uwsgi_param SCRIPT_NAME ''; + uwsgi_param UWSGI_SCHEME $scheme; + } +} + +server { + listen 8004 ssl http2; + listen [::]:8004 ssl http2; + + access_log /var/log/nginx/ckan.access.log; + error_log /var/log/nginx/ckan.error.log; + location / { uwsgi_pass unix:///run/uwsgi/app/ckan-datapusher/socket; include uwsgi_params; diff --git a/ckan/etc/uwsgi/apps-available/ckan.ini b/ckan/etc/uwsgi/apps-available/ckan.ini index ae1c6ac..0de8bbf 100644 --- a/ckan/etc/uwsgi/apps-available/ckan.ini +++ b/ckan/etc/uwsgi/apps-available/ckan.ini @@ -5,6 +5,5 @@ chown-socket = www-data:www-data chdir = /srv/ckan home = /srv/ckan exec-asap = /srv/ckan/update-ip.sh -route-run = fixpathinfo: disable-logging = true ini-paste = /etc/ckan/ckan.ini diff --git a/ckan/srv/ckan/update-ip.sh b/ckan/srv/ckan/update-ip.sh index 9cb82b4..e43d51b 100755 --- a/ckan/srv/ckan/update-ip.sh +++ b/ckan/srv/ckan/update-ip.sh @@ -1,5 +1,5 @@ #!/bin/sh IP=$(ip route get 1 | awk '{print $NF;exit}') -sed -i "s|^ckan\.site_url.*|ckan.site_url = https://${IP}|" /etc/ckan/ckan.ini -sed -i "s|^ckan\.datapusher\.url.*|ckan.datapusher.url = https://${IP}:8003|" /etc/ckan/ckan.ini +sed -i "s|^ckan\.site_url.*|ckan.site_url = https://${IP}:8003|" /etc/ckan/ckan.ini +sed -i "s|^ckan\.datapusher\.url.*|ckan.datapusher.url = https://${IP}:8004|" /etc/ckan/ckan.ini