Support legacy EMAIL env var as deprecated fallback for GDPR_EMAIL (#781)

* Initial plan

* Fix: Support legacy EMAIL env var as fallback for GDPR_EMAIL in privacy policy

Agent-Logs-Url: https://github.com/librespeed/speedtest/sessions/337248e4-5c7a-4472-ad3b-381e0cd29c96

Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>

* fix stderr logging

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
Co-authored-by: Stefan Stidl <stefan.stidl@ffg.at>
This commit is contained in:
Copilot 2026-04-12 23:14:11 +02:00 committed by GitHub
parent 3bd9e1b7af
commit d2b9c724e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -85,6 +85,13 @@ if [[ "$MODE" == "frontend" || "$MODE" == "dual" || "$MODE" == "standalone" ]];
sed -i "s/var SPEEDTEST_SERVERS = \\[/var SPEEDTEST_SERVERS = \"$SERVER_LIST_URL_ESCAPED\";\\n\\t\\t\\/\\*/" /var/www/html/index-classic.html
fi
# Support legacy EMAIL env var as fallback for GDPR_EMAIL
if [ -z "$GDPR_EMAIL" ] && [ ! -z "$EMAIL" ]; then
echo "WARNING: EMAIL env var is deprecated, please use GDPR_EMAIL instead" >&2
GDPR_EMAIL="$EMAIL"
echo "GDPR_EMAIL: $GDPR_EMAIL"
fi
# Replace GDPR email placeholder if GDPR_EMAIL is set
if [ ! -z "$GDPR_EMAIL" ]; then
# Escape special sed characters: & (replacement), / (delimiter), \ (escape), $ (variable)