Merge "etherpad: fix robots.txt"

This commit is contained in:
Zuul 2021-02-24 00:02:04 +00:00 committed by Gerrit Code Review
commit d1ac0aee2d
2 changed files with 9 additions and 3 deletions

View File

@ -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]

View File

@ -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
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