]> git.openstreetmap.org Git - chef.git/commitdiff
Move the daily statistics to be served from planet.openstreetmap.org
authorTom Hughes <tom@compton.nu>
Sun, 20 Feb 2022 19:48:31 +0000 (19:48 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 20 Feb 2022 19:48:31 +0000 (19:48 +0000)
cookbooks/planet/recipes/default.rb
cookbooks/web/templates/default/apache.frontend.erb
cookbooks/web/templates/default/statistics.erb
roles/planet.rb

index b99b4ab0b54174e18cc4540d73c2c6c16efd277f..2a5fdfee16a3b56031fa0bb27b248aa8085bad33 100644 (file)
@@ -83,6 +83,12 @@ directory "/store/planet/notes" do
   mode "775"
 end
 
+directory "/store/planet/statistics" do
+  owner "www-data"
+  group "planet"
+  mode "775"
+end
+
 template "/usr/local/bin/apache-latest-planet-filename" do
   source "apache-latest-planet-filename.erb"
   owner "root"
index e679612323ea0bac118c3492d2022ddc751d4394..528b78fea49a6b70a9228defc862e0feae72053a 100644 (file)
   SetEnv SECRET_KEY_BASE <%= @secret_key_base %>
   Alias /favicon.ico <%= node[:web][:base_directory] %>/rails/app/assets/favicons/favicon.ico
   Alias /openlayers <%= node[:web][:base_directory] %>/static/openlayers
-  Alias /stats /store/rails/stats
+  RedirectPermanent /stats https://planet.openstreetmap.org/statistics
   Alias /user/image /store/rails/user/image
   Alias /attachments /store/rails/attachments
 
index a42357ba8e2f3ac4203ad14faaac4b15819c9f9c..db1fd40edbdf4488266ea3badef3ba8b659c2220 100644 (file)
@@ -10,7 +10,7 @@ export PATH=$PATH:/usr/local/bin
 <%= @ruby %> -W0 <%= @directory %>/script/statistics > <%= @directory %>/tmp/data_stats.html
 
 # Move new statistics into place
-mv -f <%= @directory %>/tmp/data_stats.html /store/rails/stats
+rsync --quiet <%= @directory %>/tmp/data_stats.html planet.openstreetmap.org::statistics
 
 # Mail statistics to Blackadder
 mail -s "OpenStreetMap Statistics" blackadderajr@gmail.com < /store/rails/stats/data_stats.html
index 50ebd4064a5e5375293f5a9ffef80fd286e80558..78aabf815ae313a0602e3bd11ef1838105a482e9 100644 (file)
@@ -49,6 +49,17 @@ default_attributes(
         :ignore_nonreadable => true,
         :timeout => 3600,
         :refuse_options => ["checksum"]
+      },
+      :statistics => {
+        :comment => "Statistics",
+        :path => "/store/planet/statistics",
+        :read_only => false,
+        :write_only => true,
+        :list => false,
+        :uid => "planet",
+        :gid => "planet",
+        :transfer_logging => false,
+        :nodes_allow => "roles:web-statistics"
       }
     }
   }