Merge "lodgeit: add robots.txt"

This commit is contained in:
Zuul 2021-07-13 19:35:53 +00:00 committed by Gerrit Code Review
commit f951019b1b
4 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,2 @@
User-agent: *
Disallow: /

View File

@ -15,7 +15,7 @@
- name: Setup db directory
file:
state: directory
path: /var/lib/lodgeit_db
path: /var/lib/lodgeit/mariadb
owner: root
group: root
mode: 0755
@ -53,6 +53,22 @@
mode: 0644
notify: paste Reload apache2
- name: Create www dir
file:
state: directory
path: /var/lib/lodgeit/www
owner: root
group: root
mode: 0755
- name: Install robots.txt
copy:
src: robots.txt
dest: /var/lib/lodgeit/www/robots.txt
owner: root
group: root
mode: 0644
- name: Run docker-compose pull
shell:
cmd: docker-compose pull

View File

@ -37,5 +37,13 @@
ProxyPass / http://localhost:9000/ retry=0
ProxyPassReverse / http://localhost:9000/
<Location "/robots.txt">
ProxyPass !
</Location>
<Directory "/var/lib/lodgeit/www">
Require all granted
</Directory>
Alias /robots.txt /var/lib/lodgeit/www/robots.txt
</VirtualHost>

View File

@ -33,6 +33,12 @@ def test_paste(host):
'https://paste.opendev.org')
assert 'New Paste' in cmd.stdout
def test_paste_robots(host):
cmd = host.run('curl --insecure '
'--resolve paste.opendev.org:443:127.0.0.1 '
'https://paste.opendev.org/robots.txt')
assert 'Disallow: /' in cmd.stdout
def test_paste_screenshots(host):
driver = webdriver.Remote(
command_executor='http://%s:4444/wd/hub' % (host.backend.get_hostname()),