diff --git a/playbooks/roles/mirror/files/wheel_header.html b/playbooks/roles/mirror/files/wheel_header.html new file mode 100644 index 0000000000..ec6dadc919 --- /dev/null +++ b/playbooks/roles/mirror/files/wheel_header.html @@ -0,0 +1,2 @@ + + diff --git a/playbooks/roles/mirror/tasks/main.yaml b/playbooks/roles/mirror/tasks/main.yaml index 47ec6b84cc..46e83ae75e 100644 --- a/playbooks/roles/mirror/tasks/main.yaml +++ b/playbooks/roles/mirror/tasks/main.yaml @@ -105,6 +105,14 @@ group: root mode: 0444 +- name: Install wheel_header.html + copy: + src: wheel_header.html + dest: '{{ www_base }}' + owner: root + group: root + mode: 0444 + - name: Apache proxy cache file: path: /var/cache/apache2/proxy diff --git a/playbooks/roles/mirror/templates/mirror.vhost.j2 b/playbooks/roles/mirror/templates/mirror.vhost.j2 index f13f9c2f9e..44fa04e7fe 100644 --- a/playbooks/roles/mirror/templates/mirror.vhost.j2 +++ b/playbooks/roles/mirror/templates/mirror.vhost.j2 @@ -36,6 +36,14 @@ ErrorLogFormat "[%{cu}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% , \ Require all granted + # Pip really doesn't like the DOCTYPE declaration for autoindexes + # https://github.com/pypa/pip/issues/10825 + Alias /wheel/.header.html /var/www/wheel_header.html + + IndexOptions +SuppressHTMLPreamble + HeaderName /wheel/.header.html + + # Caching reverse proxy for things that don't make sense in AFS # # General cache rules