fix(minecraft-server): filter env replacement file

Environment variable replacement now only affects matching file types.

Closes #299
This commit is contained in:
Michael Reichenbach 2019-03-29 12:11:42 +01:00
parent 73046d7499
commit a316bd8f95
29 changed files with 2 additions and 2 deletions

0
build Executable file → Normal file
View File

0
elasticsearch/Dockerfile Executable file → Normal file
View File

0
elasticsearch/README.md Executable file → Normal file
View File

0
elasticsearch/start Executable file → Normal file
View File

0
gitblit/start.sh Executable file → Normal file
View File

0
jekyll-github-pages/start.sh Executable file → Normal file
View File

0
jenkins/download-and-start.sh Executable file → Normal file
View File

0
kibana/Dockerfile Executable file → Normal file
View File

0
kibana/start.sh Executable file → Normal file
View File

0
logstash/Dockerfile Executable file → Normal file
View File

0
minecraft-server/start Executable file → Normal file
View File

0
minecraft-server/start-configuration Executable file → Normal file
View File

0
minecraft-server/start-deployBukkitSpigot Executable file → Normal file
View File

0
minecraft-server/start-deployFTB Executable file → Normal file
View File

0
minecraft-server/start-deployForge Executable file → Normal file
View File

0
minecraft-server/start-deployPaper Executable file → Normal file
View File

0
minecraft-server/start-deploySpongeVanilla Executable file → Normal file
View File

0
minecraft-server/start-deployVanilla Executable file → Normal file
View File

0
minecraft-server/start-finalSetup01World Executable file → Normal file
View File

0
minecraft-server/start-finalSetup02Modpack Executable file → Normal file
View File

0
minecraft-server/start-finalSetup03Modconfig Executable file → Normal file
View File

0
minecraft-server/start-finalSetup04ServerProperties Executable file → Normal file
View File

View File

@ -6,8 +6,8 @@ if [ "$REPLACE_ENV_VARIABLES" = "TRUE" ]; then
# 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 "$name = $value"
find /data/ -type f -exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
echo "Replacing $name with $value ..."
find /data/ -type f \( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" -or -name "*.properties" \) -exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
fi
done < <(env)
fi

0
minecraft-server/start-minecraftFinalSetup Executable file → Normal file
View File

0
titan-gremlin/Dockerfile Executable file → Normal file
View File

0
titan-gremlin/start-gremlin.sh Executable file → Normal file
View File

0
titandb/gremlin Executable file → Normal file
View File

0
titandb/rexster Executable file → Normal file
View File

0
ubuntu-openjdk-7/Dockerfile Executable file → Normal file
View File