]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/recipes/default.rb
Make tile server export script require a valid TOTP token
[chef.git] / cookbooks / tile / recipes / default.rb
index cdf2474e74c803287b9433aedd554b7e6cdd8bff..62f9a8858f847226a9fc45fbedc25ee04294abd5 100644 (file)
@@ -24,6 +24,7 @@ include_recipe "postgresql"
 include_recipe "tools"
 
 blocks = data_bag_item("tile", "blocks")
+web_passwords = data_bag_item("web", "passwords")
 
 apache_module "alias"
 apache_module "cgi"
@@ -116,17 +117,14 @@ end
 
 package "python-cairo"
 package "python-mapnik"
+package "python-setuptools"
 
-package "ttf-dejavu"
+easy_install_package "pyotp"
+
+package "fonts-noto-cjk"
+package "fonts-noto-hinted"
+package "fonts-noto-unhinted"
 package "ttf-unifont"
-package "fonts-droid-fallback"
-package "fonts-sipa-arundina"
-package "fonts-sil-padauk"
-package "fonts-khmeros"
-package "fonts-beng-extra"
-package "fonts-gargi"
-package "fonts-taml-tscu"
-package "fonts-tibetan-machine"
 
 directory "/srv/tile.openstreetmap.org/cgi-bin" do
   owner "tile"
@@ -139,7 +137,7 @@ template "/srv/tile.openstreetmap.org/cgi-bin/export" do
   owner "tile"
   group "tile"
   mode 0o755
-  variables :blocks => blocks
+  variables :blocks => blocks, :totp_key => web_passwords["totp_key"]
 end
 
 template "/srv/tile.openstreetmap.org/cgi-bin/debug" do
@@ -321,7 +319,7 @@ node[:tile][:styles].each do |name, details|
 
   execute "#{style_directory}/project.mml" do
     action :nothing
-    command "carto project.mml > project.xml"
+    command "carto -a 3.0.0 project.mml > project.xml"
     cwd style_directory
     user "tile"
     group "tile"
@@ -331,7 +329,10 @@ node[:tile][:styles].each do |name, details|
   end
 end
 
+postgresql_version = node[:tile][:database][:cluster].split("/").first
+
 package "postgis"
+package "postgresql-#{postgresql_version}-postgis-2.3"
 
 postgresql_user "jburgess" do
   cluster node[:tile][:database][:cluster]