From fd06e94de39c0533e601d028deccd1843ab209e7 Mon Sep 17 00:00:00 2001 From: Michael Kanchuker Date: Thu, 16 Oct 2025 19:52:24 +0300 Subject: [PATCH] feat: allow to specify obfuscation salt string --- doc_docker.md | 1 + docker/entrypoint.sh | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc_docker.md b/doc_docker.md index 2ee4de3..cf249fe 100755 --- a/doc_docker.md +++ b/doc_docker.md @@ -59,6 +59,7 @@ Here's a list of additional environment variables available in this mode: * __`TITLE`__: Title of your speed test. Default value: `LibreSpeed` * __`TELEMETRY`__: Whether to enable telemetry or not. If enabled, you maybe want your data to be persisted. See below. Default value: `false` * __`ENABLE_ID_OBFUSCATION`__: When set to true with telemetry enabled, test IDs are obfuscated, to avoid exposing the database internal sequential IDs. Default value: `false` +* __`OBFUSCATION_SALT`__: The salt string that is used to obfuscate the test IDs. The format shoud be a 2 byte hex string (e.g. `0x1234abcd`). If not specified, a random one will be generated. * __`REDACT_IP_ADDRESSES`__: When set to true with telemetry enabled, IP addresses and hostnames are redacted from the collected telemetry, for better privacy. Default value: `false` * __`DB_TYPE`__: When set to one of the supported DB-Backends it will use this instead of the default sqlite database backend. TELEMETRY has to be set to `true`. Also you have to create the database as described in [doc.md](doc.md#creating-the-database). Supported backend types are: * sqlite - no additional settings required diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 5414eae..25052cb 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -78,6 +78,10 @@ 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 + fi fi if [ "$REDACT_IP_ADDRESSES" == "true" ]; then