]> git.openstreetmap.org Git - chef.git/commitdiff
Whitelist all rails frontends for nominatim
authorTom Hughes <tom@compton.nu>
Fri, 24 Apr 2020 21:18:14 +0000 (22:18 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 24 Apr 2020 21:18:14 +0000 (22:18 +0100)
cookbooks/nominatim/recipes/default.rb
cookbooks/nominatim/templates/default/nginx.erb

index faf80756c072a97a09e80c1e37518350f3d271dc..04cedf1fea5dbd344b2bd3ca2f15cc6ff2d00a06 100644 (file)
@@ -367,6 +367,7 @@ nginx_site "nominatim" do
   template "nginx.erb"
   directory build_directory
   variables :pools => node[:nominatim][:fpm_pools],
+            :frontends => search(:node, "recipes:web\\:\\:frontend"),
             :confdir => "#{basedir}/etc"
 end
 
index 07ff0a52e93050318044cad54e8ea1ba184fcb9c..3ba96466015636e5c292704108e40e11a001fd6e 100644 (file)
@@ -19,17 +19,11 @@ upstream nominatim_service {
 # Whitelisted IPs
 geo $whitelisted {
     default 0;
-    2001:978:2:2c::172:6 1;
-    2001:978:2:2c::172:7 1;
-    2001:978:2:2c::172:8 1;
-    2001:978:2:2c::172:b 1;
-    2001:978:2:2c::172:c 1;
-    2001:978:2:2c::172:d 1;
-    130.117.76.6 1;
-    130.117.76.7 1;
-    130.117.76.8 1;
-    89.16.162.21 1;
-    89.16.162.22 1;
+<% @frontends.each do |frontend| -%>
+<% frontend.ipaddresses(:role => :external) do |address| -%>
+    <%= address %>;
+<% end -%>
+<% end -%>
     46.235.224.148 1;
     209.132.180.180 1;
     209.132.180.168 1;