Merge "Add robots.txt to our list servers"
This commit is contained in:
commit
196817156d
7
playbooks/roles/mailman3/files/robots.txt
Normal file
7
playbooks/roles/mailman3/files/robots.txt
Normal file
@ -0,0 +1,7 @@
|
||||
User-agent: *
|
||||
|
||||
Disallow: /accounts/*
|
||||
Allow: /archives/*
|
||||
Allow: /mailman3/lists/*
|
||||
|
||||
Crawl-delay: 2
|
@ -141,6 +141,22 @@
|
||||
shell:
|
||||
cmd: docker image prune -f
|
||||
|
||||
- name: Create robots.txt location dir
|
||||
file:
|
||||
path: /var/www/robots
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy the robots.txt
|
||||
copy:
|
||||
src: robots.txt
|
||||
dest: /var/www/robots/robots.txt
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
- name: Install apache2
|
||||
package:
|
||||
name:
|
||||
|
@ -46,6 +46,7 @@
|
||||
</Location>
|
||||
|
||||
RewriteEngine On
|
||||
RewriteRule ^/robots.txt$ /var/www/robots/robots.txt [L]
|
||||
RewriteRule "/pipermail/(.*)" "/var/lib/mailman/web-data/mm2archives/%{HTTP_HOST}/public/$1"
|
||||
RewriteRule "/cgi-bin/mailman/listinfo/(.*)" "https://%{HTTP_HOST}/mailman3/lists/$1.%{HTTP_HOST}/"
|
||||
RewriteRule "/cgi-bin/mailman/listinfo" "https://%{HTTP_HOST}/mailman3/lists/"
|
||||
@ -66,4 +67,8 @@
|
||||
Allow from all
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
<Directory "/var/www/robots">
|
||||
Require all granted
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
|
@ -36,6 +36,13 @@ def test_apache2_listening(host):
|
||||
apache2_https = host.socket("tcp://0.0.0.0:443")
|
||||
assert apache2_https.is_listening
|
||||
|
||||
def test_robots(host):
|
||||
cmd = host.run('curl --insecure '
|
||||
'--resolve lists.opendev.org:443:127.0.0.1 '
|
||||
'https://lists.opendev.org/robots.txt')
|
||||
assert 'Disallow: /accounts/*' in cmd.stdout
|
||||
assert 'Allow: /archives/*' in cmd.stdout
|
||||
|
||||
def test_mailman3_screenshots(host):
|
||||
shots = (
|
||||
("https://lists.opendev.org:443", None, "mm3-opendev-main.png"),
|
||||
|
Loading…
Reference in New Issue
Block a user