Release 5.3.0 (#587)

* Update README.md

Added simple manual instructions

* Link to docker documentation

* Add basic docker compose example

* add descriptive alt-text to GIF

* Fix some typos and formatting

* Updated Docker to use php8.2-apache as the upstream image.

* Clean up apt lists after installation in Dockerfile

* Update Dockerfile

Co-authored-by: Quentame <polletquentin74@me.com>

* fix typo

* doc: sqlite db persistance explained

* Create docker-publish.yml

* Update docker-publish.yml

* Update docker-publish.yml

* fix action

* switch docker image location

* without image signing

* remove signing

* switch units to Mbit/s

* move examples to folder

* fix ipinfo parsing

* fix regression on getIpinfo

* removed trailing whitespaces

* integrate ios favicon

closes #400

* set single-server-full as index

---------

Co-authored-by: Les W <30345058+leswaters@users.noreply.github.com>
Co-authored-by: bt90 <btom1990@googlemail.com>
Co-authored-by: An | Anton Röhm <18481195+AnTheMaker@users.noreply.github.com>
Co-authored-by: 0kyn <0kyn.dev@gmail.com>
Co-authored-by: Marc Zampetti <zampettim@users.noreply.github.com>
Co-authored-by: Peter Dave Hello <hsu@peterdavehello.org>
Co-authored-by: Quentame <polletquentin74@me.com>
Co-authored-by: Stefan STIDL <stefan.stidl@ffg.at>
This commit is contained in:
sstidl 2023-11-26 12:46:27 +01:00 committed by GitHub
parent 6a4a05d883
commit e5f54fbd78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 332 additions and 128 deletions

80
.github/workflows/docker-publish.yml vendored Normal file
View file

@ -0,0 +1,80 @@
name: Docker
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
# schedule:
# - cron: '30 20 * * *'
push:
branches: ["*"]
# Publish semver tags as releases.
tags: ["v*.*.*"]
pull_request:
branches: ["{{is_default_branch}}"]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
results/idObfuscation_salt.php
backend/getIP_serverLocation.php
db-dir/

View file

@ -1,4 +1,4 @@
FROM php:7.4-apache
FROM php:8-apache
# Install extensions
RUN apt-get update && apt-get install -y \
@ -9,14 +9,13 @@ RUN apt-get update && apt-get install -y \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql pdo_pgsql pgsql
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql pdo_pgsql pgsql \
&& rm -rf /var/lib/apt/lists/*
# Prepare files and folders
RUN mkdir -p /speedtest/
# Copy sources
COPY backend/ /speedtest/backend
COPY results/*.php /speedtest/results/
@ -30,8 +29,7 @@ COPY docker/servers.json /servers.json
COPY docker/*.php /speedtest/
COPY docker/entrypoint.sh /
# Prepare environment variabiles defaults
# Prepare default environment variables
ENV TITLE=LibreSpeed
ENV MODE=standalone
ENV PASSWORD=password
@ -41,6 +39,5 @@ ENV REDACT_IP_ADDRESSES=false
ENV WEBPORT=80
# Final touches
EXPOSE 80
CMD ["bash", "/entrypoint.sh"]

View file

@ -23,7 +23,7 @@ Works with mobile versions too.
* Results sharing (optional)
* Multiple Points of Test (optional)
![Screenshot](https://speedtest.fdossena.com/mpot_v6.gif)
![Screenrecording of a running Speedtest](https://speedtest.fdossena.com/mpot_v6.gif)
## Server requirements
@ -32,14 +32,27 @@ Works with mobile versions too.
* MySQL database to store test results (optional, Microsoft SQL Server, PostgreSQL and SQLite also supported)
* A fast! internet connection
## Installation videos
## Installation
Assuming you have PHP installed, the installation steps are quite simple.
I set this up on a QNAP.
For this example, I am using a folder called **speedtest** in my web share area.
1. Choose one of the example-xxx.html files as your new index.html in your speedtest folder. I used: example-singleServer-full.html
2. Add: speedtest.js, speedtest_worker.js, and favicon.ico to your speedtest folder.
3. Download all of the backend folder into speedtest/backend.
4. Download all of the results folder into speedtest/results.
5. Be sure your permissions allow execute (755).
6. Visit YOURSITE/speedtest/index.html and voila!
### Installation Video
There is a more in-depth installation video here:
* [Quick start installation guide for Ubuntu Server 19.04](https://fdossena.com/?p=speedtest/quickstart_v5_ubuntu.frag)
## Android app
A template to build an Android client for your LibreSpeed installation is available [here](https://github.com/librespeed/speedtest-android).
## Docker
A docker image is available on the [Docker Hub](https://registry.hub.docker.com/r/adolfintel/speedtest), see `doc_docker.md` for more info about it
A docker image is available on [GitHub](https://github.com/librespeed/speedtest/pkgs/container/speedtest), check our [docker documentation](doc_docker.md) for more info about it.
## Go backend
A Go implementation is available in the [`speedtest-go`](https://github.com/librespeed/speedtest-go) repo, maintained by [Maddie Zhan](https://github.com/maddie).

View file

@ -76,7 +76,7 @@ function getIpInfoTokenString()
return '';
}
return '?token='.$IPINFO_APIKEY;
return '?token=' . $IPINFO_APIKEY;
}
/**
@ -86,7 +86,7 @@ function getIpInfoTokenString()
*/
function getIspInfo($ip)
{
$json = file_get_contents('https://ipinfo.io/'.$ip.'/json'.getIpInfoTokenString());
$json = file_get_contents('https://ipinfo.io/' . $ip . '/json' . getIpInfoTokenString());
if (!is_string($json)) {
return null;
}
@ -106,17 +106,91 @@ function getIspInfo($ip)
*/
function getIsp($rawIspInfo)
{
if (
!is_array($rawIspInfo)
|| !array_key_exists('org', $rawIspInfo)
|| !is_string($rawIspInfo['org'])
|| empty($rawIspInfo['org'])
) {
return 'Unknown ISP';
if (is_array($rawIspInfo)) {
/* variant with no token
has json like:
{
"ip": "xxx.xxx.xxx.xxx",
"hostname": "example.com",
"city": "Vienna",
"region": "Vienna",
"country": "AT",
"loc": "48.2085,16.3721",
"org": "ASxxxx T-Mobile Austria GmbH",
"postal": "nnnn",
"timezone": "Europe/Vienna",
"readme": "https://ipinfo.io/missingauth"
}
*/
if (
array_key_exists('org', $rawIspInfo)
&& is_string($rawIspInfo['org'])
&& !empty($rawIspInfo['org'])
) {
// Remove AS##### from ISP name, if present
return preg_replace('/AS\\d+\\s/', '', $rawIspInfo['org']);
}
/*
variant with valid token has json:
{
"ip": "xxx.xxx.xxx.xxx",
"hostname": "example.com",
"city": "Vienna",
"region": "Vienna",
"country": "AT",
"loc": "48.2085,16.3721",
"postal": "1010",
"timezone": "Europe/Vienna",
"asn": {
"asn": "ASxxxx",
"name": "T-Mobile Austria GmbH",
"domain": "t-mobile.at",
"route": "xxx.xxx.xxx.xxx/xx",
"type": "isp"
},
"company": {
"name": "XX",
"domain": "example.com",
"type": "isp"
},
"privacy": {
"vpn": true,
"proxy": false,
"tor": false,
"relay": false,
"hosting": false,
"service": ""
},
"abuse": {
"address": "...",
"country": "AT",
"email": "abuse@example.com",
"name": "XXX",
"network": "xxx.xxx.xxx.xxx-xxx.xxx.xxx.xxx",
"phone": ""
},
"domains": {
"total": 0,
"domains": [
]
}
}
*/
if (
array_key_exists('asn', $rawIspInfo)
&& is_array($rawIspInfo['asn'])
&& !empty($rawIspInfo['asn'])
&& array_key_exists('name', $rawIspInfo['asn'])
&& is_string($rawIspInfo['asn']['name'])
) {
// Remove AS##### from ISP name, if present
return $rawIspInfo['asn']['name'];
}
}
return 'Unknown ISP';
}
/**
@ -135,7 +209,7 @@ function getServerLocation()
return $serverLoc;
}
$json = file_get_contents('https://ipinfo.io/json'.getIpInfoTokenString());
$json = file_get_contents('https://ipinfo.io/json' . getIpInfoTokenString());
if (!is_string($json)) {
return null;
}
@ -151,7 +225,7 @@ function getServerLocation()
}
$serverLoc = $details['loc'];
$cacheData = "<?php\n\n\$serverLoc = '".addslashes($serverLoc)."';\n";
$cacheData = "<?php\n\n\$serverLoc = '" . addslashes($serverLoc) . "';\n";
file_put_contents(SERVER_LOCATION_CACHE_FILE, $cacheData);
return $serverLoc;
@ -240,7 +314,7 @@ function calculateDistance($clientLocation, $serverLocation, $unit)
$dist = '<15';
}
return $dist.' mi';
return $dist . ' mi';
}
if ('km' === $unit) {
@ -249,7 +323,7 @@ function calculateDistance($clientLocation, $serverLocation, $unit)
$dist = '<20';
}
return $dist.' km';
return $dist . ' km';
}
return null;
@ -288,17 +362,17 @@ function sendResponse(
) {
$processedString = $ip;
if (is_string($ipInfo)) {
$processedString .= ' - '.$ipInfo;
$processedString .= ' - ' . $ipInfo;
}
if (
is_array($rawIspInfo)
&& array_key_exists('country', $rawIspInfo)
) {
$processedString .= ', '.$rawIspInfo['country'];
$processedString .= ', ' . $rawIspInfo['country'];
}
if (is_string($distance)) {
$processedString .= ' ('.$distance.')';
$processedString .= ' (' . $distance . ')';
}
sendHeaders();

14
doc.md
View file

@ -117,7 +117,7 @@ If you're not using telemetry and results sharing, you can delete the `results`
Details about the examples and how to make custom UIs will be discussed later. If you don't want to make a custom UI, feel free to modify the example and replace "LibreSpeed Example" with the name of your test.
#### Privacy
Telemetry contains personal information (according to GDPR defintion), therefore it is important to treat this data respectfully of national and international laws, especially if you plan to offer the service in the European Union.
Telemetry contains personal information (according to GDPR definition), therefore it is important to treat this data respectfully of national and international laws, especially if you plan to offer the service in the European Union.
`example-singleServer-full.html` and `example-multipleServers-full.html` both contain a privacy policy for the service: you MUST read it, change it if necessary, and add your email address for data deletion requests. __Failure to comply with GDPR regulations can get you in serious trouble.__
@ -506,9 +506,9 @@ You can think of this as a finite state machine. These are the states (use getSt
```
While in state 1, you can only add test points, you cannot change the test settings. When you're done, use selectServer(callback) to select the test point with the lowest ping. This is asynchronous, when it's done, it will call your callback function and move to state 2. Calling setSelectedServer(server) will manually select a server and move to state 2.
* __2__: test point selected, ready to start the test. Use `start()` to begin, this will move to state 3
* __3__: test running. Here, your `onupdate` event calback will be called periodically, with data coming from the worker about speed and progress. A data object will be passed to your `onupdate` function, with the following items:
- `dlStatus`: download speed in mbps
- `ulStatus`: upload speed in mbps
* __3__: test running. Here, your `onupdate` event callback will be called periodically, with data coming from the worker about speed and progress. A data object will be passed to your `onupdate` function, with the following items:
- `dlStatus`: download speed in Mbit/s
- `ulStatus`: upload speed in Mbit/s
- `pingStatus`: ping in ms
- `jitterStatus`: jitter in ms
- `dlProgress`: progress of the download test as a float 0-1
@ -664,7 +664,7 @@ Access-Control-Allow-Headers: Content-Encoding, Content-Type
This file stores telemetry information into the database.
Data is passed as POST parameters:
* `ispinfo`: ISP info (if enabled, empty strng otherwise)
* `ispinfo`: ISP info (if enabled, empty string otherwise)
* `extra`: the `telemetry_extra` string passed to the worker (if set, empty string otherwise)
* `dl`: download speed
* `ul`: upload speed
@ -741,7 +741,7 @@ s.setParameter("url_ping","backend/empty.dat");
s.setParameter("test_order","P_D_U");
```
This will point to our static files and set the test to only do ping/jitter, download and uplod tests.
This will point to our static files and set the test to only do ping/jitter, download and upload tests.
## Troubleshooting
These are the most common issues reported by users, and how to fix them. If you still need help, contact me at [info@fdossena.com](mailto:info@fdossena.com).
@ -807,7 +807,7 @@ Also, make sure that the web server has write permission on the `results` folder
## Known bugs and limitations
### General
* The ping/jitter test is measured by seeing how long it takes for an empty XHR to complete. It is not an acutal ICMP ping. Different browsers may also show different results, especially on very fast connections on slow devices.
* The ping/jitter test is measured by seeing how long it takes for an empty XHR to complete. It is not an actual ICMP ping. Different browsers may also show different results, especially on very fast connections on slow devices.
### IE specific
* The upload test is not precise on very fast connections with high latency (will probably be fixed by Edge 17)
* On IE11, a same origin policy error is erroneously triggered under unknown conditions. Seems to be related to running the test from unusual URLs like a top level domain (for instance http://abc/speedtest). These are bugs in IE11's implementation of the same origin policy, not in the speed test itself.

View file

@ -1,13 +1,41 @@
A docker version of LibreSpeed is available on docker hub: [https://hub.docker.com/r/adolfintel/speedtest/](https://hub.docker.com/r/adolfintel/speedtest/)
A docker version of LibreSpeed is available here: [GitHub Packages](https://github.com/librespeed/speedtest/pkgs/container/speedtest)
## Downloading from Docker hub
To download LibreSpeed from the docker hub, use this command:
## Downloading docker image
To download LibreSpeed from the docker repo, use this command:
```
docker pull adolfintel/speedtest
docker pull ghcr.io/librespeed/speedtest
```
You will now have a new docker image called `adolfintel/speedtest`.
You will now have a new docker image called `librespeed/speedtest`.
## Docker Compose
To start the container using [docker compose](https://docs.docker.com/compose/) the following configuration can be used:
```yml
version: '3.7'
services:
speedtest:
container_name: speedtest
image: ghcr.io/librespeed/speedtest:latest
restart: always
environment:
MODE: standalone
#TITLE: "LibreSpeed"
#TELEMETRY: "false"
#ENABLE_ID_OBFUSCATION: "false"
#REDACT_IP_ADDRESSES: "false"
#PASSWORD:
#EMAIL:
#DISABLE_IPINFO: "false"
#DISTANCE: "km"
#WEBPORT: 80
ports:
- "80:80" # webport mapping (host:container)
```
Please adjust the environment variables according to the intended operating mode.
## Standalone mode
If you want to install LibreSpeed on a single server, you need to configure it in standalone mode. To do this, set the `MODE` environment variable to `standalone`.
@ -16,7 +44,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`
* __`TELEMETRY`__: Whether to enable telemetry or not. Default value: `false`
* __`TELEMETRY`__: Whether to enable telemetry or not. If enabled, you maybe want your data to be persisted. See below. Default value: `false`
* __`ENABLE_ID_OBFUSCATION`__: When set to true with telemetry enabled, test IDs are obfuscated, to avoid exposing the database internal sequential IDs. Default value: `false`
* __`REDACT_IP_ADDRESSES`__: When set to true with telemetry enabled, IP addresses and hostnames are redacted from the collected telemetry, for better privacy. Default value: `false`
* __`PASSWORD`__: Password to access the stats page. If not set, stats page will not allow accesses.
@ -28,17 +56,24 @@ Here's a list of additional environment variables available in this mode:
If telemetry is enabled, a stats page will be available at `http://your.server/results/stats.php`, but a password must be specified.
### Persist sqlite database
Default DB driver is sqlite. The DB file is written to `/database/db.sql`.
So if you want your data to be persisted over image updates, you have to mount a volume with `-v $PWD/db-dir:/database`.
###### Example
This command starts LibreSpeed in standalone mode, with the default settings, on port 80:
```
docker run -e MODE=standalone -p 80:80 -it adolfintel/speedtest
docker run -e MODE=standalone -p 80:80 -it ghcr.io/librespeed/speedtest
```
This command starts LibreSpeed in standalone mode, with telemetry, ID obfuscation and a stats password, on port 86:
```
docker run -e MODE=standalone -e TELEMETRY=true -e ENABLE_ID_OBFUSCATION=true -e PASSWORD="yourPasswordHere" -e WEBPORT=86 -p 86:86 -it adolfintel/speedtest
docker run -e MODE=standalone -e TELEMETRY=true -e ENABLE_ID_OBFUSCATION=true -e PASSWORD="yourPasswordHere" -e WEBPORT=86 -p 86:86 -v $PWD/db-dir/:/database -it ghcr.io/librespeed/speedtest
```
## Multiple Points of Test
@ -55,7 +90,7 @@ Here's a list of additional environment variables available in this mode:
###### Example:
This command starts LibreSpeed in backend mode, with the default settings, on port 80:
```
docker run -e MODE=backend -p 80:80 -it adolfintel/speedtest
docker run -e MODE=backend -p 80:80 -it ghcr.io/librespeed/speedtest
```
### Frontend mode
@ -102,5 +137,5 @@ Here's a list of additional environment variables available in this mode:
###### Example
This command starts LibreSpeed in frontend mode, with a given `servers.json` file, and with telemetry, ID obfuscation, and a stats password:
```
docker run -e MODE=frontend -e TELEMETRY=true -e ENABLE_ID_OBFUSCATION=true -e PASSWORD="yourPasswordHere" -v $(pwd)/servers.json:/servers.json -p 80:80 -it adolfintel/speedtest
docker run -e MODE=frontend -e TELEMETRY=true -e ENABLE_ID_OBFUSCATION=true -e PASSWORD="yourPasswordHere" -v $(pwd)/servers.json:/servers.json -p 80:80 -it ghcr.io/librespeed/speedtest
```

View file

@ -3,6 +3,8 @@
<head>
<link rel="shortcut icon" href="favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no" />
<link rel="apple-touch-icon" href="favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta charset="UTF-8" />
<script type="text/javascript" src="speedtest.js"></script>
<script type="text/javascript">
@ -409,13 +411,13 @@ function initUI(){
<div class="testName">Download</div>
<canvas id="dlMeter" class="meter"></canvas>
<div id="dlText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
<div class="testArea">
<div class="testName">Upload</div>
<canvas id="ulMeter" class="meter"></canvas>
<div id="ulText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
</div>
<div id="ipArea">

View file

@ -2,6 +2,8 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no" />
<link rel="apple-touch-icon" href="favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta charset="UTF-8" />
<link rel="shortcut icon" href="favicon.ico">
<script type="text/javascript" src="speedtest.js"></script>
@ -301,13 +303,13 @@ function initUI(){
<div class="testName">Download</div>
<canvas id="dlMeter" class="meter"></canvas>
<div id="dlText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
<div class="testArea">
<div class="testName">Upload</div>
<canvas id="ulMeter" class="meter"></canvas>
<div id="ulText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
</div>
<div id="ipArea">

View file

@ -424,13 +424,13 @@ function initUI(){
<div class="testName">Download</div>
<canvas id="dlMeter" class="meter"></canvas>
<div id="dlText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
<div class="testArea">
<div class="testName">Upload</div>
<canvas id="ulMeter" class="meter"></canvas>
<div id="ulText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
</div>
<div id="ipArea">

View file

@ -212,12 +212,12 @@ function I(id){return document.getElementById(id);}
<div class="testArea">
<div class="testName">Download</div>
<div id="dlText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
<div class="testArea">
<div class="testName">Upload</div>
<div id="ulText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
</div>
<div class="testGroup">

View file

@ -157,12 +157,12 @@ function I(id){return document.getElementById(id);}
<div class="testArea">
<div class="testName">Download</div>
<div id="dlText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
<div class="testArea">
<div class="testName">Upload</div>
<div id="ulText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
</div>
</div>

View file

@ -242,13 +242,13 @@ function initUI(){
<div class="testName">Download</div>
<canvas id="dlMeter" class="meter"></canvas>
<div id="dlText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
<div class="testArea">
<div class="testName">Upload</div>
<canvas id="ulMeter" class="meter"></canvas>
<div id="ulText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
</div>
<div id="ipArea">

View file

@ -160,12 +160,12 @@ function I(id){return document.getElementById(id);}
<div class="testArea">
<div class="testName">Download</div>
<div id="dlText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
<div class="testArea">
<div class="testName">Upload</div>
<div id="ulText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
</div>
<div class="testGroup">

View file

@ -180,12 +180,12 @@ function I(id){return document.getElementById(id);}
<div class="testArea">
<div class="testName">Download</div>
<div id="dlText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
<div class="testArea">
<div class="testName">Upload</div>
<div id="ulText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
</div>
<div class="testGroup">

View file

@ -298,13 +298,13 @@ function initUI(){
<div class="testName">Download</div>
<canvas id="dlMeter" class="meter"></canvas>
<div id="dlText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
<div class="testArea">
<div class="testName">Upload</div>
<canvas id="ulMeter" class="meter"></canvas>
<div id="ulText" class="meterText"></div>
<div class="unit">Mbps</div>
<div class="unit">Mbit/s</div>
</div>
</div>
<div id="ipArea">

View file

@ -162,7 +162,7 @@ function drawImage($speedtest)
$POSITION_Y_WATERMARK = 223 * $SCALE;
// configure labels
$MBPS_TEXT = 'Mbps';
$MBPS_TEXT = 'Mbit/s';
$MS_TEXT = 'ms';
$PING_TEXT = 'Ping';
$JIT_TEXT = 'Jitter';

View file

@ -92,7 +92,7 @@ if(!isset($db_type) || $db_type != 'postgresql'){
echo $failed;
}
?>
</td><td>Only required if using sqlite.</td></tr>
</td><td>Only required if using postgresql.</td></tr>
<tr><td colspan="3" class='SectionHeading'>Database check</td></tr>

View file

@ -27,9 +27,9 @@
}
While in state 1, you can only add test points, you cannot change the test settings. When you're done, use selectServer(callback) to select the test point with the lowest ping. This is asynchronous, when it's done, it will call your callback function and move to state 2. Calling setSelectedServer(server) will manually select a server and move to state 2.
- 2: test point selected, ready to start the test. Use start() to begin, this will move to state 3
- 3: test running. Here, your onupdate event calback will be called periodically, with data coming from the worker about speed and progress. A data object will be passed to your onupdate function, with the following items:
- dlStatus: download speed in mbps
- ulStatus: upload speed in mbps
- 3: test running. Here, your onupdate event callback will be called periodically, with data coming from the worker about speed and progress. A data object will be passed to your onupdate function, with the following items:
- dlStatus: download speed in Mbit/s
- ulStatus: upload speed in Mbit/s
- pingStatus: ping in ms
- jitterStatus: jitter in ms
- dlProgress: progress of the download test as a float 0-1

View file

@ -60,12 +60,12 @@ var settings = {
garbagePhp_chunkSize: 100, // size of chunks sent by garbage.php (can be different if enable_quirks is active)
enable_quirks: true, // enable quirks for specific browsers. currently it overrides settings to optimize for specific browsers, unless they are already being overridden with the start command
ping_allowPerformanceApi: true, // if enabled, the ping test will attempt to calculate the ping more precisely using the Performance API. Currently works perfectly in Chrome, badly in Edge, and not at all in Firefox. If Performance API is not supported or the result is obviously wrong, a fallback is provided.
overheadCompensationFactor: 1.06, //can be changed to compensatie for transport overhead. (see doc.md for some other values)
overheadCompensationFactor: 1.06, //can be changed to compensate for transport overhead. (see doc.md for some other values)
useMebibits: false, //if set to true, speed will be reported in mebibits/s instead of megabits/s
telemetry_level: 0, // 0=disabled, 1=basic (results only), 2=full (results and timing) 3=debug (results+log)
url_telemetry: "results/telemetry.php", // path to the script that adds telemetry data to the database
telemetry_extra: "", //extra data that can be passed to the telemetry through the settings
forceIE11Workaround: false //when set to true, it will foce the IE11 upload test on all browsers. Debug only
forceIE11Workaround: false //when set to true, it will force the IE11 upload test on all browsers. Debug only
};
var xhr = null; // array of currently active xhr requests
@ -423,7 +423,7 @@ function dlTest(done) {
200
);
}
// upload test, calls done function whent it's over
// upload test, calls done function when it's over
var ulCalled = false; // used to prevent multiple accidental calls to ulTest
function ulTest(done) {
tverb("ulTest");
@ -474,7 +474,7 @@ function ulTest(done) {
}
}
if (ie11workaround) {
// IE11 workarond: xhr.upload does not work properly, therefore we send a bunch of small 256k requests and use the onload event as progress. This is not precise, especially on fast connections
// IE11 workaround: xhr.upload does not work properly, therefore we send a bunch of small 256k requests and use the onload event as progress. This is not precise, especially on fast connections
xhr[i].onload = xhr[i].onerror = function() {
tverb("ul stream progress event (ie11wa)");
totLoaded += reqsmall.size;