added ckan.datapusher.api_token in 2.10

This commit is contained in:
stojanovskis1@icloud.com 2024-01-17 11:34:14 +01:00
parent ee259e1a59
commit 8e78f7c093
1 changed files with 7 additions and 0 deletions

View File

@ -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