From 2cc0f2ba3c1fda40b800e6299ba5f35731d21bda Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Wed, 5 Jun 2013 00:45:25 +0100 Subject: [PATCH 1/1] Add initial robots.txt to gitweb to exclude snapshot links --- cookbooks/git/recipes/server.rb | 7 +++++++ cookbooks/git/templates/default/robots.txt.erb | 4 ++++ 2 files changed, 11 insertions(+) create mode 100644 cookbooks/git/templates/default/robots.txt.erb diff --git a/cookbooks/git/recipes/server.rb b/cookbooks/git/recipes/server.rb index c3382a2cf..f679ce82b 100644 --- a/cookbooks/git/recipes/server.rb +++ b/cookbooks/git/recipes/server.rb @@ -44,6 +44,13 @@ apache_site node[:git][:host] do directory git_directory end +template "#{git_directory}/robots.txt" do + source "robots.txt.erb" + owner "root" + group "root" + mode 0644 +end + firewall_rule "accept-git" do action :accept source "net" diff --git a/cookbooks/git/templates/default/robots.txt.erb b/cookbooks/git/templates/default/robots.txt.erb new file mode 100644 index 000000000..b60d5e279 --- /dev/null +++ b/cookbooks/git/templates/default/robots.txt.erb @@ -0,0 +1,4 @@ +# DO NOT EDIT - This file is being maintained by Chef + +User-agent: * +Disallow: /*/snapshot/ -- 2.39.5