From b3fe8804a9a19ea54b5cc8eab557e98e4cd0f472 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Fri, 15 Jul 2022 23:57:54 +0300 Subject: [PATCH] Fix demised site redirect --- cookbooks/subversion/recipes/default.rb | 26 +------------------ .../subversion/templates/default/apache.erb | 4 ++- cookbooks/trac/templates/default/apache.erb | 3 +-- 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/cookbooks/subversion/recipes/default.rb b/cookbooks/subversion/recipes/default.rb index 7cba5bc73..9804e43e9 100644 --- a/cookbooks/subversion/recipes/default.rb +++ b/cookbooks/subversion/recipes/default.rb @@ -19,27 +19,7 @@ include_recipe "apache" -package "subversion" do - action :remove -end - -apache_module "dav" do - action :disable -end - -apache_module "dav_fs" do - action :disable -end - -apache_module "dav_svn" do - package "libapache2-mod-svn" - action [:disable, :delete] -end - -apache_module "authz_svn" do - package "libapache2-mod-svn" - action [:disable, :delete] -end +apache_module "rewrite" ssl_certificate "svn.openstreetmap.org" do domains ["svn.openstreetmap.org", "svn.osm.org"] @@ -50,7 +30,3 @@ apache_site "svn.openstreetmap.org" do template "apache.erb" variables :aliases => ["svn.osm.org"] end - -file "/etc/cron.daily/svn-backup" do - action :delete -end diff --git a/cookbooks/subversion/templates/default/apache.erb b/cookbooks/subversion/templates/default/apache.erb index 49c1e1eba..987d50930 100644 --- a/cookbooks/subversion/templates/default/apache.erb +++ b/cookbooks/subversion/templates/default/apache.erb @@ -12,7 +12,9 @@ ErrorLog /var/log/apache2/<%= @name %>-error.log RedirectPermanent /applications/editors/josm/plugins/cadastre-fr/images/cadastre_small.png https://raw.githubusercontent.com/openstreetmap/svn-archive/main/applications/editors/josm/plugins/cadastre-fr/images/cadastre_small.png - ErrorDocument 404 https://github.com/openstreetmap/svn-archive + + RewriteEngine on + RewriteRule ^/?(.*) https://github.com/openstreetmap/svn-archive [L,R=permanent] <% unless @aliases.empty? -%> diff --git a/cookbooks/trac/templates/default/apache.erb b/cookbooks/trac/templates/default/apache.erb index f8f898e2a..5e1fc01df 100644 --- a/cookbooks/trac/templates/default/apache.erb +++ b/cookbooks/trac/templates/default/apache.erb @@ -47,6 +47,5 @@ RewriteEngine on RewriteMap tickets txt:/srv/trac.openstreetmap.org/tickets.map RewriteRule ^/ticket/(\d+)$ https://github.com/openstreetmap/trac-tickets/issues/${tickets:$1} - - ErrorDocument 404 https://github.com/openstreetmap/trac-tickets + RewriteRule ^/?(.*) https://github.com/openstreetmap/trac-tickets [L,R=permanent] -- 2.39.5