From 64e4c3b768346797392b675c05f40c6ee4b1ddc3 Mon Sep 17 00:00:00 2001 From: sstidl Date: Sat, 18 Oct 2025 11:34:14 +0200 Subject: [PATCH] Update docker/entrypoint.sh Co-authored-by: qodo-merge-for-open-source[bot] <189517486+qodo-merge-for-open-source[bot]@users.noreply.github.com> --- docker/entrypoint.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 25052cb..6a15f29 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -79,8 +79,12 @@ if [[ "$TELEMETRY" == "true" && ("$MODE" == "frontend" || "$MODE" == "standalone if [ "$ENABLE_ID_OBFUSCATION" == "true" ]; then sed -i s/\$enable_id_obfuscation\ =\ .*\;/\$enable_id_obfuscation\ =\ true\;/g /var/www/html/results/telemetry_settings.php if [ ! -z "$OBFUSCATION_SALT" ]; then - echo " /var/www/html/results/idObfuscation_salt.php - echo "\$OBFUSCATION_SALT = $OBFUSCATION_SALT;" >> /var/www/html/results/idObfuscation_salt.php + if [[ "$OBFUSCATION_SALT" =~ ^0x[0-9a-fA-F]+$ ]]; then + echo " /var/www/html/results/idObfuscation_salt.php + echo "\$OBFUSCATION_SALT = $OBFUSCATION_SALT;" >> /var/www/html/results/idObfuscation_salt.php + else + echo "WARNING: Invalid OBFUSCATION_SALT format. It must be a hex string (e.g., 0x1234abcd). Using random salt." >&2 + fi fi fi