From: Tom Hughes Date: Wed, 30 Dec 2020 10:03:49 +0000 (+0000) Subject: Merge remote-tracking branch 'github/pull/378' X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/c21a743049e784dba40c58d00379dc62d578cdb9?hp=5441891826af401fac1ad8a40d6c64a3071ca7c7 Merge remote-tracking branch 'github/pull/378' --- diff --git a/Gemfile.lock b/Gemfile.lock index 281116f6a..ac720a13f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,8 +5,8 @@ GEM bcrypt_pbkdf (1.0.1) builder (3.2.4) chef-utils (16.8.14) - cookstyle (7.4.0) - rubocop (= 1.6.1) + cookstyle (7.5.1) + rubocop (= 1.7.0) diff-lcs (1.4.4) docker-api (2.0.0) excon (>= 0.47.0) @@ -50,12 +50,12 @@ GEM net-telnet (0.1.1) nori (2.6.0) parallel (1.20.1) - parser (2.7.2.0) + parser (3.0.0.0) ast (~> 2.4.1) pastel (0.8.0) tty-color (~> 0.5) rainbow (3.0.0) - regexp_parser (2.0.1) + regexp_parser (2.0.3) rexml (3.2.4) rspec (3.9.0) rspec-core (~> 3.9.0) @@ -73,7 +73,7 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) rspec-support (3.9.3) - rubocop (1.6.1) + rubocop (1.7.0) parallel (~> 1.10) parser (>= 2.7.1.5) rainbow (>= 2.2.2, < 4.0) diff --git a/cookbooks/imagery/templates/default/imagery.js.erb b/cookbooks/imagery/templates/default/imagery.js.erb index 56ac172da..bee7747ab 100644 --- a/cookbooks/imagery/templates/default/imagery.js.erb +++ b/cookbooks/imagery/templates/default/imagery.js.erb @@ -8,7 +8,7 @@ function createMap(divName) { var layers = L.control.layers(null, null, {collapsed:false}).addTo(map); // Add OpenStreetMap layer - layers.addBaseLayer(L.tileLayer("https://cdn-fastly-test.tile.openstreetmap.org/{z}/{x}/{y}.png", { + layers.addBaseLayer(L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png", { attribution: "© OpenStreetMap and contributors, under an open license", maxZoom: 19 }), "OpenStreetMap"); diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 241b73a8e..154ce68fd 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -86,6 +86,7 @@ systemd_service "renderd" do exec_start "/usr/bin/renderd -f" runtime_directory "renderd" standard_error "null" + limit_nofile 4096 private_tmp true private_devices true private_network true diff --git a/cookbooks/tile/templates/default/cleanup-tiles.erb b/cookbooks/tile/templates/default/cleanup-tiles.erb index eb108e95e..721660bb1 100644 --- a/cookbooks/tile/templates/default/cleanup-tiles.erb +++ b/cookbooks/tile/templates/default/cleanup-tiles.erb @@ -20,7 +20,7 @@ my $tempfile = tmpnam(); if (df($tiledir)->{per} > 88) { - system("find", $tiledir, "-xdev", "-name", "lost+found", "-prune", "-o", "-type", "f", "-name", "*.meta", "-atime", "+3", "-fprintf", $tempfile, "%A@ %p\n"); + system("find", $tiledir, "-xdev", "-name", "lost+found", "-prune", "-o", "-type", "f", "-name", "*.meta", "-atime", "+2", "-fprintf", $tempfile, "%A@ %p\n"); open(TILES, "-|", "sort", "-n", $tempfile) || die "Can't open $tempfile: $!"; diff --git a/cookbooks/web/recipes/rails.rb b/cookbooks/web/recipes/rails.rb index fd484263e..caf20279f 100644 --- a/cookbooks/web/recipes/rails.rb +++ b/cookbooks/web/recipes/rails.rb @@ -113,7 +113,6 @@ rails_port "www.openstreetmap.org" do storage_configuration storage storage_service "aws" storage_url "https://openstreetmap-user-avatars.s3.dualstack.eu-west-1.amazonaws.com" - tile_cdn_url "https://cdn-fastly-test.tile.openstreetmap.org/{z}/{x}/{y}.png" end gem_package "bundler#{ruby_version}" do diff --git a/cookbooks/web/resources/rails_port.rb b/cookbooks/web/resources/rails_port.rb index 978dcb70f..90028e9f9 100644 --- a/cookbooks/web/resources/rails_port.rb +++ b/cookbooks/web/resources/rails_port.rb @@ -448,6 +448,7 @@ action :create do file "#{rails_directory}/public/export/embed.html" do action :nothing subscribes :delete, "git[#{rails_directory}]" + subscribes :delete, "file[#{rails_directory}/config/settings.local.yml]" end passenger_application rails_directory do diff --git a/cookbooks/web/templates/default/apache.frontend.erb b/cookbooks/web/templates/default/apache.frontend.erb index 9fbb7919d..19854189b 100644 --- a/cookbooks/web/templates/default/apache.frontend.erb +++ b/cookbooks/web/templates/default/apache.frontend.erb @@ -176,13 +176,13 @@ RedirectPermanent /images/cc_button.png https://www.openstreetmap.org/assets/cc_button.png # - # Redirect api requests made to www.osm.org to api.osm.org + # Redirect api requests made to www.openstreetmap.org to api.openstreetmap.org # # RewriteCond %{HTTP_HOST} =www.openstreetmap.org # RewriteRule ^/api/(.*)$ https://api.openstreetmap.org/api/$1 [L,NE,R=permanent] # - # Redirect non-api requests made to api.osm.org to www.osm.org + # Redirect non-api requests made to api.openstreetmap.org to www.openstreetmap.org # RewriteCond %{HTTP_HOST} =api.openstreetmap.org RewriteCond %{REQUEST_URI} !^/api/ @@ -199,6 +199,34 @@ RedirectPermanent / https://www.openstreetmap.org/ + + ServerName osm.org + + Header always set Cache-Control "max-age=31536000" + Header always set Expires "Tue, 19 Jan 2038 03:14:07 GMT" + + RewriteEngine on + + RewriteRule ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 [R=permanent,L] + + RewriteCond %{REQUEST_URI} !^/server-status$ + RewriteRule ^(.*)$ https://osm.org$1 [L,NE,R=permanent] + + + + ServerName www.osm.org + + Header always set Cache-Control "max-age=31536000" + Header always set Expires "Tue, 19 Jan 2038 03:14:07 GMT" + + RewriteEngine on + + RewriteRule ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 [R=permanent,L] + + RewriteCond %{REQUEST_URI} !^/server-status$ + RewriteRule ^(.*)$ https://www.osm.org$1 [L,NE,R=permanent] + + ServerName openstreetmap.org