Compare commits

...

51 commits

Author SHA1 Message Date
Federico Dossena
dd1ce2cb88 Fixed vulnerability in json.php caused my missing Content-Type header 2024-04-27 15:12:32 +02:00
sstidl
748f49c3b6
build docker images on schedule
to ensure docker image updates, we build the image once a week
2024-04-15 11:49:40 +02:00
sstidl
4640c64412
revert .github/workflows/snyk-security.yml
was an accident. sorry. but we got a freshdocker image without php8 bugs this way ;-)
2024-04-15 11:29:24 +02:00
sstidl
5b17b397c5
Create snyk-security.yml 2024-04-15 08:06:48 +02:00
sstidl
a51b59aa1a
Merge pull request #540 from JoKneeMo/master
Add dual mode to enable standalone operation with other test servers
2024-02-07 17:32:25 +01:00
sstidl
3f3faeb6a1
Merge pull request #597 from thgoebel/mention-cli
Mention CLI client in Readme
2024-02-02 16:03:49 +01:00
sstidl
c1974d5a53
fix #598 2024-02-02 15:56:48 +01:00
Thore Goebel
a6ae760279 Mention CLI client in Readme 2024-01-31 22:46:46 +01:00
sstidl
022c2a976f
Merge pull request #590 from librespeed/dev
Docker images for ARM64
2023-12-02 12:31:15 +01:00
Stefan Stidl
c32bf52bca correct version string 2023-12-02 12:25:21 +01:00
sstidl
a6c0818b66
Update docker-publish.yml: add arm64 2023-12-02 11:58:20 +01:00
Michael Erdely
6eeda75765
Update speedtest.js (#589)
Bump version
2023-11-29 05:40:24 +01:00
sstidl
05261e608c set single-server-full as index 2023-11-18 14:15:42 +00:00
JoKneeMo
11f698b376 Revert "Set content-type before sending image data for a valid response"
This reverts commit 82d64bff96.
2023-11-08 11:05:47 -05:00
sstidl
c4c87bc144 integrate ios favicon
closes #400
2023-11-08 12:21:59 +00:00
sstidl
2662491132 removed trailing whitespaces 2023-11-06 10:43:06 +01:00
sstidl
21fb3c53aa
Merge pull request #583 from sstidl/dev
Fix ipinfo

Close #511
2023-11-05 02:43:57 +01:00
Stefan Stidl
fee5799a11 fix regression on getIpinfo 2023-11-05 02:27:49 +01:00
Stefan Stidl
9b8faee10d fix ipinfo parsing 2023-11-05 02:08:11 +01:00
sstidl
58e2b413f2
Merge pull request #582 from sstidl/dev
move examples to folder
2023-11-05 01:16:26 +01:00
Stefan Stidl
338b2c27ef move examples to folder 2023-11-05 01:14:02 +01:00
sstidl
74eab590eb
Merge pull request #581 from sstidl/dev
switch units to Mbit/s
2023-11-05 01:08:30 +01:00
Stefan Stidl
63583cb3f4 switch units to Mbit/s 2023-11-05 01:05:50 +01:00
sstidl
32f6e65a2e
Merge pull request #580 from sstidl/switch-docker-repo
Switch docker repo from docker-hub to github packages
2023-11-05 00:43:23 +01:00
Stefan Stidl
b1aa63259c remove signing 2023-11-05 00:35:46 +01:00
Stefan Stidl
e468c3d068 without image signing 2023-11-05 00:20:39 +01:00
Stefan Stidl
7c05ba084e switch docker image location 2023-11-05 00:14:48 +01:00
Stefan Stidl
60ea879bc3 fix action 2023-11-04 23:52:59 +01:00
sstidl
6c92ed8091
Update docker-publish.yml 2023-11-04 23:44:07 +01:00
sstidl
cecf591d0f
Update docker-publish.yml 2023-11-04 23:14:27 +01:00
sstidl
06803a85fa
Merge pull request #512 from AnTheMaker/patch-1
Add descriptive alt-text to GIF in Readme
2023-11-04 15:14:10 +01:00
sstidl
364e6304b0
Merge pull request #1 from sstidl/sstidl-patch-1
Create docker-publish.yml
2023-11-04 02:44:48 +01:00
sstidl
992e24bab6
Create docker-publish.yml 2023-11-04 02:32:32 +01:00
sstidl
bce9ced9ff
Merge pull request #500 from awsles/patch-1
Update README.md
2023-11-04 01:26:54 +01:00
sstidl
197750eef9
Merge pull request #514 from 0kyn/fix-typos
Fix some typos and formatting
2023-11-04 01:24:38 +01:00
sstidl
8fafd70b46
Merge pull request #501 from bt90/patch-2
Link to docker documentation
2023-11-04 01:19:40 +01:00
Stefan STIDL
e0fa5148fe doc: sqlite db persistance explained 2023-11-04 00:35:21 +01:00
Stefan STIDL
013e7d56e2 fix typo 2023-11-04 00:34:33 +01:00
sstidl
34dd410d14
Merge pull request #573 from PeterDaveHelloKitchen/Dockerfile
Clean up apt lists after installation in Dockerfile
2023-11-03 23:41:59 +01:00
sstidl
871ce1a664
Merge pull request #502 from bt90/patch-3
Add basic docker compose example
2023-11-03 23:17:55 +01:00
sstidl
ae07bf2bdc
Merge pull request #570 from zampettim/upgrade-docker-php-82
Updated Docker to use php8.2-apache as the upstream image.
2023-11-03 22:48:39 +01:00
sstidl
bb1506c39a
Update Dockerfile
Co-authored-by: Quentame <polletquentin74@me.com>
2023-11-03 22:48:12 +01:00
Peter Dave Hello
abc85eb8c5 Clean up apt lists after installation in Dockerfile 2023-09-26 00:22:04 +08:00
Marc Zampetti
427edfc416 Updated Docker to use php8.2-apache as the upstream image. 2023-08-09 16:36:48 -04:00
JoKneeMo
20f1f46d1f Docker support for a server that behaves as a standalone frontend AND a backend for another server. 2022-12-11 23:08:46 -05:00
JoKneeMo
82d64bff96 Set content-type before sending image data for a valid response 2022-12-11 22:57:06 -05:00
0kyn
71e3b47130 Fix some typos and formatting 2022-10-03 21:16:26 +02:00
An | Anton Röhm
dd8c5f74f6
add descriptive alt-text to GIF 2022-10-01 13:45:28 +02:00
bt90
16e0fb9bf4
Add basic docker compose example 2022-07-14 17:08:12 +02:00
bt90
d1ca8c2630
Link to docker documentation 2022-07-14 16:45:28 +02:00
Les W
79afc769ea
Update README.md
Added simple manual instructions
2022-07-09 16:13:26 +01:00
7 changed files with 29 additions and 16 deletions

View file

@ -6,8 +6,8 @@ name: Docker
# documentation.
on:
# schedule:
# - cron: '30 20 * * *'
schedule:
- cron: '30 20 * * Sun'
push:
branches: ["*"]
# Publish semver tags as releases.
@ -73,6 +73,7 @@ jobs:
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View file

@ -28,7 +28,7 @@ Works with mobile versions too.
## Server requirements
* A reasonably fast web server with Apache 2 (nginx, IIS also supported)
* PHP 5.4 (other backends also available)
* PHP 5.4 or newer (other backends also available)
* MySQL database to store test results (optional, Microsoft SQL Server, PostgreSQL and SQLite also supported)
* A fast! internet connection
@ -37,7 +37,7 @@ 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
1. Choose one of the example-xxx.html files in `examples` folder as your index.html if the default index.html does not fit.
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.
@ -51,6 +51,9 @@ There is a more in-depth installation video here:
## Android app
A template to build an Android client for your LibreSpeed installation is available [here](https://github.com/librespeed/speedtest-android).
## CLI client
A command line client is available [here](https://github.com/librespeed/speedtest-cli).
## Docker
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.

9
doc.md
View file

@ -109,8 +109,7 @@ A basic front-end for visualizing and searching tests by ID is available in `res
A login is required to access the interface. __Important__: change the default password in `results/telemetry_settings.php`.
#### The end
Now that the test is installed, rename one of the examples to `index.html` and delete the other examples.
The best starting point for most people is `example-singleServer-gauges.html`. If you want to use telemetry and results sharing, use `example-singleServer-full.html` instead.
Now that the test is installed, the default page uses telemetry and results sharing. If you want another index page, rename one of the examples to `index.html` and delete the other examples. The best starting point for most people is `example-singleServer-gauges.html`.
If you're not using telemetry and results sharing, you can delete the `results` folder too.
@ -119,7 +118,7 @@ Details about the examples and how to make custom UIs will be discussed later. I
#### Privacy
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.__
Default `index.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.__
### Multiple servers, PHP
The speed test can automatically choose between multiple test points and use the one with the lowest ping in a list.
@ -240,11 +239,11 @@ __Single server:__
* `example-singleServer-customSettings.html`: Same as `example-singleServer-pretty.html` but configures the test so that it only performs download and upload tests, and with a fixed length instead of automatic
* `example-singleServer-gauges.html`: The most sophisticated example, with the same functionality as `example-singleServer-pretty.html` but adds gauges. This is also a good starting point, but the gauges may slow down underpowered devices
* `example-singleServer-chart.html`: Shows how to use the test with the Chart.js library
* `example-singleServer-full.html`: The most complete example. Based on `example-singleServer-gauges.html`, also enables telemetry and results sharing
* default `index.html`: The most complete example. Based on `example-singleServer-gauges.html`, also enables telemetry and results sharing
__Multiple servers:__
* `example-multipleServers-pretty.html`: Same as `example-singleServer-pretty.html` but with multiple test points. Server selection is fully automatic
* `example-multipleServers-full.html`: Same as `example-singleServer-full.html` but with multiple test points. Server selection is automatic but the server can be changed afterwards by the user
* `example-multipleServers-full.html`: Same as default `index.html` but with multiple test points. Server selection is automatic but the server can be changed afterwards by the user
### Initialization
To use the speed test in your page, first you need to load it:

View file

@ -139,3 +139,10 @@ This command starts LibreSpeed in frontend mode, with a given `servers.json` fil
```
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
```
### Dual mode
In dual mode, LibreSpeed operates as a standalone server that can also connect to other test points.
To do this:
* Set the `MODE` environment variable to `dual`
* Follow the `servers.json` instructions for the frontend mode
* The first server entry should be the local server, using the server endpoint address that a client can access.

View file

@ -13,7 +13,7 @@ cp /speedtest/*.js /var/www/html/
cp /speedtest/favicon.ico /var/www/html/
# Set up backend side for standlone modes
if [ "$MODE" == "standalone" ]; then
if [[ "$MODE" == "standalone" || "$MODE" == "dual" ]]; then
cp -r /speedtest/backend/ /var/www/html/backend
if [ ! -z "$IPINFO_APIKEY" ]; then
sed -i s/\$IPINFO_APIKEY\ =\ \'\'/\$IPINFO_APIKEY\ =\ \'$IPINFO_APIKEY\'/g /var/www/html/backend/getIP_ipInfo_apikey.php
@ -28,14 +28,14 @@ if [ "$MODE" == "backend" ]; then
fi
# Set up index.php for frontend-only or standalone modes
if [ "$MODE" == "frontend" ]; then
if [[ "$MODE" == "frontend" || "$MODE" == "dual" ]]; then
cp /speedtest/frontend.php /var/www/html/index.php
elif [ "$MODE" == "standalone" ]; then
cp /speedtest/standalone.php /var/www/html/index.php
fi
# Apply Telemetry settings when running in standalone or frontend mode and telemetry is enabled
if [[ "$TELEMETRY" == "true" && ( "$MODE" == "frontend" || "$MODE" == "standalone" ) ]]; then
if [[ "$TELEMETRY" == "true" && ( "$MODE" == "frontend" || "$MODE" == "standalone" || "$MODE" == "dual" ) ]]; then
cp -r /speedtest/results /var/www/html/results
if [ "$MODE" == "frontend" ]; then

View file

@ -1,5 +1,8 @@
<?php
error_reporting(0);
header('Content-Type: application/json; charset=utf-8');
require_once 'telemetry_db.php';
/**
@ -53,7 +56,7 @@ function formatSpeedtestData($speedtest)
$speedtest = getSpeedtestUserById($_GET['id']);
if (!is_array($speedtest)) {
echo '{}';
} else {
$speedtest = formatSpeedtestData($speedtest);
echo json_encode(array('timestamp'=>$speedtest['timestamp'],'download'=>$speedtest['dl'],'upload'=>$speedtest['ul'],'ping'=>$speedtest['ping'],'jitter'=>$speedtest['jitter'],'ispinfo'=>$speedtest['ispinfo']));
}
$speedtest = formatSpeedtestData($speedtest);
echo json_encode(array('timestamp'=>$speedtest['timestamp'],'download'=>$speedtest['dl'],'upload'=>$speedtest['ul'],'ping'=>$speedtest['ping'],'jitter'=>$speedtest['jitter'],'ispinfo'=>$speedtest['ispinfo']));

View file

@ -49,7 +49,7 @@ function Speedtest() {
this._settings = {}; //settings for the speed test worker
this._state = 0; //0=adding settings, 1=adding servers, 2=server selection done, 3=test running, 4=done
console.log(
"LibreSpeed by Federico Dossena v5.2.5 - https://github.com/librespeed/speedtest"
"LibreSpeed by Federico Dossena v5.3.1 - https://github.com/librespeed/speedtest"
);
}