From: Grant Slater Date: Fri, 15 Jul 2022 20:14:50 +0000 (+0300) Subject: subversion: Disable svn.osm.org and add redirect X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/f626dd7711d75c0d18af02449f20b58c99ea27d8 subversion: Disable svn.osm.org and add redirect --- diff --git a/cookbooks/subversion/files/default/hooks/post-commit b/cookbooks/subversion/files/default/hooks/post-commit deleted file mode 100644 index a8de2af99..000000000 --- a/cookbooks/subversion/files/default/hooks/post-commit +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -/usr/bin/sudo -u trac /usr/bin/trac-admin /var/lib/trac changeset added "$1" "$2" diff --git a/cookbooks/subversion/files/default/hooks/post-revprop-change b/cookbooks/subversion/files/default/hooks/post-revprop-change deleted file mode 100644 index 31843a021..000000000 --- a/cookbooks/subversion/files/default/hooks/post-revprop-change +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -/usr/bin/sudo -u trac /usr/bin/trac-admin /var/lib/trac changeset modified "$1" "$2" diff --git a/cookbooks/subversion/recipes/default.rb b/cookbooks/subversion/recipes/default.rb index f38efb7b8..7cba5bc73 100644 --- a/cookbooks/subversion/recipes/default.rb +++ b/cookbooks/subversion/recipes/default.rb @@ -19,35 +19,26 @@ include_recipe "apache" -package "subversion" - -repository_directory = "/var/lib/subversion/repos/openstreetmap" - -remote_directory "#{repository_directory}/hooks" do - source "hooks" - owner "www-data" - group "www-data" - mode "755" - files_owner "www-data" - files_group "www-data" - files_mode "755" - purge false +package "subversion" do + action :remove end apache_module "dav" do - package "apache2" + action :disable end apache_module "dav_fs" do - package "apache2" + 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 ssl_certificate "svn.openstreetmap.org" do @@ -57,13 +48,9 @@ end apache_site "svn.openstreetmap.org" do template "apache.erb" - directory repository_directory - variables :realm => "Subversion Repository", :password_file => "/etc/apache2/svn.passwd", :aliases => ["svn.osm.org"] + variables :aliases => ["svn.osm.org"] end -template "/etc/cron.daily/svn-backup" do - source "backup.cron.erb" - owner "root" - group "root" - mode "755" +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 cadae8b08..188051eea 100644 --- a/cookbooks/subversion/templates/default/apache.erb +++ b/cookbooks/subversion/templates/default/apache.erb @@ -4,32 +4,18 @@ ServerName <%= @name %> ServerAdmin webmaster@openstreetmap.org - Protocols http/1.1 - SSLEngine on SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key CustomLog /var/log/apache2/<%= @name %>-access.log combined - CustomLog /var/log/apache2/<%= @name %>-svn-access.log "%h %t %u %{SVN-ACTION}e" env=SVN-ACTION ErrorLog /var/log/apache2/<%= @name %>-error.log - - DAV svn - SVNPath <%= @directory %> - SVNIndexXSLT /svnindex.xsl - - LimitXMLRequestBody 0 - LimitRequestBody 0 + 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 + RedirectPermanent / https://github.com/openstreetmap/svn-archive - - Require all granted - + ErrorDocument 404 https://github.com/openstreetmap/svn-archive - - Require all denied - - <% unless @aliases.empty? -%> diff --git a/cookbooks/subversion/templates/default/backup.cron.erb b/cookbooks/subversion/templates/default/backup.cron.erb deleted file mode 100644 index 4e53d3840..000000000 --- a/cookbooks/subversion/templates/default/backup.cron.erb +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# DO NOT EDIT - This file is being maintained by Chef - -T=$(mktemp -d -t -p /var/tmp svn.XXXXXXXXXX) -D=$(date +%Y-%m-%d) -B=svn-$D.tar.gz - -mkdir $T/svn-$D -ln -s /etc/apache2/svn.passwd $T/svn-$D/svn.passwd - -nice svnadmin hotcopy /var/lib/subversion/repos/openstreetmap $T/svn-$D/repo > /dev/null - -export RSYNC_RSH="ssh -ax" - -nice tar --create --dereference --directory=$T svn-$D | nice gzip --rsyncable -9 > $T/$B -nice rsync --preallocate --fuzzy $T/$B backup::backup - -rm -rf $T