Skip to content

Commit

Permalink
Merge pull request #117 from keitaroinc/api-tokens-fix
Browse files Browse the repository at this point in the history
api-tokens fix, two different tokens secrets were generated for encode and decode
  • Loading branch information
stojanovskis1 committed Nov 21, 2023
2 parents 94eb11c + b86348a commit a918f98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions images/ckan/2.9/setup/app/start_ckan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ if grep -E "beaker.session.secret ?= ?$" $APP_DIR/production.ini
then
echo "Setting secrets in ini file"
ckan config-tool $APP_DIR/production.ini "beaker.session.secret=$(python3 -c 'import secrets; print(secrets.token_urlsafe())')"
ckan config-tool $APP_DIR/production.ini "api_token.jwt.encode.secret=$(python3 -c 'import secrets; print("string:" + secrets.token_urlsafe())')"
ckan config-tool $APP_DIR/production.ini "api_token.jwt.decode.secret=$(python3 -c 'import secrets; print("string:" + secrets.token_urlsafe())')"
ckan config-tool $APP_DIR/production.ini "WTF_CSRF_SECRET_KEY=$(python3 -c 'import secrets; print(secrets.token_urlsafe())')"
JWT_SECRET=$(python3 -c 'import secrets; print("string:" + secrets.token_urlsafe())')
ckan config-tool $APP_DIR/production.ini "api_token.jwt.encode.secret=$JWT_SECRET"
ckan config-tool $APP_DIR/production.ini "api_token.jwt.decode.secret=$JWT_SECRET"
fi

# Run the prerun script to init CKAN and create the default admin user
Expand Down

0 comments on commit a918f98

Please sign in to comment.