From c00ad26abe3bd280eadcbbbc2a587056f3640dea Mon Sep 17 00:00:00 2001 From: Stefan Stidl Date: Sun, 1 Dec 2024 22:08:51 +0100 Subject: [PATCH 1/2] fix permissions on db file --- docker/entrypoint.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 96c19460f..5414eae83 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -18,9 +18,13 @@ cp /speedtest/favicon.ico /var/www/html/ # Set custom webroot on alpine if is_alpine; then + echo "ALPINE IMAGE" sed -i "s#\"/var/www/localhost/htdocs\"#\"/var/www/html\"#g" /etc/apache2/httpd.conf +else + echo "DEBIAN IMAGE" fi + # Set up backend side for standlone modes if [[ "$MODE" == "standalone" || "$MODE" == "dual" ]]; then cp -r /speedtest/backend/ /var/www/html/backend @@ -82,9 +86,9 @@ if [[ "$TELEMETRY" == "true" && ("$MODE" == "frontend" || "$MODE" == "standalone mkdir -p /database/ if is_alpine; then - chown apache /database/ + chown -R apache /database/ else - chown www-data /database/ + chown -R www-data /database/ fi fi From a177238636fdc52a215ccd991f6931b90ebe97b0 Mon Sep 17 00:00:00 2001 From: sstidl Date: Sun, 1 Dec 2024 22:44:37 +0100 Subject: [PATCH 2/2] improve test scripts --- docker/test/docker-compose.yml | 16 +++++++++++++--- docker/test/test-script.sh | 14 ++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 docker/test/test-script.sh diff --git a/docker/test/docker-compose.yml b/docker/test/docker-compose.yml index 918fe74a7..b04e18f18 100644 --- a/docker/test/docker-compose.yml +++ b/docker/test/docker-compose.yml @@ -2,7 +2,7 @@ ## do not use it in production services: - ###################### POSTGRESQL ################################ +###################### POSTGRESQL ################################ pg: image: postgres:alpine environment: @@ -39,7 +39,7 @@ services: ports: - 9124:8080 - ####################### MYSQL ############################## +####################### MYSQL ############################## mysql: image: mysql:lts @@ -79,7 +79,8 @@ services: ports: - 9126:8080 - ###### SQLITE ###### +################ SQLITE #################################### + speedtest-debian-sqlite: # check at http://localhost:9125/results/sanitycheck.php build: @@ -102,3 +103,12 @@ services: environment: *env_vars_sqlite ports: - 9128:8080 + +############## TEST CONTAINER ############################################################### + test-container: + image: alpine + volumes: + - ./test-script.sh:/test-script.sh + command: + - sh + - /test-script.sh diff --git a/docker/test/test-script.sh b/docker/test/test-script.sh new file mode 100644 index 000000000..27d236014 --- /dev/null +++ b/docker/test/test-script.sh @@ -0,0 +1,14 @@ +PORT=8080 + +apk add w3m + +echo sleeping a little to get things setteled... +sleep 10 + +for db in sqlite pg mysql; do + for distro in alpine debian; do + hostname=speedtest-$distro-$db + echo $hostname + w3m -dump http://$hostname:$PORT/results/sanitycheck.php|grep -v 'N/A' + done +done