Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

update robot.txt

ulferts4d36f144fd21
diff --git a/app/views/homescreen/robots.text.erb b/app/views/homescreen/robots.text.erb
index 5962c8d72f2..2c9dcd9d631 100644
--- a/app/views/homescreen/robots.text.erb
+++ b/app/views/homescreen/robots.text.erb
@@ -28,11 +28,13 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
User-agent: *
<% cache @projects.cache_key(:updated_at) do %>
- <% @projects.each do |p| -%>
-Disallow: <%= project_repository_path(p) %>
-Disallow: <%= project_work_packages_path(p) %>
-Disallow: <%= project_activity_index_path(p) %>
+ <% @projects.flat_map { |p| [p.id, p.identifier] }.each do |identifier| -%>
+Disallow: <%= project_repository_path(identifier) %>
+Disallow: <%= project_work_packages_path(identifier) %>
+Disallow: <%= project_activity_index_path(identifier) %>
+Disallow: <%= search_path(identifier) %>
<% end -%>
<% end %>
-Disallow: /calendar
+Disallow: <%= activities_path %>
Disallow: /activity
+Disallow: <%= search_path %>
diff --git a/spec/features/homescreen/robots_spec.rb b/spec/features/homescreen/robots_spec.rb
index 8b1cb7a4d81..31a7a137b21 100644
--- a/spec/features/homescreen/robots_spec.rb
+++ b/spec/features/homescreen/robots_spec.rb
@@ -36,11 +36,15 @@ describe 'robots.txt' do
end
it 'disallows global paths and paths from public project' do
- expect(page).to have_content('Disallow: /calendar')
expect(page).to have_content('Disallow: /activity')
+ expect(page).to have_content('Disallow: /activities')
+ expect(page).to have_content('Disallow: /search')
- expect(page).to have_content("Disallow: /projects/#{project.identifier}/repository")
- expect(page).to have_content("Disallow: /projects/#{project.identifier}/work_packages")
- expect(page).to have_content("Disallow: /projects/#{project.identifier}/activity")
+ [project.identifier, project.id].each do |identifier|
+ expect(page).to have_content("Disallow: /projects/#{identifier}/repository")
+ expect(page).to have_content("Disallow: /projects/#{identifier}/work_packages")
+ expect(page).to have_content("Disallow: /projects/#{identifier}/activity")
+ expect(page).to have_content("Disallow: /projects/#{identifier}/search")
+ end
end
end