X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Ftemplates%2Fstatic-mirroring%2Fvhost%2Fstatic-vhosts-simple.erb;h=6455c48477635c252a549352055d93d92b4c34cd;hb=d474fc02d314b33c6880aba0c7d4b1a87b9a9d93;hp=562dbaa033e4ff8069d33ce5e034a6b255c545db;hpb=5be6dadd7b8d59f5159b453f409acb1f156746fa;p=mirror%2Fdsa-puppet.git 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 562dbaa03..6455c4847 100644 --- a/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb +++ b/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb @@ -1,18 +1,163 @@ # puppet maintained -Use common-static-vhost mozilla.debian.net -Use common-static-vhost backports.debian.org -Use common-static-vhost-publiclog bits.debian.org -Use common-static-vhost news.debian.net -Use common-static-vhost-with-extra metadata.ftp-master.debian.org "AddDefaultCharset utf-8" -Use common-static-vhost-with-extra d-i.debian.org "ServerAlias d-i-backend.debian.org" -Use common-static-vhost-with-extra network-test.debian.org "ServerAlias network-test-backend.debian.org" -Use common-static-vhost-with-extra blends.debian.org "ServerAlias blends-backend.debian.org" -Use common-static-vhost-with-extra wnpp-by-tags.debian.net "ServerAlias wnpp-by-tags-backend.debian.org" -Use common-static-vhost-ssl dsa.debian.org -Use common-static-vhost-ssl rtc.debian.org -Use common-static-vhost security-team.debian.org "ServerAlias security-team-backend.debian.org" +###################### +# deb.debian.org +<% if scope.function_has_static_component(['deb.debian.org']) -%> + + Redirect /debian/ http://cdn-fastly.deb.debian.org/debian/ + Redirect /debian-debug/ http://cdn-fastly.deb.debian.org/debian-debug/ + Redirect /debian-ports/ http://cdn-fastly.deb.debian.org/debian-ports/ + Redirect /debian-security/ http://cdn-fastly.deb.debian.org/debian-security/ + +<% end -%> + +<%= + +def vhost(lines, sn, type=nil, extra=nil) + if scope.function_has_static_component([sn]) + t = 'common-static-vhost' + if type then t += "-#{type}"; end + + e = '' + if extra then e += " #{extra}"; end + + lines << "Use #{t} #{sn}#{e}" + end +end + +lines = [] +vhost(lines, "mozilla.debian.net") +vhost(lines, "backports.debian.org", "ssl") +vhost(lines, "incoming.debian.org") +vhost(lines, "incoming.ports.debian.org") +vhost(lines, "debdeltas.debian.net") +vhost(lines, "news.debian.net" , "ssl") +vhost(lines, "debaday.debian.net" , "ssl") +vhost(lines, "timeline.debian.net" , "ssl") +vhost(lines, "network-test.debian.org" , "with-extra", '"ServerAlias network-test-backend.debian.org"') +vhost(lines, "blends.debian.org" , "ssl") +vhost(lines, "wnpp-by-tags.debian.net" , "ssl") +vhost(lines, "security-team.debian.org", "ssl") +vhost(lines, "d-i.debian.org" , "ssl") +vhost(lines, "appstream.debian.org", "ssl") +vhost(lines, "dsa.debian.org" , "ssl") +vhost(lines, "rtc.debian.org" , "ssl") + +vhost(lines, "10years.debconf.org" , "ssl") +vhost(lines, "debconf0.debconf.org", "ssl") +vhost(lines, "debconf1.debconf.org", "ssl") +vhost(lines, "debconf2.debconf.org", "ssl") +vhost(lines, "debconf3.debconf.org", "ssl") +vhost(lines, "debconf4.debconf.org", "ssl") +vhost(lines, "debconf5.debconf.org", "ssl") +vhost(lines, "debconf6.debconf.org", "ssl") +vhost(lines, "debconf7.debconf.org", "ssl") +vhost(lines, "es.debconf.org" , "ssl") +vhost(lines, "fr.debconf.org" , "ssl") +vhost(lines, "miniconf10.debconf.org" , "ssl") + +vhost(lines, "deb.debian.org", "with-extra", '"Use vhost-deb.debian.org-extra"') + +lines.join("\n") +-%> + +###################### +# metadata.ftp-master.debian.org +<% if scope.function_has_static_component(['metadata.ftp-master.debian.org']) -%> + > + ServerName metadata.ftp-master.debian.org + ServerAdmin debian-admin@lists.debian.org + + ErrorLog /var/log/apache2/metadata.ftp-master.debian.org-error.log + CustomLog /var/log/apache2/metadata.ftp-master.debian.org-access.log privacy + + Use common-static-base metadata.ftp-master.debian.org + AddDefaultCharset utf-8 + + ForceType text/plain + + +<% end -%> + +###################### +# bits.debian.org +<% if scope.function_has_static_component(['bits.debian.org']) -%> + + ServerName bits.debian.org + ServerAdmin debian-admin@lists.debian.org + + ErrorLog /var/log/apache2/bits.debian.org-error.log + + CustomLog /var/log/apache2/bits.debian.org-public-access.log privacy+geo + + + Use common-static-base bits.debian.org + + + > + RewriteEngine on + + RewriteEngine On + RewriteCond %{REQUEST_URI} !^/feeds/ + RewriteRule ^/(.*)$ https://bits.debian.org/$1 [R,L] + #RewriteRule ^/(.*)$ https://bits.debian.org/$1 [R=301,L] + + Use static-bits.debian.org-base + CustomLog /var/log/apache2/bits.debian.org-access.log privacy + + + > + Use static-bits.debian.org-base + CustomLog /var/log/apache2/bits.debian.org-access.log privacyssl + + Use common-debian-service-ssl bits.debian.org + Use common-ssl-HSTS + +<% end -%> + +###################### +# release.debian.org +<% if scope.function_has_static_component(['release.debian.org']) -%> +Use common-dsa-vhost-https-redirect release.debian.org + > + ServerName release.debian.org + ServerAdmin debian-admin@debian.org + + ErrorLog /var/log/apache2/release.debian.org-error.log + CustomLog /var/log/apache2/release.debian.org-access.log privacy + + Use common-debian-service-ssl release.debian.org + Use common-ssl-HSTS + + Use common-static-base release.debian.org + + RewriteEngine on + RewriteRule ^/migration/$ /migration/testing.pl + RewriteRule ^/migration/search/(.+)/$ /migration/testing.pl?package=$1 + RewriteCond %{QUERY_STRING} package=((.)(.*)) + RewriteRule ^/migration/testing.pl /migration/cache/%2/%1.html [PT,L] + RewriteRule ^/migration/testing.pl /migration/cache/_index.html + + Alias /proposed-updates/ /srv/static.debian.org/mirrors/release.debian.org-pu/cur/ + + Require all granted + Options Indexes SymLinksIfOwnerMatch + IndexOptions FancyIndexing NameWidth=* + + AddEncoding gzip .gz + FilterDeclare gzip CONTENT_SET + FilterProvider gzip inflate "%{req:Accept-Encoding} !~ /gzip/" + FilterChain gzip + + ForceType text/plain + + + +<% end -%> + +# www.backports.org +################### # www.backports.org is the historical place for the backports # website and archive. It is now a CNAME to backports.debian.org: # redirect http requests. @@ -20,33 +165,16 @@ Use common-static-vhost security-team.debian.org "ServerAlias security-team-back ServerName www.backports.org ServerAlias lists.backports.org ServerAdmin debian-admin@debian.org - RedirectPermanent /debian/ http://backports.debian.org/debian-backports/ - RedirectPermanent /backports.org/ http://backports.debian.org/debian-backports/ - RedirectPermanent /debian-backports/ http://backports.debian.org/debian-backports/ RedirectPermanent / http://backports.debian.org/ +###################### +# www.ports.debian.org +<% if scope.function_has_static_component(['www.ports.debian.org']) -%> - > - ServerName women.debian.org - ServerAdmin debian-admin@debian.org - - RedirectPermanent / http://www.debian.org/women/ +Use common-dsa-vhost-https-redirect www.ports.debian.org - RedirectPermanent /about/ http://www.debian.org/women/about - RedirectPermanent /contact/ http://www.debian.org/women/contact - RedirectPermanent /faqs/ http://www.debian.org/women/faq - RedirectPermanent /home/ http://www.debian.org/women/ - RedirectPermanent /images/dw.png http://www.debian.org/women/dw.png - RedirectPermanent /involvement/ http://www.debian.org/women/participate - RedirectPermanent /mentoring/ http://www.debian.org/women/mentoring - RedirectPermanent /press/ http://wiki.debian.org/DebianWomen/Press - RedirectPermanent /profiles/ http://www.debian.org/women/profiles/ - - -# debian ports stuff -#################### - > + > ServerName www.ports.debian.org ServerAlias www.ports-backend.debian.org ServerAdmin debian-admin@lists.debian.org @@ -54,6 +182,9 @@ Use common-static-vhost security-team.debian.org "ServerAlias security-team-back ErrorLog /var/log/apache2/www.ports.debian.org-error.log CustomLog /var/log/apache2/www.ports.debian.org-access.log privacy + Use common-debian-service-ssl www.ports.debian.org + Use common-ssl-HSTS + UserDir disabled @@ -64,30 +195,70 @@ Use common-static-vhost security-team.debian.org "ServerAlias security-team-back AllowOverride FileInfo Indexes Options=Multiviews Options Multiviews Indexes FollowSymLinks Includes IndexOptions FancyIndexing NameWidth=* - Order allow,deny - Allow from all + Require all granted - DefaultType text/plain AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css AddOutputFilter INCLUDES .xhtml +<% end -%> > ServerName www.debian-ports.org ServerAlias debian-ports.org ServerAdmin debian-admin@debian.org - RedirectPermanent /archive/ http://archive.ports.debian.org/archive/ - RedirectPermanent /debian-cd/ http://archive.ports.debian.org/debian-cd/ - RedirectPermanent /debian-snapshot/ http://archive.ports.debian.org/debian-snapshot/ - RedirectPermanent /debian/ http://archive.ports.debian.org/debian/ - RedirectPermanent / http://www.ports.debian.org/ + RedirectPermanent / https://www.ports.debian.org/ + + + > + ServerName ports.debian.org + ServerAlias ports.debian.net + ServerAdmin debian-admin@debian.org + RedirectPermanent / https://www.ports.debian.org/ > - ServerName ports.debian.net + ServerName incoming.debian-ports.org ServerAdmin debian-admin@debian.org - RedirectPermanent / http://www.ports.debian.org/ + RedirectPermanent / http://incoming.ports.debian.org/ + + + > + ServerName ftp.debian-ports.org + ServerAdmin debian-admin@debian.org + RedirectPermanent /archive http://www.ports.debian.org + RedirectPermanent /debian http://ftp.ports.debian.org/debian-ports + RedirectPermanent /debian-cd http://ftp.ports.debian.org/debian-ports-cd + RedirectPermanent / http://ftp.ports.debian.org/ + + +# video.debian.net +################### + > + ServerName video.debian.net + ServerAdmin debian-admin@debian.org + + Redirect / http://meetings-archive.debian.net/pub/debian-meetings/ + + +# historical sites +################## +# now only redirects remain + > + ServerName women.debian.org + ServerAdmin debian-admin@debian.org + + RedirectPermanent / http://www.debian.org/women/ + + RedirectPermanent /about/ http://www.debian.org/women/about + RedirectPermanent /contact/ http://www.debian.org/women/contact + RedirectPermanent /faqs/ http://www.debian.org/women/faq + RedirectPermanent /home/ http://www.debian.org/women/ + RedirectPermanent /images/dw.png http://www.debian.org/women/dw.png + RedirectPermanent /involvement/ http://www.debian.org/women/participate + RedirectPermanent /mentoring/ http://www.debian.org/women/mentoring + RedirectPermanent /press/ http://wiki.debian.org/DebianWomen/Press + RedirectPermanent /profiles/ http://www.debian.org/women/profiles/ >