Skip to content

Commit

Permalink
add config option to disable the speedtest plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cremesk committed Dec 4, 2024
1 parent 816160e commit e442351
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if [ "$?" -eq 0 ] && [ "$IP" != '10.200.0.1' ]; then
EOM

# tools
if [ "$(uci -qX get ffdd.sys.apache_ddos_prevent)" -eq '0' ]; then
if [ "$(uci -qX get ffdd.sys.apache_ddos_prevent)" -eq '0' ] && [ "$(uci -qX get ffdd.sys.apache_speedtest)" -eq '1' ]; 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>
Expand Down
5 changes: 4 additions & 1 deletion salt/freifunk/base/uci/etc/config/ffdd
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ config 'ffdd' 'sys'
# To disable tunneled clear text passwords and allow only pub-key auth.
option 'ssh_pwauth' '1'

# To disable ddos protection in apache2 (0=off 1=on)
# DDOS-protection in apache2 (0=off 1=on)
option 'apache_ddos_prevent' '1'

# speedtest plugin (0=off 1=on) (needs a disabled apache_ddos_prevent)
option 'apache_speedtest' '1'

# DNS-Server
list 'default_dns' '194.150.168.168'
list 'default_dns' '5.9.164.112'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
## ffdd.sys

test -z "$(uci -qX get ffdd.sys.devmode)" && uci -q set ffdd.sys.devmode=0
test -z "$(uci -qX get ffdd.sys.apache_ddos_prevent)" && uci -q set ffdd.sys.apache_ddos_prevent=1

test -z "$(uci -qX get ffdd.sys.network_id)" && uci -q set ffdd.sys.network_id=0
test -z "$(uci -qX get ffdd.sys.community_server)" && uci -q set ffdd.sys.community_server=0

Expand All @@ -16,6 +14,8 @@
test -z "$(uci -qX get ffdd.sys.group_id)" && uci -q set ffdd.sys.group_id=0
test -z "$(uci -qX get ffdd.sys.firewall_log)" && uci -q set ffdd.sys.firewall_log=0

test -z "$(uci -qX get ffdd.sys.apache_ddos_prevent)" && uci -q set ffdd.sys.apache_ddos_prevent=1
test -z "$(uci -qX get ffdd.sys.apache_speedtest)" && uci -q set ffdd.sys.apache_speedtest=1

## ffdd.wireguard

Expand Down

0 comments on commit e442351

Please sign in to comment.