mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
* ACA-2800 href should be override href="/" and href="./" as that is our prod build. As well ADW uses ACS_URL * ACA-2800 href should be override href="/" and href="./" as that is our prod build
85 lines
2.7 KiB
Bash
85 lines
2.7 KiB
Bash
#!/bin/sh
|
|
|
|
cp ./app.config.json /tmp/app.config.json
|
|
cp ./index.html /tmp/index.html
|
|
|
|
if [ -n "${APP_CONFIG_AUTH_TYPE}" ];then
|
|
sed -e "s/\"authType\": \".*\"/\"authType\": \"${APP_CONFIG_AUTH_TYPE}\"/g" \
|
|
-i /tmp/app.config.json && \
|
|
cat /tmp/app.config.json > ./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 /tmp/app.config.json && \
|
|
cat /tmp/app.config.json > ./app.config.json
|
|
fi
|
|
|
|
if [ -n "${APP_CONFIG_OAUTH2_CLIENTID}" ];then
|
|
sed -e "s/\"clientId\": \".*\"/\"clientId\": \"${APP_CONFIG_OAUTH2_CLIENTID}\"/g" \
|
|
-i /tmp/app.config.json && \
|
|
cat /tmp/app.config.json > ./app.config.json
|
|
fi
|
|
|
|
if [ -n "${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}" ];then
|
|
sed "/implicitFlow/s/true/${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}/" \
|
|
-i /tmp/app.config.json && \
|
|
cat /tmp/app.config.json > ./app.config.json
|
|
fi
|
|
|
|
if [ -n "${APP_CONFIG_OAUTH2_SILENT_LOGIN}" ];then
|
|
sed "/silentLogin/s/true/${APP_CONFIG_OAUTH2_SILENT_LOGIN}/" \
|
|
-i /tmp/app.config.json && \
|
|
cat /tmp/app.config.json > ./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 /tmp/app.config.json && \
|
|
cat /tmp/app.config.json > ./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 /tmp/app.config.json && \
|
|
cat /tmp/app.config.json > ./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 /tmp/app.config.json && \
|
|
cat /tmp/app.config.json > ./app.config.json
|
|
fi
|
|
|
|
if [[ $ACS_URL ]]; then
|
|
replace="\/"
|
|
encoded=${ACS_URL//\//$replace}
|
|
sed -i s%{protocol}//{hostname}{:port}%"$encoded"%g /tmp/app.config.json && \
|
|
cat /tmp/app.config.json > ./app.config.json
|
|
fi
|
|
|
|
if [[ $BASE_PATH ]]; then
|
|
replace="\/"
|
|
encoded=${BASE_PATH//\//$replace}
|
|
sed -ri 's%href=".?/"%href="'$encoded'"%g' /tmp/index.html && \
|
|
cat /tmp/index.html > ./index.html
|
|
fi
|
|
|
|
if [ -n "${APP_BASE_SHARE_URL}" ];then
|
|
replace="\/"
|
|
encoded=${APP_BASE_SHARE_URL//\//$replace}
|
|
sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${encoded}\"/g" \
|
|
-i /tmp/app.config.json && \
|
|
cat /tmp/app.config.json > ./app.config.json
|
|
fi
|
|
|
|
nginx -g "daemon off;"
|