]> 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 0f10f064f65c455b8c0942769547acfbfe871c5b..62f9a8858f847226a9fc45fbedc25ee04294abd5 100644 (file)
@@ -24,6 +24,7 @@ include_recipe "postgresql"
 include_recipe "tools"
 
 blocks = data_bag_item("tile", "blocks")
 include_recipe "tools"
 
 blocks = data_bag_item("tile", "blocks")
+web_passwords = data_bag_item("web", "passwords")
 
 apache_module "alias"
 apache_module "cgi"
 
 apache_module "alias"
 apache_module "cgi"
@@ -116,6 +117,9 @@ end
 
 package "python-cairo"
 package "python-mapnik"
 
 package "python-cairo"
 package "python-mapnik"
+package "python-setuptools"
+
+easy_install_package "pyotp"
 
 package "fonts-noto-cjk"
 package "fonts-noto-hinted"
 
 package "fonts-noto-cjk"
 package "fonts-noto-hinted"
@@ -133,7 +137,7 @@ template "/srv/tile.openstreetmap.org/cgi-bin/export" do
   owner "tile"
   group "tile"
   mode 0o755
   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
 end
 
 template "/srv/tile.openstreetmap.org/cgi-bin/debug" do