-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add feature switch for new design via config file, URL parameters, and Docker #742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
|
@copilot look into the Dockerfiles and adjust entrypoint logic |
Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
Updated Dockerfiles and entrypoint.sh to support the design feature switch (commit 90cf3e5). Changes:
Docker Usage: # Default (old design)
docker run -p 80:8080 ghcr.io/librespeed/speedtest
# Enable new design
docker run -e USE_NEW_DESIGN=true -p 80:8080 ghcr.io/librespeed/speedtestTested successfully with Docker build and runtime. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: qodo-free-for-open-source-projects[bot] <189517486+qodo-free-for-open-source-projects[bot]@users.noreply.github.com>
sstidl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot the solution has a big flaw. the frontend now lives in two places.
with old design it is in the root of the server, with new design it is in subdir frontend.
this has the effect that the results/ folder isnt found in new design mode.
a better solution would be to put old and new design side by side into the docker container, both at the same level. no additional paths needed.
Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
Fixed in commit 9de1131. Both designs are now at root level side by side. Architecture:
Screenshots: The path issue is resolved - both designs are at the same directory level, so relative paths to shared resources work correctly. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
disable entrypoint bash debug


User description
Implements a toggle mechanism to enable the new frontend design while keeping the classic design as default. Supports both standalone deployments and Docker containers.
Both designs are placed at root level to ensure correct relative paths to shared resources like
backend/andresults/. In Docker containers, frontend assets are flattened to eliminate thefrontend/parent directory.Changes
config.json: Site-wide setting (useNewDesign: falseby default)design-switch.js: Client-side redirect logic with priority: URL params → config → default (old design)DESIGN_SWITCH.md: Usage documentationindex.html: Lightweight entry point that loads design switcherindex-classic.html: Classic design at root levelindex-modern.html: Modern design at root level (references assets from subdirectories)frontend/index.html: Unchanged for non-Docker deploymentsDockerfile&Dockerfile.alpine: Copy design switch files and both design HTML filesdocker/entrypoint.sh: Handle design switch setup,USE_NEW_DESIGNenvironment variable, and flatten frontend assets to root subdirectories in Dockerdoc_docker.md: Document newUSE_NEW_DESIGNenvironment variableArchitecture
Non-Docker Deployments
index-classic.htmlandindex-modern.htmlat rootfrontend/subdirectorybackend/andresults/with same relative pathsDocker Deployments
index-classic.htmlandindex-modern.htmlat rootstyling/,javascript/,images/,fonts/frontend/parent directory in containersbackend/andresults/with same relative pathsUsage
Non-Docker Deployments
Docker Deployments
# Enable new design via environment variable docker run -e USE_NEW_DESIGN=true -p 80:8080 ghcr.io/librespeed/speedtestOr in
docker-compose.yml:Error Handling
Screenshots
Classic Design (Default)

New Design

PR Type
Enhancement
Description
Implements feature switch for new design with multiple configuration methods
Supports URL parameters, config file, and Docker environment variables
Includes client-side redirect logic with infinite loop prevention
Adds comprehensive documentation and Docker integration