Skip to content

Commit

Permalink
Merge pull request #92 from Brixel/feature/remove-config
Browse files Browse the repository at this point in the history
Feature/remove config
  • Loading branch information
BerendWouters authored Aug 4, 2023
2 parents fc7dcd1 + b06473b commit fce48c1
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions WebApp/doorrequest/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
#!/bin/sh
if [ -z "$APIURL" ]
if [ -z "$APISERVICE" ]
then
echo "No APIURL found, aborting..."
echo "No APISERVICE found, aborting..."
exit
else
echo "APIURL found: $APIURL"
echo "APISERVICE found: $APISERVICE"
fi

echo "{ \"apiUri\": \"$APIURL\",\"authUri\": \"$APIURL\" }" > ./usr/share/nginx/html/assets/config.json
if [ -z "$ISSUER" ]
then
echo "No ISSUER found, aborting..."
exit
else
echo "ISSUER found: $ISSUER"
fi

if [ -z "$CLIENTID" ]
then
echo "No CLIENTID found, aborting..."
exit
else
echo "CLIENTID found: $CLIENTID"
fi

sed -i "s/apiService:\"\"/apiService:\"$APISERVICE\"/g" /usr/share/nginx/html/main.*.js
sed -i "s/issuer:\"\"/issuer:\"$ISSUER\"/g" /usr/share/nginx/html/main.*.js
sed -i "s/clientId:\"\"/clientId:\"$CLIENTID\"/g" /usr/share/nginx/html/main.*.js

echo "Starting nginx..."
nginx -g "daemon off;"

0 comments on commit fce48c1

Please sign in to comment.