Skip to content

Commit

Permalink
add speedtest web-ui tool
Browse files Browse the repository at this point in the history
  • Loading branch information
cremesk committed Nov 11, 2024
1 parent 641d85c commit 1039a99
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

## version 1.6.0rc1
- add support for ubuntu 24.04 (LTS)
- add speedtest web-ui tool

## version 1.5.1rc1
- fix salt installation and change to new salt repo
Expand Down
22 changes: 22 additions & 0 deletions salt/freifunk/base/ddmesh/var/www_freifunk/05-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Show Tools only for internal FFDD-Network clients

# FFDD-Network
ALLOWED_IP="10.200.0.0/15"
# get REMOTE_ADDR from CGI ENV
IP="$REMOTE_ADDR"

check_cidr="/usr/bin/grepcidr $ALLOWED_IP <(echo $IP) >/dev/null"
eval "$check_cidr"

hostname_short="$(cat /etc/hostname | awk -F'.' '{print $1}')"

# exclude network != FFDD-Network and NAT'ed Rules from ipX/nodeX.freifunk-dresden.de
if [ "$?" -eq 0 ] && [ "$IP" != '10.200.0.1' ]; then
if [ "$(uci -qX get ffdd.sys.apache_ddos_prevent)" -eq '0' ]; then
cat <<-EOM
<TR><TD><BIG CLASS="plugin">Tools</BIG></TD></TR>
<TR><TD><DIV CLASS="plugin"><A CLASS="plugin" TARGET="_blank" HREF="http://speedtest.$hostname_short.ffdd/">Speedtest</A></DIV></TD></TR>
EOM
fi
fi
3 changes: 1 addition & 2 deletions salt/freifunk/base/ddmesh/var/www_freifunk/css/ff.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ A:active {
color: crimson;
}
A:hover {
color: darkmagenta;
color: darkmagenta;
}
A.form:link,A.form:visited,A.form:active,
A.color:link,A.color:visited,A.color:active,
Expand Down Expand Up @@ -360,4 +360,3 @@ form
border: 0px;
text-align: right;
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
# redirect if not found, to avoid displaying other internal stuff
ErrorDocument 404 /

DocumentRoot /var/www_speedtest/backend
<Directory /var/www_speedtest/backend>
Header set Access-Control-Allow-Origin '*'

DocumentRoot /var/www_speedtest
<Directory /var/www_speedtest>
AllowOverride None
Options -Indexes +MultiViews +FollowSymLinks +Includes
Require all granted
Expand Down

0 comments on commit 1039a99

Please sign in to comment.