]> git.openstreetmap.org Git - rails.git/commitdiff
Use a script to pull in host blocks and add some robot blocks from
authorTom Hughes <tom@compton.nu>
Tue, 15 Dec 2009 22:39:51 +0000 (22:39 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 15 Dec 2009 22:39:51 +0000 (22:39 +0000)
the live server.

config/lighttpd-host-blocks.sh [new file with mode: 0644]
config/lighttpd.conf

diff --git a/config/lighttpd-host-blocks.sh b/config/lighttpd-host-blocks.sh
new file mode 100644 (file)
index 0000000..3022e74
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ -d /etc/firewall ]
+then
+  for ip in $(ls /etc/firewall)
+  do
+    echo "\$HTTP[\"remoteip\"] == \"$ip\" { url.access-deny = (\"\") }"
+  done
+fi
index 4d7a7f4ab2d535416f0c6da8f0240f89e03011cb..a224f4562bc780127d73aec20a81f8f77c246a65 100644 (file)
@@ -39,10 +39,17 @@ $HTTP["remoteip"] == "128.40.168.98" {
 }
 
 #
 }
 
 #
-# IP blocked at SteveC's request as it was trying to download the
-# history of every object in the database one at a time
+# Pull in host blocks
 #
 #
-$HTTP["remoteip"] == "143.210.16.160" { url.access-deny = ("") }
+include_shell "lighttpd-host-blocks.sh"
+
+#
+# Block some troublesome robots
+#
+$HTTP["useragent"] =~ "msnbot" { url.access-deny = ("") }
+$HTTP["useragent"] =~ "Twiceler" { url.access-deny = ("") }
+$HTTP["useragent"] =~ "Baiduspider" { url.access-deny = ("") }
+$HTTP["useragent"] =~ "Sosospider+" { url.access-deny = ("") }
 
 #
 # Rule to block tilesAtHome when somebody decides to queue vast 
 
 #
 # Rule to block tilesAtHome when somebody decides to queue vast