debconf19 is not static just yet
[mirror/dsa-puppet.git] / modules / roles / templates / static-mirroring / vhost / static-vhosts-simple.erb
index fea7de7..adddd55 100644 (file)
@@ -66,7 +66,7 @@
        # Rewrite away double slashes
        RewriteEngine on
        RewriteCond %{REQUEST_URI} ^(.*)//(.*)$ [NC]
-       RewriteRule . %1/%2 [R=301,L,NE]
+       RewriteRule . %1/%2 [L,NE]
 
        <LocationMatch "/changelogs/(main|contrib|non-free)">
                ForceType text/plain
@@ -99,6 +99,7 @@
                        ForceType text/html
                        AddDefaultCharset utf-8
                </Files>
+               AddType text/plain .wml
        </Directory>
 </Macro>
 
        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]
+       RewriteRule ^/reports/T(.*)\.html$ /tags/$1.html [L]
+       RewriteRule ^/reports/(.*)$ /$1 [L]
 
        # Map source packages to reports (this mapping is re-written once per lintian run,
        # serve it as a 302 rather than a permanent redirect)
        </FilesMatch>
 </Macro>
 
+<Macro vstatic-vhost-extra-wiki.debconf.org>
+       <Location /wiki/>
+               ForceType text/html
+       </Location>
+       <Location /action/>
+               ForceType text/html
+       </Location>
+
+       RewriteEngine on
+       SSLProxyEngine on
+       RewriteRule ^/$ /wiki/Main_Page [L,P]
+       RewriteRule ^/wiki/$ /wiki/Main_Page [L]
+
+       RewriteCond %{QUERY_STRING} (^|&)modules=mediawiki.legacy.commonPrint,shared|skins.monobook(&|$)
+       RewriteCond %{QUERY_STRING} (^|&)only=styles(&|$)
+       RewriteRule ^/load.php$ /load-monobook-styles.css [L,QSD]
+
+       RewriteCond %{QUERY_STRING} (^|&)modules=site(&|$)
+       RewriteCond %{QUERY_STRING} (^|&)only=styles(&|$)
+       RewriteRule ^/load.php$ /load-site-styles.css [L,QSD]
+
+       RewriteCond %{QUERY_STRING} (^|&)modules=startup(&|$)
+       RewriteCond %{QUERY_STRING} (^|&)only=scripts(&|$)
+       RewriteRule ^/load.php$ /load-startup-scripts.js [L,QSD]
+
+       RewriteCond %{QUERY_STRING} (^|&)modules=site(&|$)
+       RewriteCond %{QUERY_STRING} (^|&)only=scripts(&|$)
+       RewriteRule ^/load.php$ /load-site-scripts.js [L,QSD]
+
+       RewriteCond %{QUERY_STRING} (^|&)modules=jquery%2Cmediawiki(&|$)
+       RewriteCond %{QUERY_STRING} (^|&)only=scripts(&|$)
+       RewriteRule ^/load.php$ /load-jquery-scripts.js [L,QSD]
+
+       RewriteCond %{QUERY_STRING} (^|&)modules=jquery.client%2Ccookie%2CmessageBox%2CmwExtension|mediawiki.legacy.ajax%2Cwikibits|mediawiki.page.startup|mediawiki.util(&|$)
+       RewriteRule ^/load.php$ /load-jquery.client.js [L,QSD]
+
+       RewriteCond %{QUERY_STRING} (^|&)modules=jquery.checkboxShiftClick%2CmakeCollapsible%2Cmw-jump%2Cplaceholder%7Cmediawiki.page.ready%7Cmediawiki.user(&|$)
+       RewriteRule ^/load.php$ /load-jquery.checkbox.js [L,QSD]
+</Macro>
+
+<Macro vstatic-vhost-extra-www.debconf.org>
+       ServerAlias www-test.debconf.org
+
+       <Directory /srv/static.debian.org/mirrors/www.debconf.org/cur>
+               Options +IncludesNOEXEC
+               SSILegacyExprParser on
+               DirectoryIndex index.shtml
+       </Directory>
+
+       AddOutputFilter INCLUDES .shtml
+
+       RewriteEngine On
+       # A few redirects for older debconf sites, so old links work
+       RewriteRule ^/gallery/(.*)$ https://gallery.debconf.org/v/$1 [L]
+       RewriteRule ^/.*years$ https://10years.debconf.org/ [L]
+       RewriteRule ^/debconf2$ https://debconf2.debconf.org/ [L]
+       RewriteRule ^/debconf3$ https://debconf3.debconf.org/ [L]
+       RewriteRule ^/debconf4$ https://debconf4.debconf.org/ [L]
+       RewriteRule ^/debconf5$ https://debconf5.debconf.org/ [L]
+       RewriteRule ^/10years/(.*)$ https://10years.debconf.org/$1 [L]
+       RewriteRule ^/debconf2/(.*)$ https://debconf2.debconf.org/$1 [L]
+       RewriteRule ^/debconf3/(.*)$ https://debconf3.debconf.org/$1 [L]
+       RewriteRule ^/debconf4/(.*)$ https://debconf4.debconf.org/$1 [L]
+       RewriteRule ^/debconf5/(.*)$ https://debconf5.debconf.org/$1 [L]
+</Macro>
+
+<Macro vstatic-vhost-extra-openpgpkey.debian.org>
+       # Legacy GPG versions (including 2.2.12 in buster/Debian 10) get redirections from
+       # the (not supposed to be default) direct method wrong.
+       #  They ask for https://debian.org/.well-known/openpgpkey/hu/<hash>
+       #  get a redirect to https://openpgpkey.debian.org/.well-known/openpgpkey/debian.org/hu/<hash>
+       #  and then try to fetch https://openpgpkey.debian.org/.well-known/openpgpkey/hu/<hash>
+       # *sigh*
+       # cf. https://dev.gnupg.org/T4603
+       Alias /.well-known/openpgpkey/hu/ /srv/static.debian.org/mirrors/openpgpkey.debian.org/cur/debian.org/hu/
+       Alias /.well-known/openpgpkey/policy /srv/static.debian.org/mirrors/openpgpkey.debian.org/cur/debian.org/policy
+
+       # The draft specified well-known place using the "advanced method"
+       Alias /.well-known/openpgpkey/ /srv/static.debian.org/mirrors/openpgpkey.debian.org/cur/
+       <Location />
+               Options -Indexes
+       </Location>
+
+       RewriteEngine on
+       RewriteRule ^/$ https://keyring.debian.org/ [L]
+</Macro>
+
 <%=
 
 def vhost(lines, sn, kwargs={})
@@ -202,14 +290,13 @@ 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, "apt.buildd.debian.org"         , :ssl => true)
 vhost(lines, "dpl.debian.org"                , :ssl => true)
 vhost(lines, "dsa.debian.org"                , :ssl => true)
 vhost(lines, "rtc.debian.org"                , :ssl => true)
 vhost(lines, "mirror-master.debian.org"      , :ssl => true)
 vhost(lines, "onion.debian.org"              , :ssl => true)
+vhost(lines, "openpgpkey.debian.org"         , :ssl => true, :extra => true)
 vhost(lines, "manpages.debian.org"           , :ssl => true, :extra => true)
-vhost(lines, "planet.debian.net")
 vhost(lines, "cdbuilder-logs.debian.org"     , :ssl => true)
 
 vhost(lines, "bits.debian.org"               , :ssl => true, :extra => true)
@@ -231,6 +318,8 @@ vhost(lines, "debconf18.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, "wiki.debconf.org"              , :ssl => true, :extra => true)
+vhost(lines, "www.debconf.org"               , :ssl => true, :extra => true)
 
 vhost(lines, "deb.debian.org"                , :extra => true)
 vhost(lines, "release.debian.org"            , :ssl => true, :extra => true)
@@ -298,6 +387,56 @@ lines.join("\n")
        Use common-ssl-HSTS
 </VirtualHost>
 
+Use common-dsa-vhost-https-redirect lists.alioth.debian.org
+<VirtualHost <%= @vhost_listen_443 %> >
+       ServerName lists.alioth.debian.org
+       ServerAdmin debian-admin@debian.org
+       Use common-debian-service-ssl lists.alioth.debian.org
+       Use common-ssl-HSTS
+       Redirect / https://alioth-lists.debian.net/
+</VirtualHost>
+
+Use common-dsa-vhost-https-redirect pkg-ruby-extras.alioth.debian.org
+<VirtualHost <%= @vhost_listen_443 %> >
+       ServerName pkg-ruby-extras.alioth.debian.org
+       ServerAdmin debian-admin@debian.org
+       Use common-debian-service-ssl pkg-ruby-extras.alioth.debian.org
+       Use common-ssl-HSTS
+       Redirect / https://gemwatch.debian.net/
+</VirtualHost>
+
+Use common-dsa-vhost-https-redirect video.debconf.org
+<VirtualHost <%= @vhost_listen_443 %> >
+       ServerName video.debconf.org
+       ServerAdmin debian-admin@debian.org
+       Use common-debian-service-ssl video.debconf.org
+       Use common-ssl-HSTS
+       Redirect / https://debconf-video-team.pages.debian.net/docs/
+</VirtualHost>
+
+<% if scope.function_has_static_component(['metadata.ftp-master.debian.org']) -%>
+<VirtualHost <%= @vhost_listen_443 %> >
+       ServerName metadata.ftp-master.debian.org
+       ServerAlias metadata-backend.ftp-master.debian.org
+       # all self-referential URLs should use the public host name
+       UseCanonicalName On
+       Use common-debian-service-ssl metadata-backend.ftp-master.debian.org
+       ErrorLog /var/log/apache2/metadata-backend.ftp-master.debian.org-error.log
+       CustomLog /var/log/apache2/metadata-backend.ftp-master.debian.org-access.log privacy
+
+       Use static-vhost-base-metadata.ftp-master.debian.org
+</VirtualHost>
+<% end -%>
+
+Use common-dsa-vhost-https-redirect debconf.org
+<VirtualHost <%= @vhost_listen_443 %> >
+       ServerName debconf.org
+       ServerAdmin debian-admin@debian.org
+       Use common-debian-service-ssl debconf.org
+       Use common-ssl-HSTS
+       Redirect / https://www.debconf.org/
+</VirtualHost>
+
 # historical sites
 ##################
 # now only redirects remain
@@ -366,5 +505,50 @@ Use common-dsa-vhost-https-redirect archive.debian.net
        Use common-disabled-service
 </VirtualHost>
 
+<VirtualHost <%= @vhost_listen %> >
+       ServerName cdimage.debian.org
+       ServerAlias cloud.debian.org
+       ServerAlias get.debian.org
+       ServerAlias bttracker.debian.org
+       ServerAlias meetings-archive.debian.net
+       ServerAdmin debian-admin@debian.org
+       ErrorLog /var/log/apache2/cdimage.debian.org-error.log
+       CustomLog /var/log/apache2/cdimage.debian.org-access.log privacyssl
+
+       <IfModule mod_userdir.c>
+               UserDir disabled
+       </IfModule>
+       DocumentRoot /srv/static.debian.org/puppet/cdimage.debian.org
+       <Directory /srv/static.debian.org/puppet/cdimage.debian.org>
+               Require all granted
+       </Directory>
+       RewriteEngine On
+       RewriteRule !^/503.html / [R=503]
+       ErrorDocument 503 /503.html
+</VirtualHost>
+
+<VirtualHost <%= @vhost_listen_443 %> >
+       ServerName cdimage.debian.org
+       ServerAlias cloud.debian.org
+       ServerAlias get.debian.org
+       ServerAlias bttracker.debian.org
+       ServerAlias meetings-archive.debian.net
+       ServerAdmin debian-admin@debian.org
+       ErrorLog /var/log/apache2/cdimage.debian.org-error.log
+       CustomLog /var/log/apache2/cdimage.debian.org-access.log privacyssl
+       Use common-debian-service-ssl cdimage.debian.org
+
+       <IfModule mod_userdir.c>
+               UserDir disabled
+       </IfModule>
+       DocumentRoot /srv/static.debian.org/puppet/cdimage.debian.org
+       <Directory /srv/static.debian.org/puppet/cdimage.debian.org>
+               Require all granted
+       </Directory>
+       RewriteEngine On
+       RewriteRule !^/503.html / [R=503]
+       ErrorDocument 503 /503.html
+</VirtualHost>
+
 
 # vim:ft=apache: