Skip to content

Commit

Permalink
Update entrypoint.sh (#5720)
Browse files Browse the repository at this point in the history
  • Loading branch information
eromano committed May 21, 2020
1 parent 7b2d267 commit 04114ee
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ if [ -n "${APP_CONFIG_AUTH_TYPE}" ];then
-i ./app.config.json
fi

if [ -n "${APP_CONFIG_IDENTITY_HOST}" ]; then
replace="\/"
encodedIdentity=${APP_CONFIG_IDENTITY_HOST//\//$replace}
sed -e "s/\"identityHost\": \".*\"/\"identityHost\": \"$encodedIdentity\"/g" \
-i ./app.config.json
fi

if [ -n "${APP_CONFIG_OAUTH2_HOST}" ];then
replace="\/"
encoded=${APP_CONFIG_OAUTH2_HOST//\//$replace}
Expand All @@ -18,12 +25,12 @@ if [ -n "${APP_CONFIG_OAUTH2_CLIENTID}" ];then
fi

if [ -n "${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}" ];then
sed "/implicitFlow/s/true/${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}/" \
sed -e "s/\"implicitFlow\": [^,]*/\"implicitFlow\": ${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}/g" \
-i ./app.config.json
fi

if [ -n "${APP_CONFIG_OAUTH2_SILENT_LOGIN}" ];then
sed "/silentLogin/s/true/${APP_CONFIG_OAUTH2_SILENT_LOGIN}/" \
sed -e "s/\"silentLogin\": [^,]*/\"silentLogin\": ${APP_CONFIG_OAUTH2_SILENT_LOGIN}/g" \
-i ./app.config.json
fi

Expand All @@ -48,12 +55,19 @@ if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}" ];then
-i ./app.config.json
fi

if [[ $ACSURL ]]; then
sed -i s%{protocol}//{hostname}{:port}%"$ACSURL"%g /usr/share/nginx/html/app.config.json
if [[ -n "${APP_CONFIG_BPM_HOST}" ]]
then
replace="\/"
encoded=${APP_CONFIG_BPM_HOST//\//$replace}
sed -e "s/\"bpmHost\": \".*\"/\"bpmHost\": \"${encoded}\"/g" \
-i ./app.config.json
fi

if [ -n "${APP_BASE_SHARE_URL}" ];then
sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${APP_BASE_SHARE_URL}\"/g" \
if [[ -n "${APP_CONFIG_ECM_HOST}" ]]
then
replace="\/"
encoded=${APP_CONFIG_ECM_HOST//\//$replace}
sed -e "s/\"ecmHost\": \".*\"/\"ecmHost\": \"${encoded}\"/g" \
-i ./app.config.json
fi

Expand All @@ -63,4 +77,5 @@ then
-i ./index.html
fi


nginx -g "daemon off;"

0 comments on commit 04114ee

Please sign in to comment.