mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
fix sed permissions issue
This commit is contained in:
parent
88068c9b9a
commit
d022877e5e
@ -1,60 +1,78 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
cp ./app.config.json /tmp/app.config.json
|
||||||
|
cp ./index.html /tmp/index.html
|
||||||
|
|
||||||
if [ -n "${APP_CONFIG_AUTH_TYPE}" ];then
|
if [ -n "${APP_CONFIG_AUTH_TYPE}" ];then
|
||||||
sed -e "s/\"authType\": \".*\"/\"authType\": \"${APP_CONFIG_AUTH_TYPE}\"/g" \
|
sed -e "s/\"authType\": \".*\"/\"authType\": \"${APP_CONFIG_AUTH_TYPE}\"/g" \
|
||||||
-i ./app.config.json
|
-i /tmp/app.config.json && \
|
||||||
|
cat /tmp/app.config.json > ./app.config.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${APP_CONFIG_OAUTH2_HOST}" ];then
|
if [ -n "${APP_CONFIG_OAUTH2_HOST}" ];then
|
||||||
replace="\/"
|
replace="\/"
|
||||||
encoded=${APP_CONFIG_OAUTH2_HOST//\//$replace}
|
encoded=${APP_CONFIG_OAUTH2_HOST//\//$replace}
|
||||||
sed -e "s/\"host\": \".*\"/\"host\": \"${encoded}\"/g" \
|
sed -e "s/\"host\": \".*\"/\"host\": \"${encoded}\"/g" \
|
||||||
-i ./app.config.json
|
-i /tmp/app.config.json && \
|
||||||
|
cat /tmp/app.config.json > ./app.config.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${APP_CONFIG_OAUTH2_CLIENTID}" ];then
|
if [ -n "${APP_CONFIG_OAUTH2_CLIENTID}" ];then
|
||||||
sed -e "s/\"clientId\": \".*\"/\"clientId\": \"${APP_CONFIG_OAUTH2_CLIENTID}\"/g" \
|
sed -e "s/\"clientId\": \".*\"/\"clientId\": \"${APP_CONFIG_OAUTH2_CLIENTID}\"/g" \
|
||||||
-i ./app.config.json
|
-i /tmp/app.config.json && \
|
||||||
|
cat /tmp/app.config.json > ./app.config.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}" ];then
|
if [ -n "${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}" ];then
|
||||||
sed "/implicitFlow/s/true/${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}/" \
|
sed "/implicitFlow/s/true/${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}/" \
|
||||||
-i ./app.config.json
|
-i /tmp/app.config.json && \
|
||||||
|
cat /tmp/app.config.json > ./app.config.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${APP_CONFIG_OAUTH2_SILENT_LOGIN}" ];then
|
if [ -n "${APP_CONFIG_OAUTH2_SILENT_LOGIN}" ];then
|
||||||
sed "/silentLogin/s/true/${APP_CONFIG_OAUTH2_SILENT_LOGIN}/" \
|
sed "/silentLogin/s/true/${APP_CONFIG_OAUTH2_SILENT_LOGIN}/" \
|
||||||
-i ./app.config.json
|
-i /tmp/app.config.json && \
|
||||||
|
cat /tmp/app.config.json > ./app.config.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI}" ];then
|
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI}" ];then
|
||||||
replace="\/"
|
replace="\/"
|
||||||
encoded=${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI//\//$replace}
|
encoded=${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI//\//$replace}
|
||||||
sed -e "s/\"redirectSilentIframeUri\": \".*\"/\"redirectSilentIframeUri\": \"${encoded}\"/g" \
|
sed -e "s/\"redirectSilentIframeUri\": \".*\"/\"redirectSilentIframeUri\": \"${encoded}\"/g" \
|
||||||
-i ./app.config.json
|
-i /tmp/app.config.json && \
|
||||||
|
cat /tmp/app.config.json > ./app.config.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGIN}" ];then
|
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGIN}" ];then
|
||||||
replace="\/"
|
replace="\/"
|
||||||
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGIN//\//$replace}
|
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGIN//\//$replace}
|
||||||
sed -e "s/\"redirectUri\": \".*\"/\"redirectUri\": \"${encoded}\"/g" \
|
sed -e "s/\"redirectUri\": \".*\"/\"redirectUri\": \"${encoded}\"/g" \
|
||||||
-i ./app.config.json
|
-i /tmp/app.config.json && \
|
||||||
|
cat /tmp/app.config.json > ./app.config.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}" ];then
|
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}" ];then
|
||||||
replace="\/"
|
replace="\/"
|
||||||
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT//\//$replace}
|
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT//\//$replace}
|
||||||
sed -e "s/\"redirectUriLogout\": \".*\"/\"redirectUriLogout\": \"${encoded}\"/g" \
|
sed -e "s/\"redirectUriLogout\": \".*\"/\"redirectUriLogout\": \"${encoded}\"/g" \
|
||||||
-i ./app.config.json
|
-i /tmp/app.config.json && \
|
||||||
|
cat /tmp/app.config.json > ./app.config.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $ACSURL ]]; then
|
if [[ $ACSURL ]]; then
|
||||||
sed -i s%{protocol}//{hostname}{:port}%"$ACSURL"%g /usr/share/nginx/html/app.config.json
|
sed -i s%{protocol}//{hostname}{:port}%"$ACSURL"%g /tmp/app.config.json && \
|
||||||
|
cat /tmp/app.config.json > ./app.config.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $BASEPATH ]]; then
|
||||||
|
sed -i s%href=\"/\"%href=\""$BASEPATH"\"%g /tmp/index.html && \
|
||||||
|
cat /tmp/index.html > ./index.html
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${APP_BASE_SHARE_URL}" ];then
|
if [ -n "${APP_BASE_SHARE_URL}" ];then
|
||||||
sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${APP_BASE_SHARE_URL}\"/g" \
|
sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${APP_BASE_SHARE_URL}\"/g" \
|
||||||
-i ./app.config.json
|
-i /tmp/app.config.json && \
|
||||||
|
cat /tmp/app.config.json > ./app.config.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
nginx -g "daemon off;"
|
nginx -g "daemon off;"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user