]> git.openstreetmap.org Git - chef.git/commitdiff
Enable regular dumps of the main wiki
authorThomas Skowron <th@skowron.biz>
Sun, 24 Feb 2019 19:23:15 +0000 (19:23 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 24 Feb 2019 19:27:02 +0000 (19:27 +0000)
Closes #220

cookbooks/mediawiki/templates/default/apache.erb
cookbooks/wiki/recipes/default.rb
cookbooks/wiki/templates/default/apache_wiki_dump.erb [deleted file]
cookbooks/wiki/templates/default/cron_wiki_dump.erb

index 7aba9752b87d91e5850f0b19b4e0491814b66ed6..d5485a6204bb46b713cced32ad4b66c18486ad3d 100644 (file)
@@ -87,6 +87,7 @@
   RewriteCond %{REQUEST_URI} !^/value/
   RewriteCond %{REQUEST_URI} !^/reference/
   RewriteCond %{REQUEST_URI} !^/prop/  
+  RewriteCond %{REQUEST_URI} !^/dump/  
   RewriteCond %{REQUEST_URI} !^/server-status
   RewriteCond %{REQUEST_URI} !^/.well-known/
   RewriteCond %{LA-U:REQUEST_FILENAME} !-f
     php_admin_flag engine off
   </Directory>
 
+  <Directory <%= @directory %>/dump/>
+    Options Indexes FollowSymLinks MultiViews
+    AllowOverride All
+    IndexIgnore .ht* . robots.txt HEADER.html HEADER.cgi logo.png style.css
+    IndexOptions FancyIndexing FoldersFirst NameWidth=* TrackModified
+    IndexOrderDefault Descending Date
+  </Directory>
+
   <Directory ~ "\.svn">
     Require all denied
   </Directory>
index 782fbdd3afb1ae7b85440ec0c02f3e19109600ef..5e15212e0410c1010780c2627dab840442a5aecc 100644 (file)
@@ -23,6 +23,8 @@ include_recipe "mediawiki"
 
 passwords = data_bag_item("wiki", "passwords")
 
+dump_directory = "/srv/wiki.openstreetmap.org/dump"
+
 package "lua5.1" # newer versions do not work with Scribuntu!
 
 apache_site "default" do
@@ -115,21 +117,16 @@ cookbook_file "/srv/wiki.openstreetmap.org/favicon.ico" do
   mode 0o644
 end
 
-directory "/srv/dump.wiki.openstreetmap.org" do
+directory dump_directory do
   owner node[:mediawiki][:user]
   group node[:mediawiki][:group]
   mode "0775"
 end
 
-apache_site "dump.wiki.openstreetmap.org" do
-  template "apache_wiki_dump.erb"
-  directory "/srv/dump.wiki.openstreetmap.org"
-  variables :aliases => "dump.wiki.osm.org"
-end
-
 template "/etc/cron.d/wiki-osm-org-dump" do
   owner "root"
   group "root"
   mode 0o644
   source "cron_wiki_dump.erb"
+  variables :dumppath => dump_directory
 end
diff --git a/cookbooks/wiki/templates/default/apache_wiki_dump.erb b/cookbooks/wiki/templates/default/apache_wiki_dump.erb
deleted file mode 100644 (file)
index 529404f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# DO NOT EDIT - This file is being maintained by Chef
-
-<VirtualHost *:80>
-        ServerName <%= @name %>
-        ServerAlias <%= @aliases %>
-        ServerAdmin webmaster@openstreetmap.org
-
-        CustomLog /var/log/apache2/<%= @name %>-access.log combined
-        ErrorLog /var/log/apache2/<%= @name %>-error.log
-
-        DocumentRoot <%= @directory %>
-
-        <Directory <%= @directory %>>
-                Options Indexes FollowSymLinks MultiViews
-                AllowOverride All
-                IndexIgnore .ht* . robots.txt HEADER.html HEADER.cgi logo.png style.css
-                IndexOptions FancyIndexing FoldersFirst NameWidth=* TrackModified
-                IndexOrderDefault Descending Date
-        </Directory>
-</VirtualHost>
index a84d2c58ddcee80c8324e5f1dbda74aef25c4d2e..4ed8c8a682df76e91eaea6f7a1e2582bd1e7419d 100644 (file)
@@ -1,3 +1,5 @@
 #!/bin/bash
 # DO NOT EDIT - This file is being maintained by Chef
 
+cd <%= @basepath %>/maintenance
+php dumpBackup.php --full > "<%= @dumppath %>/dump.xml"