Speedtest Web GUI Addon

Hello All,

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.

Here are screenshots of the pages:

And a closer look at the configuration section:

Here are installation instructions:
INSTALL.pdf (133.7 KB)

And a user’s guide:
speedtest-webgui.pdf (135.3 KB)

And the addon tarball:
speedtest-webgui-0.8.3-1.ipfire.tar.gz (300 KB)

b2sum:
c42049bde6a339a40e62372cd89a7a5f97ddc542e574da4dde1a84619fbbb4860ea9195f741ac209f05c7277f348036c8b1b063afc6dd2a663f008d75aa94e3e

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!

Happy Speedtesting!

Regards,
Stephen

1 Like

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.

just some input to help improve it!

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:

my $settings_file = "${General::swroot}/speedtest-webgui/settings";
unless (-f $settings_file) { &General::system("mkdir", "${General::swroot}/speedtest-webgui") };
unless (-f $settings_file) { &General::system("touch", "$settings_file") };

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. :slight_smile:
I’ll go ahead and change that.

Regards,
Stephen

1 Like

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:

#use warnings;
#use CGI::Carp 'fatalsToBrowser';
use warnings;
use CGI::Carp 'fatalsToBrowser';

Maybe get some additional error information…

Regards,
Stephen

renamed the settings file and

[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.

drwxr-xr-x 2 root root 4096 Jan 11 18:38 speedtest-webgui

keep in mind i manually created the dir and file so i just did

[root@ipsio ipfire]# chown nobody:nobody speedtest-webgui

and it created the settings file.

ipfire dir perms look like

drwxr-xr-x 57 root   root    4096 Jan 11 16:51 ipfire

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.

These are what the directory and file permissions look like on my system.

drwxrwxr-x 49 nobody nobody 4096 Jan 11 16:56 ipfire
drwxr-xr-x 2 nobody nobody 4096 Jan 11 16:56 speedtest-webgui
-rw-r–r-- 1 nobody nobody 0 Jan 11 16:56 settings

I did an uninstall and verified all of the files were cleaned up, reinstalled before listing the permissions.

Your ipfire directory has ownership/permissions root:root 755, mine is nobody:nobody 775. That would explain it.

Have you changed those ownership/permissions for the ipfire directory? Maybe a restore would do that?

Regards,
Stephen

its possible, yet i haven’t had issues with anything else…odd

just logged onto the ipfire at work and

4 drwxr-xr-x 53 root   root    4096 Jan  2 06:51 ipfire

I checked a couple of other firewalls in my network and they are all:

drwxrwxr-x 49 nobody nobody 4096 Jan 8 13:35 ipfire

I wonder if this is a difference between x86_64 and aarch64 builds.

All of our firewalls are aarch64. Are you running on x86_64?

Regards,
Stephen

yes they are

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.

Thanks for finding this!

Regards,
Stephen

@siosios I installed the tarball on my x86_64 VM and was able to reproduce the error you’re seeing.

I did the following:

cd /var/ipfire
mkdir speedtest-webgui
chown nobody:nobody speedtest-webgui

Without any other changes.

I reloaded the pages and it worked. Can you confirm that the same works for you please?

Regards,
Stephen

Yes that worked for me when I manually created the folder and did the chmod.

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.

Thanks again for your help!

Regards,
Stephen

1 Like

is log file statistics supposed to look like this?

Logging to file:  /var/log/speedtest.csv.log

   File: /var/log/speedtest.csv.log
   Size: 135       	Blocks: 8          IO Block: 4096   regular file
 Device: 259,4	Inode: 28183227    Links: 1
 Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
 Access: 2025-01-12 05:48:29.248060763 -0600
 Modify: 2025-01-12 00:01:21.185855383 -0600
 Change: 2025-01-12 00:01:21.185855383 -0600
  Birth: 2025-01-12 00:01:21.185855383 -0600

Number of records in the logfile:  1

just saw that it ran overnight like it was setup to do

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…

Regards,
Stephen

Hello,

I updated the first post of this topic with a new version of the Speedtest Web GUI addon.

The changes are:

Change ‘Logfile Statistics’ to ‘Status’ and include some basic status information that is hopefully more useful than the previous ‘stat’ output.

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.

Happy Speedtesting!

Regards,
Stephen

1 Like

I’m not seeing the download link or the b2sum

Sorry, little issue with the save on that one. It should be there now.

Regards,
Stephen

1 Like

hello
I make a small contribution to this project
I attach the translation into Italian
speedtest.it.zip (1,3 KB)