librespeed / speedtest

Self-hosted Speed Test for HTML5 and more. Easy setup, examples, configurable, mobile friendly. Supports PHP, Node, Multiple servers, and more
https://librespeed.org
GNU Lesser General Public License v3.0
12.2k stars 2.2k forks source link

Issues with docker alpine image #664

Open Phhere opened 1 month ago

Phhere commented 1 month ago

Description

Some php extensions are missing and some features are broken

Server

Debian 12 Server with latest alpine image

Client

Browser, OS, type of connection, unusual software, ...

Steps to reproduce

Expected behaviour

Stats should be saved and results/stats.php should work

Logs


[Wed Sep 18 20:26:49.174960 2024] [php:error] [pid 24:tid 24] [client 130.226.71.21:54899] PHP Fatal error:  Uncaught Error: Class "PDO" not found in /var/www/html/results/telemetry_db.php:32\nStack trace:\n#0 /var/www/html/results/telemetry_db.php(179): getPdo()\n#1 /var/www/html/results/telemetry.php(38): insertSpeedtestUser()\n#2 {main}\n  thrown in /var/www/html/results/telemetry_db.php on line 32, referer: http://speedtest.hhu.de/speedtest_worker.js?r=0.3096700804744398
[Wed Sep 18 20:27:43.352163 2024] [php:error] [pid 26:tid 26] [client 134.99.4.16:54232] PHP Fatal error:  Uncaught Error: Call to undefined function session_start() in /var/www/html/results/stats.php:2\nStack trace:\n#0 {main}\n  thrown in /var/www/html/results/stats.php on line 2
sstidl commented 1 month ago

Please tell us the docker compose file or command line how you start the container

Phhere commented 1 month ago

I used this docker-compose file

speedtest# cat docker-compose.yml 
version: '3.7'
services:
  speedtest:
    container_name: speedtest
    image: ghcr.io/librespeed/speedtest:latest-alpine
    restart: always
    environment:
      MODE: standalone
      TITLE: "HHU-Speedtest"
      TELEMETRY: "true"
      #ENABLE_ID_OBFUSCATION: "false"
      #REDACT_IP_ADDRESSES: "false"
      PASSWORD: "redacted"
      EMAIL: "redacted@test"
      #DISABLE_IPINFO: "false"
      #IPINFO_APIKEY: "your api key"
      #DISTANCE: "km"
      #WEBPORT: 80
    volumes:
      - $PWD/db-dir:/database
    ports:
      - "80:80" # webport mapping (host:container)
sstidl commented 1 month ago

Bug confirmed.

Some dependencies are missing in alpine based image.

sstidl commented 1 week ago

0c31f1de6d03e8d39150ef354be8750d3f72a341 should fix this