Attached is the latest version of the Speedtest Web GUI addon that I’ve been working on.
This version allows you to either run speedtest and display the results to the screen or schedule speedtest to run at intervals and write the results to a log file for later analysis. The page also includes log file stats and a glimpse at the last 10 records of the log file.
This version doesn’t include a full set of language translations, just the original ones that I did for the run page. If anyone would like to help with language translations it would be much appreciated!
Let me know if you have comments, questions or run into any issues. Feedback is always welcome!
in the install instructions if you already cd to the pakfire tmp dir you dont need the ~/ in this tar -xvf ~/speedtest-webgui-0.8.0-3.ipfire.tar.gz.
also your missing the mkdir command for the creation of /var/ipfire/speedtest-webgui folder and as well as the creation of the settings file.
this is what i got after install in the http error log
Unable to read file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 303.
chmod the settings file so it can be written to
the “run speedtest now” button doesn’t activate the speed test so when you click it on the next screen you have to hit the button to start the speed test.
I wrote the install instructions to start with the tarball being in the /root directory. This is because /opt/pakfire/tmp gets cleaned out nightly and also is used for other Pakfire installs so if you upload the tarball there, it may not be there the next time you go looking for it.
The settings file and directory are created by the cgi the first time that you run it:
I haven’t seen that error in any of my testing. It is thrown by the &General::readhash call. Do you see any errors in your log for the creation of speedtest-webgui/settings directory and file by the cgi?
I had to chuckle when I saw this comment because a friend of mine who was reviewing said the same thing.
I’ll go ahead and change that.
i did the install and went to the page and received a 500 error, that’s when i looked at the log (i refreshed a few times).
[Mon Jan 06 21:10:52.349033 2025] [core:notice] [pid 32209:tid 32209] AH00094: Command line: '/usr/sbin/httpd'
Unable to read file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 303.
[Sat Jan 11 16:43:27.424554 2025] [cgid:error] [pid 32212:tid 32223] [client 192.168.4.100:53254] End of script output before headers: speedtest.cgi, referer: https://192.168.4.1:444/
Unable to read file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 303.
[Sat Jan 11 16:44:53.265506 2025] [cgid:error] [pid 32212:tid 32225] [client 192.168.4.100:53466] End of script output before headers: speedtest.cgi, referer: https://192.168.4.1:444/
Unable to read file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 303.
[Sat Jan 11 16:45:41.633448 2025] [cgid:error] [pid 32212:tid 32247] [client 192.168.4.100:53470] End of script output before headers: speedtest.cgi, referer: https://192.168.4.1:444/
Unable to read file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 303.
[Sat Jan 11 16:45:44.234430 2025] [cgid:error] [pid 32212:tid 32222] [client 192.168.4.100:53505] End of script output before headers: speedtest.cgi, referer: https://192.168.4.1:444/
Unable to read file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 303.
[Sat Jan 11 16:45:45.055669 2025] [cgid:error] [pid 32212:tid 32223] [client 192.168.4.100:53507] End of script output before headers: speedtest.cgi, referer: https://192.168.4.1:444/
Unable to write file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 340.
[Sat Jan 11 16:58:49.707493 2025] [cgid:error] [pid 32212:tid 32224] [client 192.168.4.100:54105] End of script output before headers: speedtest.cgi, referer: https://192.168.4.1:444/
messages log showed
Jan 11 16:43:08 ipsio useradd[27418]: new group: name=speedtest, GID=999
Jan 11 16:43:08 ipsio useradd[27418]: new user: name=speedtest, UID=999, GID=999, home=/var/empty, shell=/bin/false, from=/dev/pts/0
cant find anything else in the logs… WAIT! when i did the install i had the last speedtest installed and deleted the old cgi file when i saw the already installed then ran install again ← maybe thats the why
I don’t think having the old cgi file there would cause this. The End of script output before headers: is strange. I’m asking myself, “What’s the difference between our systems?”
Can you try uncommenting the warnings/errors pragmas in speedtest.cgi:
[Sat Jan 11 16:45:45.055669 2025] [cgid:error] [pid 32212:tid 32223] [client 192.168.4.100:53507] End of script output before headers: speedtest.cgi, referer: https://192.168.4.1:444/
Unable to write file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 340.
[Sat Jan 11 16:58:49.707493 2025] [cgid:error] [pid 32212:tid 32224] [client 192.168.4.100:54105] End of script output before headers: speedtest.cgi, referer: https://192.168.4.1:444/
[Sat Jan 11 18:38:25 2025] speedtest.cgi: Unable to read file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 303.
[Sat Jan 11 18:38:28 2025] speedtest.cgi: Unable to read file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 303.
Edit: did the uninstall and checked for left over files and there are none. did the reinstall and its re-creatable. what do the perms look like for your /var/ipfire dir
[Sat Jan 11 19:02:23.489885 2025] [cgid:error] [pid 32212:tid 32245] [client 192.168.4.100:60490] End of script output before headers: speedtest.cgi, referer: https://192.168.4.1:444/
[Sat Jan 11 19:04:11 2025] speedtest.cgi: Unable to read file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 303.
[Sat Jan 11 19:05:55 2025] speedtest.cgi: Unable to read file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 303.
[Sat Jan 11 19:05:56 2025] speedtest.cgi: Unable to read file /var/ipfire/speedtest-webgui/settings at /var/ipfire/general-functions.pl line 303.
[Sat Jan 11 19:07:25 2025] speedtest.cgi: Use of uninitialized value in concatenation (.) or string at /srv/web/ipfire/cgi-bin/speedtest.cgi line 342.
[Sat Jan 11 19:07:31 2025] speedtest.cgi: Use of uninitialized value in concatenation (.) or string at /srv/web/ipfire/cgi-bin/speedtest.cgi line 342.
Guess what, it’s a difference between x86_64 and aarch64.
I have a copy of CU189 on a VM. I spun that up and yep, the permissions for /var/ipfire there match what you have with root:root 755. Looks like a bug.
I think I can work around that by creating the settings file with the install script though I think you tried that…
I’ll pull the tarball from this topic for now and re-post it when I have a workaround.
To set the record straight, this was not a bug or difference between the x86_64 and aarch64 builds. I traced it down to a problem on my end where I was applying an overlay to /var/ipfire as part of my system configuration. Unintended consequences…
I fixed the install script and changed the ‘Run Speedtest’ button and will get that uploaded.
Yes, it’s the output of a ‘stat’ and a ‘wc -l’. The main information that I wanted to display was the size, creation date and record count for the log file. The Birth timestamp was supposed to be an indication of when speedtest started gathering data.
I noticed this morning that logrotate ran on my system last night and the creation date reset, so my original thought on having the file creation date as an indication of when speedtest started running for the addon gets nullified by the logrotate.
I’ve also used this as a quick visual ‘hey it’s working’ kind of display. I’m rethinking that now since the last 10 records display gives the ‘hey it’s working’ and with logrotate in play, the other information is not the complete picture…
Change logrotate from the default ‘weekly rotate 52’ to ‘monthly rotate 12’ to still keep a year of logs but make it easier to aggregate test results since there will be fewer log files.