diff --git a/playbooks/roles/etherpad/templates/etherpad.vhost.j2 b/playbooks/roles/etherpad/templates/etherpad.vhost.j2 index 55eb1ecf37..2150a8b544 100644 --- a/playbooks/roles/etherpad/templates/etherpad.vhost.j2 +++ b/playbooks/roles/etherpad/templates/etherpad.vhost.j2 @@ -57,9 +57,9 @@ RewriteCond %{HTTP_HOST} !{{ etherpad_vhost_name }} RewriteRule ^.*$ https://{{ etherpad_vhost_name }} [L,R=301] - # Server robots.txt directly so that it does not affect + # Serve robots.txt directly so that it does not affect # etherpad-lite installation. - RewriteRule ^/robots.txt$ /var/etherpad/robots.txt [L] + RewriteRule ^/robots.txt$ /var/etherpad/www/robots.txt [L] # Refuse external connections to the API through the proxy RewriteRule ^/api/ - [F,L] diff --git a/testinfra/test_etherpad.py b/testinfra/test_etherpad.py index b5c11af745..d95cacd8a4 100644 --- a/testinfra/test_etherpad.py +++ b/testinfra/test_etherpad.py @@ -18,4 +18,10 @@ testinfra_hosts = ['etherpad01.opendev.org'] def test_etherpad_listening(host): etherpad = host.socket("tcp://127.0.0.1:9001") - assert etherpad.is_listening \ No newline at end of file + assert etherpad.is_listening + +def test_etherpad_robots(host): + cmd = host.run('curl --insecure ' + '--resolve etherpad.opendev.org:443:127.0.0.1 ' + 'https://etherpad.opendev.org/robots.txt') + assert 'Disallow: /' in cmd.stdout