From 4d8f931c98bb0a3c278ff80a4391426b0a877daf Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 9 Jul 2017 15:41:32 +0300 Subject: Add: robots.txt for cgit to exclude everyone --- roles/gitano_server/files/robots.txt | 2 ++ roles/gitano_server/tasks/cgit.yml | 8 ++++++++ roles/gitano_server/templates/apache-cgit-host.j2 | 1 + 3 files changed, 11 insertions(+) create mode 100644 roles/gitano_server/files/robots.txt (limited to 'roles') diff --git a/roles/gitano_server/files/robots.txt b/roles/gitano_server/files/robots.txt new file mode 100644 index 0000000..1f53798 --- /dev/null +++ b/roles/gitano_server/files/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/roles/gitano_server/tasks/cgit.yml b/roles/gitano_server/tasks/cgit.yml index ff0375a..05e92cb 100644 --- a/roles/gitano_server/tasks/cgit.yml +++ b/roles/gitano_server/tasks/cgit.yml @@ -46,6 +46,14 @@ mode: 0755 with_items: "{{ cgit_hosts }}" notify: restart apache2 + +- name: install robots.txt for cgi + copy: + src: robots.txt + dest: /usr/share/cgit/robots.txt + owner: root + group: root + mode: 0444 - name: enable virtualhosts shell: "a2ensite {{ item }}" diff --git a/roles/gitano_server/templates/apache-cgit-host.j2 b/roles/gitano_server/templates/apache-cgit-host.j2 index 2f9eeb0..522c3c9 100644 --- a/roles/gitano_server/templates/apache-cgit-host.j2 +++ b/roles/gitano_server/templates/apache-cgit-host.j2 @@ -18,6 +18,7 @@ DirectoryIndex /cgi-bin/cgit.cgi Alias /cgit.png /usr/share/cgit/cgit.png Alias /cgit.css /usr/share/cgit/cgit.css + Alias /robots.txt /usr/share/cgit/robots.txt Options FollowSymlinks Indexes AllowOverride none -- cgit v1.2.1