From: Peter Palfrader Date: Fri, 5 Aug 2016 17:54:10 +0000 (+0200) Subject: move lintian to standard static setup X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=a28ed6fe4705cc3761484549aaf235f2f61bb265;hp=fa63526cb7a7dfc0abb51c0bbfacbd046a21dd91;p=mirror%2Fdsa-puppet.git move lintian to standard static setup --- diff --git a/modules/roles/manifests/static_mirror.pp b/modules/roles/manifests/static_mirror.pp index fea09d664..53b7b8a0d 100644 --- a/modules/roles/manifests/static_mirror.pp +++ b/modules/roles/manifests/static_mirror.pp @@ -63,8 +63,7 @@ class roles::static_mirror { apache2::site { '010-lintian.debian.org': site => 'lintian.debian.org', - ensure => has_static_component('lintian.debian.org') ? { true => "present", false => "absent" }, - content => template('roles/static-mirroring/vhost/lintian.debian.org.erb'), + ensure => absent, } apache2::site { '010-static-vhosts-simple': diff --git a/modules/roles/templates/static-mirroring/vhost/lintian.debian.org.erb b/modules/roles/templates/static-mirroring/vhost/lintian.debian.org.erb deleted file mode 100644 index 89a74d0f7..000000000 --- a/modules/roles/templates/static-mirroring/vhost/lintian.debian.org.erb +++ /dev/null @@ -1,71 +0,0 @@ -<% if scope.function_has_static_component(['lintian.debian.org']) -%> - -Use common-dsa-vhost-https-redirect lintian.debian.org - - - ServerAdmin lintian-maint@debian.org - - ErrorLog /var/log/apache2/lintian.debian.org-error.log - CustomLog /var/log/apache2/lintian.debian.org-access.log privacyssl - - - UserDir disabled - - - DocumentRoot /srv/static.debian.org/mirrors/lintian.debian.org/cur - AddDefaultCharset utf-8 - - - Require all granted - - # These three lines makes apache serve - # "lintian.log.gz" as a text/plain with encoding gzip - # making it easier to view the log in the browser. - RemoveType .gz - AddEncoding x-gzip .gz - AddType text/plain .log - - - AddOutputFilterByType DEFLATE image/svg+xml - AddOutputFilterByType DEFLATE text/plain - - - - - # Cache these for a year (3600 * 24 * 365.25) - # Files in here will change name if their content change - Header set Cache-Control "max-age=31557600, public" - - - RewriteEngine on - RewriteMap source-map txt:/srv/static.debian.org/mirrors/lintian.debian.org/cur/lookup-tables/source-packages - - # Re-direct from the "old" locations to the new ones - RewriteRule ^/reports/T(.*)\.html$ /tags/$1.html [L,R=permanent] - RewriteRule ^/reports/(.*)$ /$1 [L,R=permanent] - - # Map source packages to reports (this mapping is re-written once per lintian run, - # serve it as a 302 rather than a permanent redirect) - # Version-less request - RewriteRule ^/source/([a-z0-9-]+)/?$ /${source-map:$1} [L,R,NE] - # Versioned request - RewriteRule ^/source/([a-z0-9-]+)/([a-zA-Z0-9.+:~-]+)$ /${source-map:$1/$2} [L,R,NE] - - - > - ServerName lintian.debian.org - Use common-debian-service-ssl lintian.debian.org - Use common-ssl-HSTS - - Use vhost-inner-lintian.debian.org - - -<% if scope.function_onion_global_service_hostname(['lintian.debian.org']) -%> - > - ServerName <%= scope.function_onion_global_service_hostname(['lintian.debian.org']) %> - Use vhost-inner-lintian.debian.org - -<% end %> -<% end -%> - -# vim:set syn=apache: diff --git a/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb b/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb index e91776545..184668b76 100644 --- a/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb +++ b/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb @@ -63,6 +63,48 @@ AddOutputFilter INCLUDES .xhtml + + + + AddDefaultCharset utf-8 + + + Require all granted + + # These three lines makes apache serve + # "lintian.log.gz" as a text/plain with encoding gzip + # making it easier to view the log in the browser. + RemoveType .gz + AddEncoding x-gzip .gz + AddType text/plain .log + + + AddOutputFilterByType DEFLATE image/svg+xml + AddOutputFilterByType DEFLATE text/plain + + + + + # Cache these for a year (3600 * 24 * 365.25) + # Files in here will change name if their content change + Header set Cache-Control "max-age=31557600, public" + + + RewriteEngine on + RewriteMap source-map txt:/srv/static.debian.org/mirrors/lintian.debian.org/cur/lookup-tables/source-packages + + # Re-direct from the "old" locations to the new ones + RewriteRule ^/reports/T(.*)\.html$ /tags/$1.html [L,R=permanent] + RewriteRule ^/reports/(.*)$ /$1 [L,R=permanent] + + # Map source packages to reports (this mapping is re-written once per lintian run, + # serve it as a 302 rather than a permanent redirect) + # Version-less request + RewriteRule ^/source/([a-z0-9-]+)/?$ /${source-map:$1} [L,R,NE] + # Versioned request + RewriteRule ^/source/([a-z0-9-]+)/([a-zA-Z0-9.+:~-]+)$ /${source-map:$1/$2} [L,R,NE] + + <%= def vhost(lines, sn, kwargs={}) @@ -130,6 +172,7 @@ vhost(lines, "miniconf10.debconf.org" , :ssl => true) vhost(lines, "deb.debian.org", :extra => true) vhost(lines, "release.debian.org", :ssl => true, :extra => true) vhost(lines, "www.ports.debian.org", :ssl => true, :extra => true) +vhost(lines, "lintian.debian.org", :ssl => true, :extra => true) lines.join("\n") -%>