]> git.openstreetmap.org Git - chef.git/commitdiff
Allow read access for www-data to support the export script
authorTom Hughes <tom@compton.nu>
Tue, 21 Sep 2021 10:56:18 +0000 (11:56 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 21 Sep 2021 10:56:18 +0000 (11:56 +0100)
cookbooks/tile/recipes/default.rb

index f11c8dc24f41133a276f343451b813e636d8f1f5..f2bfd6a7b0929b39b148217a99cd12cbeabae83b 100644 (file)
@@ -409,6 +409,10 @@ postgresql_user "tile" do
   cluster node[:tile][:database][:cluster]
 end
 
+postgresql_user "www-data" do
+  cluster node[:tile][:database][:cluster]
+end
+
 postgresql_user "_renderd" do
   cluster node[:tile][:database][:cluster]
 end
@@ -443,7 +447,7 @@ end
     cluster node[:tile][:database][:cluster]
     database "gis"
     owner "tile"
-    permissions "tile" => :all, "_renderd" => :select
+    permissions "tile" => :all, "www-data" => :select, "_renderd" => :select
   end
 end
 
@@ -461,6 +465,15 @@ if node[:tile][:database][:external_data_script]
     group "tile"
     ignore_failure true
   end
+
+  Array(node[:tile][:database][:external_data_tables]).each do |table|
+    postgresql_table table do
+      cluster node[:tile][:database][:cluster]
+      database "gis"
+      owner "tile"
+      permissions "tile" => :all, "www-data" => :select, "_renderd" => :select
+    end
+  end
 end
 
 postgresql_munin "gis" do