Added log prefixes (#444)

This commit is contained in:
Malcolm Nihlén
2020-03-06 16:52:17 +01:00
committed by GitHub
parent 74df4b6a9c
commit 1e334ca7d5
18 changed files with 172 additions and 141 deletions

View File

@@ -1,14 +1,16 @@
#!/bin/bash
. /start-utils
if [ "${REPLACE_ENV_VARIABLES^^}" = "TRUE" ]; then
echo "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX..."
log "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX..."
while IFS='=' read -r name value ; do
# check if name of env variable matches the prefix
# sanity check environment variables to avoid code injections
if [[ "$name" = $ENV_VARIABLE_PREFIX* ]] \
&& [[ $value =~ ^[0-9a-zA-Z_:/=?.+\-]*$ ]] \
&& [[ $name =~ ^[0-9a-zA-Z_\-]*$ ]]; then
echo "Replacing $name with $value ..."
log "Replacing $name with $value ..."
find /data/ -type f \
\( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \
-or -name "*.conf" -or -name "*.properties" \) \