X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/97f7effc3f4ac2d812e6e32a832731c1eeb796c7..b06d91f3a7c481ab17c2c621b2d14c24a060d7b6:/cookbooks/tile/recipes/default.rb diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index b9ae28cf8..d726a2220 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -29,7 +29,6 @@ include_recipe "ruby" include_recipe "tools" blocks = data_bag_item("tile", "blocks") -admins = data_bag_item("apache", "admins") web_passwords = data_bag_item("web", "passwords") apache_module "alias" @@ -60,14 +59,6 @@ end fastlyips = JSON.parse(IO.read("#{Chef::Config[:file_cache_path]}/fastly-ip-list.json")) -remote_file "#{Chef::Config[:file_cache_path]}/statuscake-locations.json" do - source "https://app.statuscake.com/Workfloor/Locations.php?format=json" - compile_time true - ignore_failure true -end - -statuscakelocations = JSON.parse(IO.read("#{Chef::Config[:file_cache_path]}/statuscake-locations.json")) - apache_site "default" do action :disable end @@ -78,9 +69,7 @@ end apache_site "tile.openstreetmap.org" do template "apache.erb" - variables :fastly => fastlyips["addresses"] + fastlyips["ipv6_addresses"], - :statuscake => statuscakelocations.flat_map { |_, v| [v["ip"], v["ipv6"]] }, - :admins => admins["hosts"] + variables :fastly => fastlyips["addresses"] end template "/etc/logrotate.d/apache2" do @@ -176,30 +165,6 @@ python_package "pyotp" do python_version "3" end -unifont = if node[:lsb][:release].to_f < 22.04 - "ttf-unifont" - else - "fonts-unifont" - end - -package %W[ - fonts-noto-cjk - fonts-noto-hinted - fonts-noto-unhinted - fonts-hanazono - #{unifont} -] - -["NotoSansArabicUI-Regular.ttf", "NotoSansArabicUI-Bold.ttf"].each do |font| - remote_file "/usr/share/fonts/truetype/noto/#{font}" do - action :create_if_missing - source "https://github.com/googlei18n/noto-fonts/raw/master/hinted/#{font}" - owner "root" - group "root" - mode "644" - end -end - directory "/srv/tile.openstreetmap.org/cgi-bin" do owner "tile" group "tile" @@ -397,6 +362,17 @@ node[:tile][:styles].each do |name, details| group "tile" end + if details[:fonts_script] + execute details[:fonts_script] do + action :nothing + command details[:fonts_script] + cwd style_directory + user "tile" + group "tile" + subscribes :run, "git[#{style_directory}]" + end + end + execute "#{style_directory}/project.mml" do action :nothing command "carto -a 3.0.0 project.mml > project.xml" @@ -424,6 +400,11 @@ postgresql_user "tomh" do superuser true end +postgresql_user "pnorman" do + cluster node[:tile][:database][:cluster] + superuser true +end + postgresql_user "tile" do cluster node[:tile][:database][:cluster] end @@ -561,6 +542,7 @@ systemd_service "tile-ratelimit" do user "tile" group "adm" exec_start "/usr/local/bin/tile-ratelimit" + nice 10 private_tmp true private_devices true private_network true @@ -609,6 +591,7 @@ systemd_service "expire-tiles" do type "simple" user "_renderd" exec_start "/usr/local/bin/expire-tiles" + nice 10 standard_output "null" private_tmp true private_devices true @@ -676,7 +659,7 @@ end systemd_timer "render-lowzoom" do description "Render low zoom tiles" - on_calendar "Sun *-*~07/1 01:00:00" + on_calendar "Fri *-*-* 23:00:00 UTC" end service "render-lowzoom.timer" do