]> git.openstreetmap.org Git - chef.git/blob - cookbooks/tilecache/templates/default/squid.conf.erb
TEMPORARY unblock of osmdroid-based apps which should be setting their unique User...
[chef.git] / cookbooks / tilecache / templates / default / squid.conf.erb
1 acl osmtile_sites dstdomain a.tile.openstreetmap.org b.tile.openstreetmap.org c.tile.openstreetmap.org tile.openstreetmap.org a.tile.osm.org b.tile.osm.org c.tile.osm.org tile.osm.org
2 acl osmtiles_png urlpath_regex .png$
3
4 acl osmtileScrapers browser ^$
5 acl osmtileScrapers browser ^MOBAC
6 acl osmtileScrapers browser ^JTileDownloader
7 acl osmtileScrapers browser ^Apache\-HttpClient
8 acl osmtileScrapers browser ^Opera\/10\.00
9 acl osmtileScrapers browser ^shipxy01
10 #acl osmtileScrapers browser ^OsmAnd #Victor + Email. Whitelist for 1 week
11 #acl osmtileScrapers browser ^apemap #CGI143 + Email. Whitelist for 1 week
12 acl osmtileScrapers browser Firefox\/2\.0\.0\.11$
13 #acl osmtileScrapers browser Firefox\/3\.5\.7$ #CGI285 + Email. Whitelist for 1 week
14 acl osmtileScrapers browser Firefox\/3\.6$
15 acl osmtileScrapers browser ^Mozilla\/5\.0$ #QLandkarte unwilling to set a real user-agent.
16 acl osmtileScrapers browser ^Mozilla$ #Intentionally faked user-agent
17 acl osmtileScrapers browser ^User\-Agent
18 acl osmtileScrapers browser Firefox\/0\.8$
19 acl osmtileScrapers browser Firefox\/1\.0$
20 acl osmtileScrapers browser Firefox\/1\.0\.7$
21 acl osmtileScrapers browser K\-Meleon\/1\.02$
22 acl osmtileScrapers browser MSIE.7\.0.*Windows.NT.5\.1.*2\.0\.50727.$
23 acl osmtileScrapers browser MSIE.5.5
24 acl osmtileScrapers browser ^LoadOSM\.exe$
25 acl osmtileScrapers browser ^app_name$
26 # TEMPORARY unblock of osmdroid-based apps which should be setting their unique
27 # User-Agent, but aren't. Re-block on/near 2016-08-29.
28 #acl osmtileScrapers browser ^osmdroid$ # app using osmdroid library not setting app-specific User-Agent
29 #acl osmtileScrapers browser ^Mozilla/5\.0 \(Windows NT 5\.1\)$ # Faked User-Agent
30
31 http_access deny osmtile_sites osmtileScrapers
32
33 acl osmtileOverusers referer_regex ^https?://pmap\.kuku\.lu/
34 acl osmtileOverusers referer_regex ^https?://[^.]*\.pmap\.kuku\.lu/
35 acl osmtileOverusers referer_regex ^https?://fastpokemap\.com/
36 acl osmtileOverusers referer_regex ^https?://[^.]*\.fastpokemap\.com/
37
38 http_access deny osmtile_sites osmtileOverusers
39
40 # Delay pool when !has_referer and is_browser
41 acl has_referer referer_regex .
42 acl is_browser browser Mozilla
43
44 acl whitelist_path urlpath_regex ^/cgi-bin/(export|debug)
45 acl blacklist_path urlpath_regex ^/cgi-bin/
46 acl blacklist_path urlpath_regex ^/MyAdmin/
47 acl blacklist_path urlpath_regex ^/myadmin/
48 acl blacklist_path urlpath_regex ^/pma/
49 acl blacklist_path urlpath_regex ^/phpmyadmin/
50 acl blacklist_path urlpath_regex ^/phpMyAdmin/
51 acl blacklist_path urlpath_regex ^/idssvc/
52 acl blacklist_path urlpath_regex ^/iesvc/
53 acl blacklist_path urlpath_regex ^/invoker/
54 acl blacklist_path urlpath_regex ^/jmx-console/
55 acl blacklist_path urlpath_regex ^/manager/
56 acl blacklist_path urlpath_regex ^/service/
57 acl blacklist_path urlpath_regex ^/web-console/
58 acl blacklist_path urlpath_regex ^/wstats/
59 acl blacklist_path urlpath_regex ^/zecmd/
60
61 http_access allow osmtile_sites whitelist_path
62 http_access deny blacklist_path
63
64 acl requestMethodGet method GET
65
66 http_access allow osmtile_sites requestMethodGet
67
68 acl osmtile_nocache_url urlpath_regex \.png/(status|dirty)$
69 cache deny osmtile_sites osmtile_nocache_url
70
71 <% node[:tilecache][:tile_siblings].each do |sibling| -%>
72 cache_peer <%= sibling %> sibling 3128 3130 weight=1500
73 <% end -%>
74 #Primary Parent
75 cache_peer <%= node[:tilecache][:tile_parent] %> parent 80 0 no-query originserver name=osmtileAccel login=PASS connect-timeout=120 no-digest weight=1000
76 cache_peer_access osmtileAccel allow osmtile_sites
77
78 #Backup Parents
79 <% @renders.each do |renders| -%>
80 cache_peer <%= renders[:hostname] %>.render.openstreetmap.org parent 80 0 no-query originserver name=osmtileAccelBackup<%= renders[:hostname] %> login=PASS connect-timeout=60 no-digest weight=10
81 cache_peer_access osmtileAccelBackup<%= renders[:hostname] %> allow osmtile_sites
82 <% end -%>
83
84 #----------------------------------
85 #Create an unlimited pool for cache IP addresses
86 acl pool_unlimited src 127.0.0.1
87 <% @caches.each do |cache| -%>
88 <% cache.ipaddresses(:family => :inet, :role => :external).sort.each do |address| -%>
89 acl pool_unlimited src <%= address %>
90 acl tile_caches src <%= address %>
91 <% end -%>
92 <% end -%>
93 #AOL External (London Hack Weekend)
94 acl pool_unlimited src 64.236.163.23
95 #SoTM-US 2014
96 acl pool_unlimited src 66.78.217.141
97 #SoTM-US 2014 Hack Day Red Cross
98 acl pool_unlimited src 162.6.86.34
99 acl pool_unlimited src 162.6.86.35
100 acl pool_unlimited src 162.6.86.36
101 #Telenav Whitelist - mvexel
102 acl pool_unlimited src 108.60.98.6
103 #SoTM-EU 2014
104 acl pool_unlimited src 185.52.244.32/29
105
106 #Allow tile_caches ICP access
107 icp_access allow tile_caches
108
109 <% (0..127).each do |i| -%>
110 acl pool_<%= sprintf("%03d", 2*i) %> src <%= 2*i %>.0.0.0/7
111 <% end %>
112
113 delay_pools 256
114 delay_initial_bucket_level 25
115
116 <% (1..256).each do |i| -%>
117 delay_class <%= i %> 3
118 <% end %>
119 #bit mask
120 # xxxxxxx- -------- xxxxxxxx xxxxxxxx
121
122 # small pools for !has_referer && is_browser - designed to slow down anyone
123 # using no-referer to bypass blocks due to abusive levels of use.
124 <% (0..127).each do |i| -%>
125 delay_access <%= i+1 %> allow pool_<%= sprintf("%03d", 2*i) %> !pool_unlimited !has_referer is_browser osmtile_sites
126 delay_access <%= i+1 %> deny all
127 delay_parameters <%= i+1 %> -1/-1 <%= node[:tilecache][:net_bucket_refill] / 10 %>/<%= node[:tilecache][:net_bucket_size] / 10 %> <%= node[:tilecache][:ip_bucket_refill] / 10 %>/<%= node[:tilecache][:ip_bucket_size] / 10 %>
128 <% end %>
129
130 # bigger pools for users providing a referer (assuming it's not blocked)
131 # or non-browser users.
132 <% (0..127).each do |i| %>
133 delay_access <%= i+129 %> allow pool_<%= sprintf("%03d", 2*i) %> !pool_unlimited osmtile_sites
134 delay_access <%= i+129 %> deny all
135 delay_parameters <%= i+129 %> -1/-1 <%= node[:tilecache][:net_bucket_refill] %>/<%= node[:tilecache][:net_bucket_size] %> <%= node[:tilecache][:ip_bucket_refill] %>/<%= node[:tilecache][:ip_bucket_size] %>
136 <% end %>
137
138 #----------------------------------