commit 9b6398394d5d5d9e9e9aff244ccac2f98a4317d1 Author: Clark Boylan Date: Fri Oct 16 08:41:24 2020 -0700 Remove docker v1 registry proxy from our mirrors Docker has long planned to turn this off and it appears that they have done so. Planning details can be found at: https://www.docker.com/blog/registry-v1-api-deprecation/ Removing this simplifies our configs as well as testing. Do this as part of good hygiene. Change-Id: I11281167a87ba30b4ebaa88792032aec1af046c1 diff --git a/playbooks/roles/mirror/templates/mirror.vhost.j2 b/playbooks/roles/mirror/templates/mirror.vhost.j2 index 51e8ef2..906f5de 100644 --- a/playbooks/roles/mirror/templates/mirror.vhost.j2 +++ b/playbooks/roles/mirror/templates/mirror.vhost.j2 @@ -7,11 +7,6 @@ NameVirtualHost *:8080 Listen 4443 NameVirtualHost *:4443 -Listen 8081 -NameVirtualHost *:8081 -Listen 4444 -NameVirtualHost *:4444 - Listen 8082 NameVirtualHost *:8082 Listen 4445 @@ -329,74 +324,6 @@ ErrorLogFormat "[%{cu}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% , \ Use ProxyMirror 4443 -# Docker registry v1 proxy. - - # Disable directory listing by default. - - Order Deny,Allow - Deny from all - Options None - AllowOverride None - - - ErrorLog /var/log/apache2/proxy_$port_error.log - LogLevel warn - CustomLog /var/log/apache2/proxy_$port_access.log combined-cache - ServerSignature Off - - # Caching reverse proxy for things that don't make sense in AFS - # - # General cache rules - CacheRoot "/var/cache/apache2/proxy" - CacheDirLevels 5 - CacheDirLength 2 - # SSL support - SSLProxyEngine on - # Prevent thundering herds. - CacheLock on - CacheLockPath "/tmp/mod_cache-lock" - CacheLockMaxAge 5 - # 5GiB - CacheMaxFileSize 5368709120 - # Ignore expire headers as the urls use sha256 hashes. - CacheIgnoreQueryString On - # NOTE(pabelanger): In the case of docker, if neither an expiry date nor - # last-modified date are provided default expire to 1 day. This is up from - # 1 hour. - CacheDefaultExpire 86400 - CacheStoreExpired On - - # registry-1.docker.io - CacheEnable disk "/registry-1.docker" - ProxyPass "/registry-1.docker/" "https://registry-1.docker.io/" ttl=120 keepalive=On retry=0 - ProxyPassReverse "/registry-1.docker/" "https://registry-1.docker.io/" - - # dseasb33srnrn.cloudfront.net - CacheEnable disk "/cloudfront" - ProxyPass "/cloudfront/" "https://dseasb33srnrn.cloudfront.net/" ttl=120 keepalive=On retry=0 - ProxyPassReverse "/cloudfront/" "https://dseasb33srnrn.cloudfront.net/" - - # production.cloudflare.docker.com - CacheEnable disk "/cloudflare" - ProxyPass "/cloudflare/" "https://production.cloudflare.docker.com/" ttl=120 keepalive=On retry=0 - ProxyPassReverse "/cloudflare/" "https://production.cloudflare.docker.com/" - - - - ServerName {{ apache_server_name }}:8081 - ServerAlias {{ apache_server_alias }}:8081 - - Use Dockerv1Mirror 8081 - - - - ServerName {{ apache_server_name }}:4444 - ServerAlias {{ apache_server_alias }}:4444 - - Use SSLConfig - Use Dockerv1Mirror 4444 - - # Docker registry v2 proxy. # Disable directory listing by default. diff --git a/testinfra/test_mirror.py b/testinfra/test_mirror.py index 4021e60..270217a 100644 --- a/testinfra/test_mirror.py +++ b/testinfra/test_mirror.py @@ -51,28 +51,6 @@ def test_proxy_mirror(host): "http://[%s]:8080/pypi/simple/setuptools" % addr) assert 'setuptools' in cmd.stdout -def test_dockerv1_mirror(host): - # Dockerv1Mirror - for addr in host.addr(host.backend.host).ipv4_addresses: - cmd = host.run("wget --no-check-certificate -O- " - "https://%s:4444/registry-1.docker" % addr) - # TODO assert that this proxy cache is working more properly - assert '403 Forbidden' in cmd.stderr - - cmd = host.run("wget -O- http://%s:8081/registry-1.docker" % addr) - # TODO assert that this proxy cache is working more properly - assert '403 Forbidden' in cmd.stderr - - for addr in host.addr(host.backend.host).ipv6_addresses: - cmd = host.run("wget --no-check-certificate -O- " - "https://[%s]:4444/registry-1.docker" % addr) - # TODO assert that this proxy cache is working more properly - assert '403 Forbidden' in cmd.stderr - - cmd = host.run("wget -O- http://[%s]:8081/registry-1.docker" % addr) - # TODO assert that this proxy cache is working more properly - assert '403 Forbidden' in cmd.stderr - def test_dockerv2_mirror(host): # Dockerv2Mirror for addr in host.addr(host.backend.host).ipv4_addresses: