mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
82 lines
2.3 KiB
Bash
Executable File
82 lines
2.3 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ -n "${APP_CONFIG_AUTH_TYPE}" ];then
|
|
sed -e "s/\"authType\": \".*\"/\"authType\": \"${APP_CONFIG_AUTH_TYPE}\"/g" \
|
|
-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}
|
|
sed -e "s/\"host\": \".*\"/\"host\": \"${encoded}\"/g" \
|
|
-i ./app.config.json
|
|
fi
|
|
|
|
if [ -n "${APP_CONFIG_OAUTH2_CLIENTID}" ];then
|
|
sed -e "s/\"clientId\": \".*\"/\"clientId\": \"${APP_CONFIG_OAUTH2_CLIENTID}\"/g" \
|
|
-i ./app.config.json
|
|
fi
|
|
|
|
if [ -n "${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}" ];then
|
|
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 -e "s/\"silentLogin\": [^,]*/\"silentLogin\": ${APP_CONFIG_OAUTH2_SILENT_LOGIN}/g" \
|
|
-i ./app.config.json
|
|
fi
|
|
|
|
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI}" ];then
|
|
replace="\/"
|
|
encoded=${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI//\//$replace}
|
|
sed -e "s/\"redirectSilentIframeUri\": \".*\"/\"redirectSilentIframeUri\": \"${encoded}\"/g" \
|
|
-i ./app.config.json
|
|
fi
|
|
|
|
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGIN}" ];then
|
|
replace="\/"
|
|
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGIN//\//$replace}
|
|
sed -e "s/\"redirectUri\": \".*\"/\"redirectUri\": \"${encoded}\"/g" \
|
|
-i ./app.config.json
|
|
fi
|
|
|
|
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}" ];then
|
|
replace="\/"
|
|
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT//\//$replace}
|
|
sed -e "s/\"redirectUriLogout\": \".*\"/\"redirectUriLogout\": \"${encoded}\"/g" \
|
|
-i ./app.config.json
|
|
fi
|
|
|
|
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_CONFIG_ECM_HOST}" ]]
|
|
then
|
|
replace="\/"
|
|
encoded=${APP_CONFIG_ECM_HOST//\//$replace}
|
|
sed -e "s/\"ecmHost\": \".*\"/\"ecmHost\": \"${encoded}\"/g" \
|
|
-i ./app.config.json
|
|
fi
|
|
|
|
if [[ -n "${BASE_PATH}" ]]
|
|
then
|
|
sed s%href=\"/\"%href=\""${BASE_PATH}"\"%g \
|
|
-i ./index.html
|
|
fi
|
|
|
|
|
|
nginx -g "daemon off;"
|