From 04114eeac51a4121c0890233fd7cb82e80dabe5c Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Fri, 22 May 2020 00:40:04 +0100 Subject: [PATCH] Update entrypoint.sh (#5720) --- docker/entrypoint.sh | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 528b605486..1912494fd5 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -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} @@ -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 @@ -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 @@ -63,4 +77,5 @@ then -i ./index.html fi + nginx -g "daemon off;"