]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/roles/templates/static-mirroring/vhost/lintian.debian.org.erb
7d97eeee08e1c41248b37d17eb156c414e103dea
[dsa-puppet.git] / modules / roles / templates / static-mirroring / vhost / lintian.debian.org.erb
1 Use common-dsa-vhost-https-redirect-temp lintian.debian.org
2 Use common-dsa-vhost-https-redirect lintian.debian.org
3
4 <Virtualhost <%= vhost_listen_443 %> >
5         ServerName lintian.debian.org
6         ServerAdmin lintian-maint@debian.org
7
8         ErrorLog /var/log/apache2/lintian.debian.org-error.log
9         CustomLog /var/log/apache2/lintian.debian.org-access.log privacyssl
10
11         Use common-debian-service-ssl lintian.debian.org
12         #Use common-ssl-HSTS
13
14         <IfModule mod_userdir.c>
15                 UserDir disabled
16         </IfModule>
17
18         DocumentRoot /srv/static.debian.org/mirrors/lintian.debian.org/cur
19         AddDefaultCharset utf-8
20
21         <Directory /srv/static.debian.org/mirrors/lintian.debian.org/cur>
22                 # These two lines makes apache serve "lintian.log.gz" as a text/plain with encoding gzip
23                 # making it easier to view the log in the browser.
24                 RemoveType .gz
25                 AddEncoding x-gzip .gz
26                 AddType text/plain .log
27
28                 <IfModule mod_userdir.c>
29                         AddOutputFilterByType DEFLATE image/svg+xml
30                         AddOutputFilterByType DEFLATE text/plain
31                 </IfModule>
32         </Directory>
33
34         <Directory /srv/static.debian.org/mirrors/lintian.debian.org/cur/graphs>
35                 # Cache graphs for an hour (Technically, a "expires" of "24h after last mod"
36                 # might be better, but oh well)
37                 Header set Cache-Control "max-age=3600, must-revalidate, public"
38         </Directory>
39
40         <Directory /srv/static.debian.org/mirrors/lintian.debian.org/cur/resources>
41                 # Cache these for a year (3600 * 24 * 365.25)
42                 # Files in here will change name if their content change
43                 Header set Cache-Control "max-age=31557600, public"
44         </Directory>
45
46         RewriteEngine on
47         RewriteMap source-map txt:/srv/static.debian.org/mirrors/lintian.debian.org/cur/lookup-tables/source-packages
48
49         # Re-direct from the "old" locations to the new ones
50         RewriteRule ^/reports/T(.*)\.html$ /tags/$1.html [L,R=permanent]
51         RewriteRule ^/reports/(.*)$ /$1 [L,R=permanent]
52
53         # Map source packages to reports (this mapping is re-written once per lintian run,
54         # serve it as a 302 rather than a permanent redirect)
55         # Version-less request
56         RewriteRule ^/source/([a-z0-9-]+)/?$ /${source-map:$1} [L,R,NE]
57         # Versioned request
58         RewriteRule ^/source/([a-z0-9-]+)/([a-zA-Z0-9.+:~-]+)$ /${source-map:$1/$2} [L,R,NE]
59 </VirtualHost>
60 # vim:set syn=apache: