ff-admin/entrypoint.sh

20 lines
494 B
Bash
Raw Normal View History

2025-01-06 14:04:47 +00:00
#!/bin/sh
keys="SERVERADDRESS APPNAMEOVERWRITE IMPRINTLINK PRIVACYLINK CUSTOMLOGINMESSAGE"
2025-01-06 14:04:47 +00:00
# Replace env vars in files served by NGINX
for file in /usr/share/nginx/html/assets/config-*.js
do
echo "Processing $file ...";
for key in $keys
do
# Get environment variable
value=$(eval echo "\$$key")
echo "replace $key by $value"
# replace __[variable_name]__ value with environment variable
sed -i 's|__'"$key"'__|'"$value"'|g' $file
done
done
nginx -g 'daemon off;'