From 1039a9910453f54b8544a64a0d9e32d64a629872 Mon Sep 17 00:00:00 2001 From: creme Date: Mon, 11 Nov 2024 17:06:49 +0100 Subject: [PATCH] add speedtest web-ui tool --- CHANGELOG.md | 1 + .../base/ddmesh/var/www_freifunk/05-tools.sh | 22 +++++++++++++++++++ .../base/ddmesh/var/www_freifunk/css/ff.css | 3 +-- .../speedtest-backend.conf.tmpl | 6 +++-- 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100755 salt/freifunk/base/ddmesh/var/www_freifunk/05-tools.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ca00c79..d5aa38db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/salt/freifunk/base/ddmesh/var/www_freifunk/05-tools.sh b/salt/freifunk/base/ddmesh/var/www_freifunk/05-tools.sh new file mode 100755 index 00000000..df16e541 --- /dev/null +++ b/salt/freifunk/base/ddmesh/var/www_freifunk/05-tools.sh @@ -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 + Tools +
Speedtest
+ EOM + fi +fi diff --git a/salt/freifunk/base/ddmesh/var/www_freifunk/css/ff.css b/salt/freifunk/base/ddmesh/var/www_freifunk/css/ff.css index 99cc622c..0abe35d9 100755 --- a/salt/freifunk/base/ddmesh/var/www_freifunk/css/ff.css +++ b/salt/freifunk/base/ddmesh/var/www_freifunk/css/ff.css @@ -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, @@ -360,4 +360,3 @@ form border: 0px; text-align: right; } - diff --git a/salt/freifunk/base/tools/etc/apache2/sites-available/speedtest-backend.conf.tmpl b/salt/freifunk/base/tools/etc/apache2/sites-available/speedtest-backend.conf.tmpl index 86fa7387..c9065bc4 100644 --- a/salt/freifunk/base/tools/etc/apache2/sites-available/speedtest-backend.conf.tmpl +++ b/salt/freifunk/base/tools/etc/apache2/sites-available/speedtest-backend.conf.tmpl @@ -6,8 +6,10 @@ # redirect if not found, to avoid displaying other internal stuff ErrorDocument 404 / - DocumentRoot /var/www_speedtest/backend - + Header set Access-Control-Allow-Origin '*' + + DocumentRoot /var/www_speedtest + AllowOverride None Options -Indexes +MultiViews +FollowSymLinks +Includes Require all granted