From 8e78f7c0938eb0111e88b0d31b05e323acbcb189 Mon Sep 17 00:00:00 2001 From: "stojanovskis1@icloud.com" Date: Wed, 17 Jan 2024 11:34:14 +0100 Subject: [PATCH] added ckan.datapusher.api_token in 2.10 --- images/ckan/2.10/setup/app/start_ckan.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/images/ckan/2.10/setup/app/start_ckan.sh b/images/ckan/2.10/setup/app/start_ckan.sh index abf4473..0435142 100755 --- a/images/ckan/2.10/setup/app/start_ckan.sh +++ b/images/ckan/2.10/setup/app/start_ckan.sh @@ -1,4 +1,8 @@ #!/bin/bash + +# Add ckan.datapusher.api_token to the CKAN config file (updated with corrected value later) +ckan config-tool $APP_DIR/production.ini ckan.datapusher.api_token=xxx + # Run any startup scripts provided by images extending this one if [[ -d "${APP_DIR}/docker-entrypoint.d" ]] then @@ -38,6 +42,9 @@ UWSGI_OPTS="--socket /tmp/uwsgi.sock --uid ckan --gid ckan --http :5000 --master # Run the prerun script to init CKAN and create the default admin user python prerun.py || { echo '[CKAN prerun] FAILED. Exiting...' ; exit 1; } +echo "Set up ckan.datapusher.api_token in the CKAN config file" +ckan config-tool $APP_DIR/production.ini "ckan.datapusher.api_token=$(ckan -c $APP_DIR/production.ini user token add ckan_admin datapusher | tail -n 1 | tr -d '\t')" + # Check if we are in maintenance mode and if yes serve the maintenance pages if [ "$MAINTENANCE_MODE" = true ]; then PYTHONUNBUFFERED=1 python maintenance/serve.py; fi