Skip to content

Commit d2b9c72

Browse files
Copilotsstidlstefanstidlffg
authored
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>
1 parent 3bd9e1b commit d2b9c72

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

doc_docker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Here's a list of additional environment variables available in this mode:
7272
* DB_USERNAME, DB_PASSWORD - credentials of the user with read and update permissions to the db
7373
* mssql - not supported in docker image yet (feel free to open a PR with that, has to be done in `entrypoint.sh`)
7474
* __`PASSWORD`__: Password to access the stats page. If not set, stats page will not allow accesses.
75-
* __`GDPR_EMAIL`__: Email address displayed in the privacy policy for data deletion requests. If not set, the default placeholder text will be shown. This should be set to comply with GDPR requirements when running in production. Must be specified when telemetry is enabled.
75+
* __`GDPR_EMAIL`__: Email address displayed in the privacy policy for data deletion requests. If not set, the default placeholder text will be shown. This should be set to comply with GDPR requirements when running in production. Must be specified when telemetry is enabled. Note: the old `EMAIL` environment variable is still accepted as a fallback but is deprecated — please migrate to `GDPR_EMAIL`.
7676
* __`DISABLE_IPINFO`__: If set to `true`, ISP info and distance will not be fetched from either [ipinfo.io](https://ipinfo.io) or the offline database. Default: value: `false`
7777
* __`IPINFO_APIKEY`__: API key for [ipinfo.io](https://ipinfo.io). Optional, but required if you want to use the full [ipinfo.io](https://ipinfo.io) APIs (required for distance measurement)
7878
* __`DISTANCE`__: When `DISABLE_IPINFO` is set to false, this specifies how the distance from the server is measured. Can be either `km` for kilometers, `mi` for miles, or an empty string to disable distance measurement. Requires an [ipinfo.io](https://ipinfo.io) API key. Default value: `km`

docker/entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ if [[ "$MODE" == "frontend" || "$MODE" == "dual" || "$MODE" == "standalone" ]];
8585
sed -i "s/var SPEEDTEST_SERVERS = \\[/var SPEEDTEST_SERVERS = \"$SERVER_LIST_URL_ESCAPED\";\\n\\t\\t\\/\\*/" /var/www/html/index-classic.html
8686
fi
8787

88+
# Support legacy EMAIL env var as fallback for GDPR_EMAIL
89+
if [ -z "$GDPR_EMAIL" ] && [ ! -z "$EMAIL" ]; then
90+
echo "WARNING: EMAIL env var is deprecated, please use GDPR_EMAIL instead" >&2
91+
GDPR_EMAIL="$EMAIL"
92+
echo "GDPR_EMAIL: $GDPR_EMAIL"
93+
fi
94+
8895
# Replace GDPR email placeholder if GDPR_EMAIL is set
8996
if [ ! -z "$GDPR_EMAIL" ]; then
9097
# Escape special sed characters: & (replacement), / (delimiter), \ (escape), $ (variable)

0 commit comments

Comments
 (0)