From 218c427552efd6686a886b99f30a90759cc616a8 Mon Sep 17 00:00:00 2001 From: Amir Date: Mon, 29 Dec 2025 19:23:31 -0300 Subject: [PATCH] docs: document NATIVE_SPEEDTEST_PATH config option - Added details for NATIVE_SPEEDTEST_PATH to the README under 'Usage'. - Explained default behavior and included examples for overriding the binary location. - Added a verbose log to print the binary path when the plugin starts up. --- front/plugins/internet_speedtest/README.md | 10 ++++++++++ front/plugins/internet_speedtest/script.py | 1 + 2 files changed, 11 insertions(+) diff --git a/front/plugins/internet_speedtest/README.md b/front/plugins/internet_speedtest/README.md index 933d2f07..898b2c67 100755 --- a/front/plugins/internet_speedtest/README.md +++ b/front/plugins/internet_speedtest/README.md @@ -8,6 +8,16 @@ This plugin supports two engines: 1. **Baseline Engine**: Uses the Python `speedtest-cli` library (default). 2. **Native Engine (Optimized)**: Uses the official native Ookla Speedtest binary. +#### Native Speedtest Path +The plugin looks for the Speedtest binary at `/usr/bin/speedtest` by default. If the binary is located elsewhere, you can configure the path using the `NATIVE_SPEEDTEST_PATH` environment variable: + +Example: +```env +NATIVE_SPEEDTEST_PATH=/custom/path/to/speedtest +``` + +If this variable is left unset, the plugin assumes `/usr/bin/speedtest`. + #### Opt-in for Native Engine To use the native engine, you must provide the official binary to the container. The native binary is **strongly recommended** for internet connections > 100 Mbps to ensure CPU bottlenecks don't affect your results. diff --git a/front/plugins/internet_speedtest/script.py b/front/plugins/internet_speedtest/script.py index 0385246b..a324a805 100755 --- a/front/plugins/internet_speedtest/script.py +++ b/front/plugins/internet_speedtest/script.py @@ -50,6 +50,7 @@ def main(): def run_speedtest(): native_path = NATIVE_SPEEDTEST_PATH + mylog('verbose', [f"[INTRSPD] Using native binary path: {native_path}"]) if os.path.exists(native_path): mylog('verbose', ["[INTRSPD] Native speedtest binary detected, using it."]) try: