fix Docker run (#3229)

This commit is contained in:
Denys Vuika
2023-05-25 08:08:58 +01:00
committed by GitHub
parent 0328ea09da
commit 1e37931b97
5 changed files with 39 additions and 149 deletions

View File

@@ -1,15 +0,0 @@
#!/bin/sh
set -e
echo Running sed on "${NGINX_ENVSUBST_OUTPUT_DIR}/assets/app.extensions.json"
# modifies the "$ignoreReferenceList" property using a comma-delimited string
if [ -n "${APP_EXTENSIONS_IGNORE_REFS}" ]; then
echo "replace APP_EXTENSIONS_IGNORE_REFS"
replace="\/"
encoded=${APP_EXTENSIONS_IGNORE_REFS//\//$replace}
sed -e "s/\"$ignoreReferenceList\": \".*\"/\"$ignoreReferenceList\": \[${encoded}\]/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.extensions.json"
fi

View File

@@ -1,111 +0,0 @@
#!/bin/sh
set -e
echo Running sed on "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
if [ -n "${APP_CONFIG_AUTH_TYPE}" ]; then
echo "replace APP_CONFIG_AUTH_TYPE"
sed -e "s/\"authType\": \".*\"/\"authType\": \"${APP_CONFIG_AUTH_TYPE}\"/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi
if [ -n "${APP_CONFIG_PROVIDER}"]; then
echo "replace APP_CONFIG_PROVIDER"
sed -e "s/\"providers\": \".*\"/\"providers\": \"${APP_CONFIG_PROVIDER}\"/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi
if [ -n "${APP_CONFIG_IDENTITY_HOST}" ]; then
echo "replace APP_CONFIG_IDENTITY_HOST"
replace="\/"
encodedIdentity=${APP_CONFIG_IDENTITY_HOST//\//$replace}
sed -e "s/\"identityHost\": \".*\"/\"identityHost\": \"$encodedIdentity\"/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi
if [ -n "${APP_CONFIG_OAUTH2_HOST}" ]; then
echo "replace APP_CONFIG_OAUTH2_HOST"
replace="\/"
encoded=${APP_CONFIG_OAUTH2_HOST//\//$replace}
sed -e "s/\"host\": \".*\"/\"host\": \"${encoded}\"/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi
if [ -n "${APP_CONFIG_OAUTH2_CLIENTID}" ]; then
echo "replace APP_CONFIG_OAUTH2_CLIENTID"
sed -e "s/\"clientId\": \".*\"/\"clientId\": \"${APP_CONFIG_OAUTH2_CLIENTID}\"/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi
if [ -n "${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}" ]; then
echo "replace APP_CONFIG_OAUTH2_IMPLICIT_FLOW"
sed -e "s/\"implicitFlow\": [^,]*/\"implicitFlow\": ${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi
if [ -n "${APP_CONFIG_OAUTH2_SILENT_LOGIN}" ]; then
echo "replace APP_CONFIG_OAUTH2_SILENT_LOGIN"
sed -e "s/\"silentLogin\": [^,]*/\"silentLogin\": ${APP_CONFIG_OAUTH2_SILENT_LOGIN}/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI}" ]; then
echo "replace APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI"
replace="\/"
encoded=${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI//\//$replace}
sed -e "s/\"redirectSilentIframeUri\": \".*\"/\"redirectSilentIframeUri\": \"${encoded}\"/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGIN}" ]; then
echo "replace APP_CONFIG_OAUTH2_REDIRECT_LOGIN"
replace="\/"
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGIN//\//$replace}
sed -e "s/\"redirectUri\": \".*\"/\"redirectUri\": \"${encoded}\"/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}" ]; then
echo "replace APP_CONFIG_OAUTH2_REDIRECT_LOGOUT"
replace="\/"
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT//\//$replace}
sed -e "s/\"redirectUriLogout\": \".*\"/\"redirectUriLogout\": \"${encoded}\"/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi
if [[ -n "${APP_CONFIG_BPM_HOST}" ]]; then
echo "replace APP_CONFIG_BPM_HOST"
replace="\/"
encoded=${APP_CONFIG_BPM_HOST//\//$replace}
sed -e "s/\"bpmHost\": \".*\"/\"bpmHost\": \"${encoded}\"/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi
if [[ -n "${APP_CONFIG_ECM_HOST}" ]]; then
echo "replace APP_CONFIG_ECM_HOST"
replace="\/"
encoded=${APP_CONFIG_ECM_HOST//\//$replace}
sed -e "s/\"ecmHost\": \".*\"/\"ecmHost\": \"${encoded}\"/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi
# application specific ce replacements
if [ -n "${APP_BASE_SHARE_URL}" ]; then
echo "replace APP_BASE_SHARE_URL"
replace="\/"
encoded=${APP_BASE_SHARE_URL//\//$replace}
sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${encoded}\"/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json"
fi