Add Docker TAGLINE env customization for modern frontend slogan (#794)

* Initial plan

* Add Docker TAGLINE env customization for modern UI slogan

Agent-Logs-Url: https://github.com/librespeed/speedtest/sessions/e1da6e0e-5194-453d-bffb-961ed782e215

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

* Refine TAGLINE replacement and expand E2E coverage

Agent-Logs-Url: https://github.com/librespeed/speedtest/sessions/e1da6e0e-5194-453d-bffb-961ed782e215

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

* Fix TAGLINE sed delimiter and add apostrophe tagline E2E test

- Switch TAGLINE sed from '#' to '/' delimiter so html_escape'd
  apostrophes (&#39;) don't break the sed expression
- Add standalone-apostrophe Docker service with TAGLINE="It'd rather be fast!"
- Add standaloneApostrophe URL (port 18186) to env.js
- Add E2E test asserting the apostrophe tagline renders correctly

Agent-Logs-Url: https://github.com/librespeed/speedtest/sessions/ebe265a8-4b1e-49b5-959a-66133ea0ab3a

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

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
This commit is contained in:
Copilot 2026-04-18 23:06:37 +02:00 committed by GitHub
parent 8f0323c4a7
commit ecb2a0e736
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 39 additions and 1 deletions

View file

@ -108,6 +108,15 @@ if [[ "$MODE" == "frontend" || "$MODE" == "dual" || "$MODE" == "standalone" ]];
sed -i "s/<title>LibreSpeed<\\/title>/<title>$TITLE_ESCAPED<\\/title>/g" /var/www/html/index.html
sed -i "s/<title>LibreSpeed - Free and Open Source Speedtest<\\/title>/<title>$TITLE_ESCAPED - Free and Open Source Speedtest<\\/title>/g; s/<h1>Free and Open Source Speedtest\\.<\\/h1>/<h1>$TITLE_ESCAPED<\\/h1>/g" /var/www/html/index-modern.html
fi
# Replace modern page tagline if TAGLINE is set
if [ -n "$TAGLINE" ]; then
TAGLINE_ONE_LINE=${TAGLINE//$'\r'/}
TAGLINE_ONE_LINE=${TAGLINE_ONE_LINE//$'\n'/ }
TAGLINE_HTML_ESCAPED=$(html_escape "$TAGLINE_ONE_LINE")
TAGLINE_ESCAPED=$(sed_escape "$TAGLINE_HTML_ESCAPED")
sed -i "s/<p class=\"tagline\">No Flash, No Java, No Websockets, No Bullsh\\*t<\\/p>/<p class=\"tagline\">$TAGLINE_ESCAPED<\\/p>/g" /var/www/html/index-modern.html
fi
# Support legacy EMAIL env var as fallback for GDPR_EMAIL
if [ -z "$GDPR_EMAIL" ] && [ ! -z "$EMAIL" ]; then