Skip to content

Commit

Permalink
Update CKAN configuration to set temporary value for user $USER for c…
Browse files Browse the repository at this point in the history
…kanext.xloader.api_token
  • Loading branch information
MarkCalvert committed May 2, 2024
1 parent cfb5d8c commit 152015d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ckan/docker-entrypoint.d/02_setup_dbca.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ if [ ! -f /tmp/container_ready ]; then

if [[ $CKAN__PLUGINS == *"xloader"* ]]; then
CKAN_INI=$APP_DIR/ckan.ini
# Use the CKAN_SYSADMIN_NAME or CKAN_SITE_ID to create a token for the xloader user
export CKAN_SITE_ID=$(grep '^ckan\.site_id ' $CKAN_INI | cut -d'=' -f2)
USER=${CKAN_SYSADMIN_NAME:-$CKAN_SITE_ID}
# Add ckan.xloader.api_token to the CKAN config file (updated with corrected value later)
echo "Setting a temporary value for ckanext.xloader.api_token"
ckan config-tool $CKAN_INI "ckanext.xloader.api_token=$(ckan -c $APP_DIR/config/dbca.ini user token add $CKAN_SYSADMIN_NAME xloader | tail -n 1 | tr -d '\t')"
echo "Setting a temporary value for user $USER for ckanext.xloader.api_token"
ckan config-tool $CKAN_INI "ckanext.xloader.api_token=$(ckan -c $APP_DIR/config/dbca.ini user token add $USER xloader | tail -n 1 | tr -d '\t')"
fi
CKAN_INI=$APP_DIR/config/dbca.ini

Expand Down

0 comments on commit 152015d

Please sign in to comment.