Adjust CKAN datapusher + datastore configuration, related to #148
This commit is contained in:
parent
abcf84650d
commit
a8e4dc63d3
@ -71,13 +71,10 @@ systemctl restart solr
|
|||||||
# Configure CKAN
|
# Configure CKAN
|
||||||
export CKAN_SECRET=$(head -c 18 /dev/urandom | base64)
|
export CKAN_SECRET=$(head -c 18 /dev/urandom | base64)
|
||||||
export CKAN_UUID=$(uuidgen -r)
|
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
|
mkdir /etc/ckan
|
||||||
envsubst <${SOURCE_DIR}/ckan/etc/ckan/ckan.ini >/etc/ckan/ckan.ini
|
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.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
|
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
|
cp ${SOURCE_DIR}/ckan/srv/ckan/update-ip.sh /srv/ckan/update-ip.sh
|
||||||
/srv/ckan/update-ip.sh
|
/srv/ckan/update-ip.sh
|
||||||
|
@ -169,7 +169,7 @@ ckan.max_image_size = 2
|
|||||||
# Make sure you have set up the DataStore
|
# 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.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
|
#ckan.datapusher.assume_task_stale_after = 3600
|
||||||
|
|
||||||
# Resource Proxy settings
|
# Resource Proxy settings
|
||||||
|
@ -6,8 +6,9 @@ activate_this = os.path.join('/srv/ckan/bin/activate_this.py')
|
|||||||
execfile(activate_this, dict(__file__=activate_this))
|
execfile(activate_this, dict(__file__=activate_this))
|
||||||
|
|
||||||
import ckanserviceprovider.web as web
|
import ckanserviceprovider.web as web
|
||||||
import datapusher.jobs as jobs
|
|
||||||
|
|
||||||
os.environ['JOB_CONFIG'] = '/etc/ckan/datapusher_settings.py'
|
os.environ['JOB_CONFIG'] = '/etc/ckan/datapusher_settings.py'
|
||||||
web.init()
|
web.init()
|
||||||
|
|
||||||
|
import datapusher.jobs as jobs
|
||||||
|
|
||||||
application = web.app
|
application = web.app
|
||||||
|
@ -1,17 +1,20 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import uuid
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
TESTING = False
|
TESTING = False
|
||||||
SSL_VERIFY = False
|
SECRET_KEY = str(uuid.uuid4())
|
||||||
SECRET_KEY = '${CKAN_DSJOB_SECRET}'
|
USERNAME = str(uuid.uuid4())
|
||||||
USERNAME = '${CKAN_DSJOB_USER}'
|
PASSWORD = str(uuid.uuid4())
|
||||||
PASSWORD = '${CKAN_DSJOB_PWD}'
|
|
||||||
NAME = 'datapusher'
|
NAME = 'datapusher'
|
||||||
|
|
||||||
SQLALCHEMY_DATABASE_URI = 'sqlite:////var/lib/ckan/datapusher-jobs.db'
|
SQLALCHEMY_DATABASE_URI = 'sqlite:////var/lib/ckan/datapusher-jobs.db'
|
||||||
|
|
||||||
HOST = '0.0.0.0'
|
HOST = '0.0.0.0'
|
||||||
PORT = 8004
|
PORT = 8098
|
||||||
|
SSL_VERIFY = False
|
||||||
|
|
||||||
FROM_EMAIL = 'ckan@spotter.ngo'
|
FROM_EMAIL = 'ckan@spotter.ngo'
|
||||||
#ADMINS = ['yourname@example.com'] # where to send emails
|
#ADMINS = ['yourname@example.com'] # where to send emails
|
||||||
|
@ -14,8 +14,8 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 8004 ssl http2;
|
listen 127.0.0.1:8098;
|
||||||
listen [::]:8004 ssl http2;
|
listen [::1]:8098;
|
||||||
|
|
||||||
access_log /var/log/nginx/ckan-datapusher.access.log;
|
access_log /var/log/nginx/ckan-datapusher.access.log;
|
||||||
error_log /var/log/nginx/ckan-datapusher.error.log;
|
error_log /var/log/nginx/ckan-datapusher.error.log;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
IP=$(ip route get 1 | awk '{print $NF;exit}')
|
URL=$(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\.site_url.*|ckan.site_url = https://${URL}:8003|" /etc/ckan/ckan.ini
|
||||||
sed -i "s|^ckan\.datapusher\.url.*|ckan.datapusher.url = https://${IP}:8004|" /etc/ckan/ckan.ini
|
|
||||||
|
Loading…
Reference in New Issue
Block a user