codesearch: Add robots.txt
We don't want anything on the codesearch page indexed Change-Id: I556b77013cf1b7ff2c03426fea92a6d445131f6d
This commit is contained in:
parent
fc82ee2c5b
commit
1288de67aa
2
playbooks/roles/codesearch/files/robots.txt
Normal file
2
playbooks/roles/codesearch/files/robots.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow: /
|
@ -44,6 +44,19 @@
|
|||||||
group: root
|
group: root
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Create hound www storage area
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
path: /var/lib/hound/www
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Copy hound robots.txt
|
||||||
|
copy:
|
||||||
|
src: robots.txt
|
||||||
|
dest: /var/lib/hound/www/robots.txt
|
||||||
|
|
||||||
- name: Run docker-compose pull
|
- name: Run docker-compose pull
|
||||||
shell:
|
shell:
|
||||||
cmd: docker-compose pull
|
cmd: docker-compose pull
|
||||||
|
@ -40,5 +40,13 @@
|
|||||||
ProxyPass / http://localhost:6080/ retry=0
|
ProxyPass / http://localhost:6080/ retry=0
|
||||||
ProxyPassReverse / http://localhost:6080/
|
ProxyPassReverse / http://localhost:6080/
|
||||||
|
|
||||||
|
<Location "/robots.txt">
|
||||||
|
ProxyPass !
|
||||||
|
</Location>
|
||||||
|
<Directory "/var/lib/hound/www">
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
||||||
|
Alias /robots.txt /var/lib/hound/www/robots.txt
|
||||||
|
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
|
||||||
|
@ -25,3 +25,9 @@ def test_codesearch_proxy(host):
|
|||||||
'--resolve codesearch.opendev.org:443:127.0.0.1 '
|
'--resolve codesearch.opendev.org:443:127.0.0.1 '
|
||||||
'https://codesearch.opendev.org')
|
'https://codesearch.opendev.org')
|
||||||
assert '<title>Hound</title>' in cmd.stdout
|
assert '<title>Hound</title>' in cmd.stdout
|
||||||
|
|
||||||
|
def test_codesearch_robots(host):
|
||||||
|
cmd = host.run('curl --insecure '
|
||||||
|
'--resolve codesearch.opendev.org:443:127.0.0.1 '
|
||||||
|
'https://codesearch.opendev.org/robots.txt')
|
||||||
|
assert 'Disallow: /' in cmd.stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user