]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/nominatim/recipes/default.rb
nominatim: add hook for more generic blocks
[chef.git] / cookbooks / nominatim / recipes / default.rb
index 0a9172b4b778c23cbd37ddf0c0ff631f25b5190e..fd7f495734f6d5ba9960f2baa6d994e7b9adb791 100644 (file)
@@ -174,6 +174,7 @@ package %w[
 
 source_directory = "#{basedir}/nominatim"
 build_directory = "#{basedir}/bin"
+ui_directory = "#{basedir}/ui"
 
 directory build_directory do
   owner "nominatim"
@@ -226,6 +227,21 @@ template "#{build_directory}/settings/local.php" do
             :log_file => "#{node[:nominatim][:logdir]}/query.log"
 end
 
+git ui_directory do
+  action :sync
+  repository node[:nominatim][:ui_repository]
+  revision node[:nominatim][:ui_revision]
+  user "nominatim"
+  group "nominatim"
+end
+
+template "#{ui_directory}/dist/config.js" do
+  source "ui-config.js.erb"
+  owner "nominatim"
+  group "nominatim"
+  mode "664"
+end
+
 if node[:nominatim][:flatnode_file]
   directory File.dirname(node[:nominatim][:flatnode_file]) do
     recursive true
@@ -354,7 +370,7 @@ directory "#{basedir}/etc" do
   mode "775"
 end
 
-%w[user_agent referrer email].each do |name|
+%w[user_agent referrer email generic].each do |name|
   file "#{basedir}/etc/nginx_blocked_#{name}.conf" do
     action :create_if_missing
     owner "nominatim"
@@ -401,7 +417,8 @@ nginx_site "nominatim" do
   directory build_directory
   variables :pools => node[:nominatim][:fpm_pools],
             :frontends => search(:node, "recipes:web\\:\\:frontend"),
-            :confdir => "#{basedir}/etc"
+            :confdir => "#{basedir}/etc",
+            :ui_directory => ui_directory
 end
 
 template "/etc/logrotate.d/nginx" do