Adjust CKAN datapusher + datastore configuration, related to #148

This commit is contained in:
Disassembler 2017-11-28 19:33:36 +01:00
parent abcf84650d
commit a8e4dc63d3
6 changed files with 17 additions and 17 deletions

View File

@ -71,13 +71,10 @@ systemctl restart solr
# Configure CKAN
export CKAN_SECRET=$(head -c 18 /dev/urandom | base64)
export CKAN_UUID=$(uuidgen -r)
export CKAN_DSJOB_SECRET=$(uuidgen -r)
export CKAN_DSJOB_USER=$(uuidgen -r)
export CKAN_DSJOB_PWD=$(uuidgen -r)
mkdir /etc/ckan
envsubst <${SOURCE_DIR}/ckan/etc/ckan/ckan.ini >/etc/ckan/ckan.ini
envsubst <${SOURCE_DIR}/ckan/etc/ckan/datapusher_settings.py >/etc/ckan/datapusher_settings.py
cp ${SOURCE_DIR}/ckan/etc/ckan/datapusher.wsgi /etc/ckan/datapusher.wsgi
cp ${SOURCE_DIR}/ckan/etc/ckan/datapusher_settings.py /etc/ckan/datapusher_settings.py
ln -s /srv/ckan/src/ckan/ckan/config/who.ini /etc/ckan/who.ini
cp ${SOURCE_DIR}/ckan/srv/ckan/update-ip.sh /srv/ckan/update-ip.sh
/srv/ckan/update-ip.sh

View File

@ -169,7 +169,7 @@ ckan.max_image_size = 2
# Make sure you have set up the DataStore
ckan.datapusher.formats = csv xls xlsx tsv application/csv application/vnd.ms-excel application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
ckan.datapusher.url = http://127.0.0.1
ckan.datapusher.url = http://127.0.0.1:8098
#ckan.datapusher.assume_task_stale_after = 3600
# Resource Proxy settings

View File

@ -6,8 +6,9 @@ activate_this = os.path.join('/srv/ckan/bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
import ckanserviceprovider.web as web
import datapusher.jobs as jobs
os.environ['JOB_CONFIG'] = '/etc/ckan/datapusher_settings.py'
web.init()
import datapusher.jobs as jobs
application = web.app

View File

@ -1,17 +1,20 @@
#!/usr/bin/python
import uuid
DEBUG = False
TESTING = False
SSL_VERIFY = False
SECRET_KEY = '${CKAN_DSJOB_SECRET}'
USERNAME = '${CKAN_DSJOB_USER}'
PASSWORD = '${CKAN_DSJOB_PWD}'
SECRET_KEY = str(uuid.uuid4())
USERNAME = str(uuid.uuid4())
PASSWORD = str(uuid.uuid4())
NAME = 'datapusher'
SQLALCHEMY_DATABASE_URI = 'sqlite:////var/lib/ckan/datapusher-jobs.db'
HOST = '0.0.0.0'
PORT = 8004
PORT = 8098
SSL_VERIFY = False
FROM_EMAIL = 'ckan@spotter.ngo'
#ADMINS = ['yourname@example.com'] # where to send emails

View File

@ -14,8 +14,8 @@ server {
}
server {
listen 8004 ssl http2;
listen [::]:8004 ssl http2;
listen 127.0.0.1:8098;
listen [::1]:8098;
access_log /var/log/nginx/ckan-datapusher.access.log;
error_log /var/log/nginx/ckan-datapusher.error.log;

View File

@ -1,5 +1,4 @@
#!/bin/sh
IP=$(ip route get 1 | awk '{print $NF;exit}')
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
URL=$(ip route get 1 | awk '{print $NF;exit}')
sed -i "s|^ckan\.site_url.*|ckan.site_url = https://${URL}:8003|" /etc/ckan/ckan.ini