mirror of
https://github.com/librespeed/speedtest.git
synced 2026-08-04 14:48:38 +00:00
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>
This commit is contained in:
parent
eec82accb1
commit
a2a0a37a40
6 changed files with 16 additions and 0 deletions
|
|
@ -32,6 +32,7 @@ COPY docker/entrypoint.sh /
|
|||
|
||||
# Prepare default environment variables
|
||||
ENV TITLE=LibreSpeed
|
||||
ENV TAGLINE="No Flash, No Java, No Websockets, No Bullsh*t"
|
||||
ENV MODE=standalone
|
||||
ENV PASSWORD=password
|
||||
ENV TELEMETRY=false
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ COPY docker/entrypoint.sh /
|
|||
|
||||
# Prepare default environment variables
|
||||
ENV TITLE=LibreSpeed
|
||||
ENV TAGLINE="No Flash, No Java, No Websockets, No Bullsh*t"
|
||||
ENV MODE=standalone
|
||||
ENV PASSWORD=password
|
||||
ENV TELEMETRY=false
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ services:
|
|||
environment:
|
||||
MODE: standalone
|
||||
#TITLE: "LibreSpeed"
|
||||
#TAGLINE: "No Flash, No Java, No Websockets, No Bullsh*t"
|
||||
#TELEMETRY: "false"
|
||||
#ENABLE_ID_OBFUSCATION: "false"
|
||||
#REDACT_IP_ADDRESSES: "false"
|
||||
|
|
@ -57,6 +58,7 @@ The test can be accessed on port 80.
|
|||
Here's a list of additional environment variables available in this mode:
|
||||
|
||||
* __`TITLE`__: Title of your speed test. Default value: `LibreSpeed`
|
||||
* __`TAGLINE`__: Slogan shown below the heading on the modern frontend (`index-modern.html`). Default value: `No Flash, No Java, No Websockets, No Bullsh*t`
|
||||
* __`USE_NEW_DESIGN`__: When set to `true`, enables the new modern frontend design. When set to `false` (default), uses the classic design. The design can also be switched using URL parameters (`?design=new` or `?design=old`). Default value: `false`
|
||||
* __`SERVER_LIST_URL`__: When set, both frontend designs load their server list from this URL instead of the generated or mounted `server-list.json`. This is useful if you want the containerized frontend to consume a remote shared server list.
|
||||
* __`TELEMETRY`__: Whether to enable telemetry or not. If enabled, you maybe want your data to be persisted. See below. Default value: `false`
|
||||
|
|
|
|||
|
|
@ -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 [ ! -z "$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
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ services:
|
|||
- WEBPORT=8080
|
||||
- USE_NEW_DESIGN=true
|
||||
- 'TITLE=Grüße "Tempo" ''Österreich'''
|
||||
- 'TAGLINE=No "Flash", <No Java>, No Websockets & No Bullsh*t'
|
||||
ports:
|
||||
- "18185:8080"
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,14 @@ const { test, expect } = require('@playwright/test');
|
|||
const { baseUrls } = require('./helpers/env');
|
||||
|
||||
const specialTitle = 'Grüße "Tempo" \'Österreich\'';
|
||||
const specialTagline = 'No "Flash", <No Java>, No Websockets & No Bullsh*t';
|
||||
|
||||
test.describe('TITLE special characters', () => {
|
||||
test('modern page title supports umlauts and quotes', async ({ page }) => {
|
||||
await page.goto(`${baseUrls.standaloneNew}/index-modern.html`);
|
||||
await expect(page).toHaveTitle(`${specialTitle} - Free and Open Source Speedtest`);
|
||||
await expect(page.locator('main > h1')).toHaveText(specialTitle);
|
||||
await expect(page.locator('main > p.tagline')).toHaveText(specialTagline);
|
||||
});
|
||||
|
||||
test('classic heading supports umlauts and quotes', async ({ page }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue