89a74d0f7731b322c2569747e15b1aa73e45cde2
[mirror/dsa-puppet.git] / modules / roles / templates / static-mirroring / vhost / lintian.debian.org.erb
1 <% if scope.function_has_static_component(['lintian.debian.org']) -%>
2
3 Use common-dsa-vhost-https-redirect lintian.debian.org
4
5 <Macro vhost-inner-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         <IfModule mod_userdir.c>
12                 UserDir disabled
13         </IfModule>
14
15         DocumentRoot /srv/static.debian.org/mirrors/lintian.debian.org/cur
16         AddDefaultCharset utf-8
17
18         <Directory /srv/static.debian.org/mirrors/lintian.debian.org/cur>
19                 Require all granted
20
21                 # These three lines makes apache serve
22                 # "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/resources>
35                 # Cache these for a year (3600 * 24 * 365.25)
36                 # Files in here will change name if their content change
37                 Header set Cache-Control "max-age=31557600, public"
38         </Directory>
39
40         RewriteEngine on
41         RewriteMap source-map txt:/srv/static.debian.org/mirrors/lintian.debian.org/cur/lookup-tables/source-packages
42
43         # Re-direct from the "old" locations to the new ones
44         RewriteRule ^/reports/T(.*)\.html$ /tags/$1.html [L,R=permanent]
45         RewriteRule ^/reports/(.*)$ /$1 [L,R=permanent]
46
47         # Map source packages to reports (this mapping is re-written once per lintian run,
48         # serve it as a 302 rather than a permanent redirect)
49         # Version-less request
50         RewriteRule ^/source/([a-z0-9-]+)/?$ /${source-map:$1} [L,R,NE]
51         # Versioned request
52         RewriteRule ^/source/([a-z0-9-]+)/([a-zA-Z0-9.+:~-]+)$ /${source-map:$1/$2} [L,R,NE]
53 </Macro>
54
55 <Virtualhost <%= vhost_listen_443 %> >
56         ServerName lintian.debian.org
57         Use common-debian-service-ssl lintian.debian.org
58         Use common-ssl-HSTS
59
60         Use vhost-inner-lintian.debian.org
61 </VirtualHost>
62
63 <% if scope.function_onion_global_service_hostname(['lintian.debian.org']) -%>
64 <Virtualhost <%= vhost_listen %> >
65         ServerName <%= scope.function_onion_global_service_hostname(['lintian.debian.org']) %>
66         Use vhost-inner-lintian.debian.org
67 </VirtualHost>
68 <% end %>
69 <% end -%>
70
71 # vim:set syn=apache: