mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-07-04 19:21:58 +00:00
4509c52f67
* fix for APP_ENABLE_ACCOUNT_LIMITS_ALL * further fix * remove log statements
13 lines
709 B
Bash
13 lines
709 B
Bash
#!/bin/sh
|
|
PUBLIC_IPV4="$(curl --fail -qs whatismyip.akamai.com)"
|
|
API_PORT="${API_PORT:-3000}"
|
|
API_VERSION="${API_VERSION:-v1}"
|
|
REACT_APP_API_BASE_URL=${REACT_APP_API_BASE_URL:-http://$PUBLIC_IPV4:$API_PORT/$API_VERSION}
|
|
echo "REACT_APP_API_BASE_URL=${REACT_APP_API_BASE_URL}" > /opt/app/.env
|
|
REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL=${REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL:-0}
|
|
echo "REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL=${REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL}" >> /opt/app/.env
|
|
cd /opt/app/
|
|
TAG="<script>window.JAMBONZ = { APP_API_BASE_URL: '${REACT_APP_API_BASE_URL}', APP_ENABLE_ACCOUNT_LIMITS_ALL: ${REACT_APP_ENABLE_ACCOUNT_LIMITS_ALL}};</script>"
|
|
sed -i -e "\@</head>@i\ $TAG" ./build/index.html
|
|
npm run serve
|