X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Ftemplates%2Fstatic-mirroring%2Fvhost%2Fstatic-vhosts-simple.erb;h=52a29b76a348f580972bab6450dec42ac709a8aa;hb=b0444f4c4a85c435e2a65061ac67b19a50d76d6b;hp=6455c48477635c252a549352055d93d92b4c34cd;hpb=d474fc02d314b33c6880aba0c7d4b1a87b9a9d93;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 6455c4847..52a29b76a 100644
--- a/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb
+++ b/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb
@@ -3,7 +3,7 @@
######################
# 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/
@@ -11,127 +11,24 @@
<% end -%>
+
+ ServerAlias network-test-backend.debian.org
+
-<%=
-
-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
+
+
+ CustomLog /var/log/apache2/bits.debian.org-public-access.log privacy+geo
+
+
- 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
@@ -142,7 +39,7 @@ Use common-dsa-vhost-https-redirect release.debian.org
Alias /proposed-updates/ /srv/static.debian.org/mirrors/release.debian.org-pu/cur/
Require all granted
- Options Indexes SymLinksIfOwnerMatch
+ Options Indexes SymLinksIfOwnerMatch MultiViews
IndexOptions FancyIndexing NameWidth=*
AddEncoding gzip .gz
@@ -151,10 +48,138 @@ Use common-dsa-vhost-https-redirect release.debian.org
FilterChain gzip
ForceType text/plain
+ AddDefaultCharset utf-8
-
-<% end -%>
+
+
+
+
+ AllowOverride FileInfo Indexes Options=Multiviews
+ Options Multiviews Indexes FollowSymLinks Includes
+ IndexOptions FancyIndexing NameWidth=*
+ Require all granted
+
+
+ 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={})
+ if scope.function_has_static_component([sn])
+ if not kwargs[:extra]
+ lines << ""
+ lines << " # mod macro does not like empty macros, so here's some content:"
+ lines << " "
+ lines << " "
+ lines << ""
+ end
+
+ lines << "Use prepare-static-vhost #{sn}"
+
+ if kwargs[:ssl] and kwargs[:ssl_optional]
+ lines << "Use static-vhost-plain-#{sn}"
+ lines << "Use static-vhost-ssl-#{sn}"
+ elsif kwargs[:ssl]
+ lines << "Use common-dsa-vhost-https-redirect #{sn}"
+ lines << "Use static-vhost-ssl-#{sn}"
+ else
+ lines << "Use static-vhost-plain-#{sn}"
+ end
+
+ onion = scope.function_onion_global_service_hostname([sn])
+ lines << "Use static-vhost-onion-#{sn} #{onion}" if onion
+
+ lines << ""
+ end
+end
+
+lines = []
+vhost(lines, "mozilla.debian.net" , :ssl => true, :ssl_optional => true)
+vhost(lines, "backports.debian.org" , :ssl => true)
+vhost(lines, "incoming.debian.org" , :ssl => true, :ssl_optional => true)
+vhost(lines, "incoming.ports.debian.org" , :ssl => true, :ssl_optional => true)
+vhost(lines, "debdeltas.debian.net" , :ssl => true)
+vhost(lines, "news.debian.net" , :ssl => true)
+vhost(lines, "debaday.debian.net" , :ssl => true)
+vhost(lines, "timeline.debian.net" , :ssl => true)
+vhost(lines, "network-test.debian.org" , :extra => true)
+vhost(lines, "blends.debian.org" , :ssl => true)
+vhost(lines, "wnpp-by-tags.debian.net" , :ssl => true)
+vhost(lines, "security-team.debian.org" , :ssl => true)
+vhost(lines, "d-i.debian.org" , :ssl => true)
+vhost(lines, "appstream.debian.org" , :ssl => true)
+vhost(lines, "dsa.debian.org" , :ssl => true)
+vhost(lines, "rtc.debian.org" , :ssl => true)
+vhost(lines, "onion.debian.org" , :ssl => true)
+
+vhost(lines, "bits.debian.org" , :ssl => true, :extra => true)
+vhost(lines, "micronews.debian.net" , :ssl => true)
+vhost(lines, "metadata.ftp-master.debian.org", :extra => true)
+
+vhost(lines, "10years.debconf.org" , :ssl => true)
+vhost(lines, "debconf0.debconf.org" , :ssl => true)
+vhost(lines, "debconf1.debconf.org" , :ssl => true)
+vhost(lines, "debconf2.debconf.org" , :ssl => true)
+vhost(lines, "debconf3.debconf.org" , :ssl => true)
+vhost(lines, "debconf4.debconf.org" , :ssl => true)
+vhost(lines, "debconf5.debconf.org" , :ssl => true)
+vhost(lines, "debconf6.debconf.org" , :ssl => true)
+vhost(lines, "debconf7.debconf.org" , :ssl => true)
+vhost(lines, "debconf16.debconf.org" , :ssl => true)
+vhost(lines, "es.debconf.org" , :ssl => true)
+vhost(lines, "fr.debconf.org" , :ssl => true)
+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")
+-%>
# www.backports.org
###################
@@ -169,40 +194,6 @@ Use common-dsa-vhost-https-redirect release.debian.org
######################
-# www.ports.debian.org
-<% if scope.function_has_static_component(['www.ports.debian.org']) -%>
-
-Use common-dsa-vhost-https-redirect www.ports.debian.org
-
- >
- ServerName www.ports.debian.org
- ServerAlias www.ports-backend.debian.org
- ServerAdmin debian-admin@lists.debian.org
-
- 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
-
- ServerSignature On
-
- DocumentRoot /srv/static.debian.org/mirrors/www.ports.debian.org/cur
-
- AllowOverride FileInfo Indexes Options=Multiviews
- Options Multiviews Indexes FollowSymLinks Includes
- IndexOptions FancyIndexing NameWidth=*
- Require all granted
-
-
- AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
- AddOutputFilter INCLUDES .xhtml
-
-<% end -%>
-
>
ServerName www.debian-ports.org
ServerAlias debian-ports.org
@@ -232,12 +223,9 @@ Use common-dsa-vhost-https-redirect www.ports.debian.org
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/