Add apt.buildd.d.o
[mirror/dsa-puppet.git] / modules / roles / templates / static-mirroring / vhost / static-vhosts-simple.erb
1 # puppet maintained
2
3 ######################
4 # deb.debian.org
5 <% if scope.function_has_static_component(['deb.debian.org']) -%>
6 <Macro vstatic-vhost-extra-deb.debian.org>
7         Redirect /debian/           http://cdn-fastly.deb.debian.org/debian/
8         Redirect /debian-debug/     http://cdn-fastly.deb.debian.org/debian-debug/
9         Redirect /debian-ports/     http://cdn-fastly.deb.debian.org/debian-ports/
10         Redirect /debian-security/  http://cdn-fastly.deb.debian.org/debian-security/
11 </Macro>
12
13 <VirtualHost <%= vhost_listen_443 %> >
14         ServerName deb.debian.org
15
16         ErrorLog /var/log/apache2/deb.debian.org-error.log
17         CustomLog /var/log/apache2/deb.debian.org-access.log privacyssl
18
19         Use common-debian-service-ssl deb.debian.org
20         Use common-ssl-HSTS
21
22         ServerAdmin debian-admin@lists.debian.org
23         <IfModule mod_userdir.c>
24                 UserDir disabled
25         </IfModule>
26         ServerSignature On
27
28         DocumentRoot /srv/static.debian.org/mirrors/deb.debian.org/cur
29         <Directory /srv/static.debian.org/mirrors/deb.debian.org/cur>
30                 AllowOverride FileInfo Indexes Options=Multiviews
31                 Options Indexes SymLinksIfOwnerMatch
32                 IndexOptions FancyIndexing NameWidth=*
33                 Require all granted
34         </Directory>
35
36         Header set Surrogate-Key <%= hostname %>
37
38         AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
39
40         Redirect /debian/           https://cdn-aws.deb.debian.org/debian/
41         Redirect /debian-debug/     https://cdn-aws.deb.debian.org/debian-debug/
42         Redirect /debian-ports/     https://cdn-aws.deb.debian.org/debian-ports/
43         Redirect /debian-security/  https://cdn-aws.deb.debian.org/debian-security/
44 </VirtualHost>
45 <% end -%>
46
47 <Macro vstatic-vhost-extra-network-test.debian.org>
48         ServerAlias network-test-backend.debian.org
49 </Macro>
50
51 <Macro vstatic-vhost-extra-bits.debian.org>
52         <IfModule mod_geoip.c>
53                 CustomLog /var/log/apache2/bits.debian.org-public-access.log privacy+geo
54         </IfModule>
55 </Macro>
56
57 <Macro vstatic-vhost-extra-metadata.ftp-master.debian.org>
58         AddDefaultCharset utf-8
59
60         # Rewrite away double slashes
61         RewriteEngine on
62         RewriteCond %{REQUEST_URI} ^(.*)//(.*)$ [NC]
63         RewriteRule . %1/%2 [R=301,L,NE]
64
65         <LocationMatch "/changelogs/(main|contrib|non-free)">
66                 ForceType text/plain
67         </LocationMatch>
68 </Macro>
69
70 <Macro vstatic-vhost-extra-release.debian.org>
71         RewriteEngine   on
72         RewriteRule             ^/migration/$                   /migration/testing.pl
73         RewriteRule             ^/migration/search/(.+)/$       /migration/testing.pl?package=$1
74         RewriteCond             %{QUERY_STRING} package=((.)(.*))
75         RewriteRule             ^/migration/testing.pl          /migration/cache/%2/%1.html [PT,L]
76         RewriteRule             ^/migration/testing.pl          /migration/cache/_index.html
77
78         Alias /proposed-updates/ /srv/static.debian.org/mirrors/release.debian.org-pu/cur/
79         <Directory /srv/static.debian.org/mirrors/release.debian.org-pu/cur>
80                 Require all granted
81                 Options Indexes SymLinksIfOwnerMatch MultiViews
82                 IndexOptions FancyIndexing NameWidth=*
83
84                 AddEncoding gzip .gz
85                 FilterDeclare gzip CONTENT_SET
86                 FilterProvider gzip inflate "%{req:Accept-Encoding} !~ /gzip/"
87                 FilterChain gzip
88                 <Files *.debdiff.gz>
89                         ForceType text/plain
90                         AddDefaultCharset utf-8
91                 </Files>
92                 <Files *.debdiff.html.gz>
93                         ForceType text/html
94                         AddDefaultCharset utf-8
95                 </Files>
96         </Directory>
97 </Macro>
98
99 <Macro vstatic-vhost-extra-www.ports.debian.org>
100         <Directory /srv/static.debian.org/mirrors/www.ports.debian.org/cur>
101                 AllowOverride FileInfo Indexes Options=Multiviews
102                 Options Multiviews Indexes FollowSymLinks Includes
103                 IndexOptions FancyIndexing NameWidth=*
104                 Require all granted
105         </Directory>
106
107         AddOutputFilter INCLUDES .xhtml
108 </Macro>
109
110
111 <Macro vstatic-vhost-extra-lintian.debian.org>
112         AddDefaultCharset utf-8
113
114         <Directory /srv/static.debian.org/mirrors/lintian.debian.org/cur>
115                 Require all granted
116
117                 # These three lines makes apache serve
118                 # "lintian.log.gz" as a text/plain with encoding gzip
119                 # making it easier to view the log in the browser.
120                 RemoveType .gz
121                 AddEncoding x-gzip .gz
122                 AddType text/plain .log
123
124                 <IfModule mod_userdir.c>
125                         AddOutputFilterByType DEFLATE image/svg+xml
126                         AddOutputFilterByType DEFLATE text/plain
127                 </IfModule>
128         </Directory>
129
130         <Directory /srv/static.debian.org/mirrors/lintian.debian.org/cur/resources>
131                 # Cache these for a year (3600 * 24 * 365.25)
132                 # Files in here will change name if their content change
133                 Header set Cache-Control "max-age=31557600, public"
134         </Directory>
135
136         RewriteEngine on
137         RewriteMap source-map txt:/srv/static.debian.org/mirrors/lintian.debian.org/cur/lookup-tables/source-packages
138
139         # Re-direct from the "old" locations to the new ones
140         RewriteRule ^/reports/T(.*)\.html$ /tags/$1.html [L,R=permanent]
141         RewriteRule ^/reports/(.*)$ /$1 [L,R=permanent]
142
143         # Map source packages to reports (this mapping is re-written once per lintian run,
144         # serve it as a 302 rather than a permanent redirect)
145         # Version-less request
146         RewriteRule ^/source/([a-z0-9-]+)/?$ /${source-map:$1} [L,R,NE]
147         # Versioned request
148         RewriteRule ^/source/([a-z0-9-]+)/([a-zA-Z0-9.+:~-]+)$ /${source-map:$1/$2} [L,R,NE]
149 </Macro>
150
151 <%=
152
153 def vhost(lines, sn, kwargs={})
154         if scope.function_has_static_component([sn])
155                 if not kwargs[:extra]
156                                 lines << "<Macro vstatic-vhost-extra-#{sn}>"
157                                 lines << "  # mod macro does not like empty macros, so here's some content:"
158                                 lines << "  <Directory /non-existant>"
159                                 lines << "  </Directory>"
160                                 lines << "</Macro>"
161                 end
162
163                 lines << "Use prepare-static-vhost #{sn}"
164
165                 if kwargs[:ssl] and kwargs[:ssl_optional]
166                         lines << "Use static-vhost-plain-#{sn}"
167                         lines << "Use static-vhost-ssl-#{sn}"
168                 elsif kwargs[:ssl]
169                         lines << "Use common-dsa-vhost-https-redirect #{sn}"
170                         lines << "Use static-vhost-ssl-#{sn}"
171                 else
172                         lines << "Use static-vhost-plain-#{sn}"
173                 end
174
175                 onion = scope.function_onion_global_service_hostname([sn])
176                 lines << "Use static-vhost-onion-#{sn} #{onion}" if onion
177
178                 lines << ""
179         end
180 end
181
182 lines = []
183 vhost(lines, "mozilla.debian.net"            , :ssl => true, :ssl_optional => true)
184 vhost(lines, "backports.debian.org"          , :ssl => true)
185 vhost(lines, "incoming.debian.org"           , :ssl => true, :ssl_optional => true)
186 vhost(lines, "incoming.ports.debian.org"     , :ssl => true, :ssl_optional => true)
187 vhost(lines, "debdeltas.debian.net"          , :ssl => true, :ssl_optional => true)
188 vhost(lines, "news.debian.net"               , :ssl => true)
189 vhost(lines, "bootstrap.debian.net"          , :ssl => true)
190 vhost(lines, "debaday.debian.net"            , :ssl => true)
191 vhost(lines, "timeline.debian.net"           , :ssl => true)
192 vhost(lines, "network-test.debian.org"       , :extra => true)
193 vhost(lines, "blends.debian.org"             , :ssl => true)
194 vhost(lines, "wnpp-by-tags.debian.net"       , :ssl => true)
195 vhost(lines, "security-team.debian.org"      , :ssl => true)
196 vhost(lines, "d-i.debian.org"                , :ssl => true)
197 vhost(lines, "appstream.debian.org"          , :ssl => true)
198 vhost(lines, "apt.buildd.debian.org"         , :ssl => true)
199 vhost(lines, "dsa.debian.org"                , :ssl => true)
200 vhost(lines, "rtc.debian.org"                , :ssl => true)
201 vhost(lines, "onion.debian.org"              , :ssl => true)
202
203 vhost(lines, "bits.debian.org"               , :ssl => true, :extra => true)
204 vhost(lines, "micronews.debian.org"          , :ssl => true)
205 vhost(lines, "metadata.ftp-master.debian.org", :extra => true)
206
207 vhost(lines, "10years.debconf.org"           , :ssl => true)
208 vhost(lines, "debconf0.debconf.org"          , :ssl => true)
209 vhost(lines, "debconf1.debconf.org"          , :ssl => true)
210 vhost(lines, "debconf2.debconf.org"          , :ssl => true)
211 vhost(lines, "debconf3.debconf.org"          , :ssl => true)
212 vhost(lines, "debconf4.debconf.org"          , :ssl => true)
213 vhost(lines, "debconf5.debconf.org"          , :ssl => true)
214 vhost(lines, "debconf6.debconf.org"          , :ssl => true)
215 vhost(lines, "debconf7.debconf.org"          , :ssl => true)
216 vhost(lines, "debconf16.debconf.org"         , :ssl => true)
217 vhost(lines, "es.debconf.org"                , :ssl => true)
218 vhost(lines, "fr.debconf.org"                , :ssl => true)
219 vhost(lines, "miniconf10.debconf.org"        , :ssl => true)
220
221 vhost(lines, "deb.debian.org"                , :extra => true)
222 vhost(lines, "release.debian.org"            , :ssl => true, :extra => true)
223 vhost(lines, "www.ports.debian.org"          , :ssl => true, :extra => true)
224 vhost(lines, "lintian.debian.org"            , :ssl => true, :extra => true)
225
226 lines.join("\n")
227 -%>
228
229 # www.backports.org
230 ###################
231 # www.backports.org is the historical place for the backports
232 # website and archive.  It is now a CNAME to backports.debian.org:
233 # redirect http requests.
234 <VirtualHost <%= vhost_listen %> >
235         ServerName www.backports.org
236         ServerAlias lists.backports.org
237         ServerAdmin debian-admin@debian.org
238         RedirectPermanent / http://backports.debian.org/
239 </VirtualHost>
240
241 ######################
242 <VirtualHost <%= vhost_listen %> >
243         ServerName www.debian-ports.org
244         ServerAlias debian-ports.org
245         ServerAdmin debian-admin@debian.org
246         RedirectPermanent / https://www.ports.debian.org/
247 </VirtualHost>
248
249 <VirtualHost <%= vhost_listen %> >
250         ServerName ports.debian.org
251         ServerAlias ports.debian.net
252         ServerAdmin debian-admin@debian.org
253         RedirectPermanent / https://www.ports.debian.org/
254 </VirtualHost>
255
256 <VirtualHost <%= vhost_listen %> >
257         ServerName incoming.debian-ports.org
258         ServerAdmin debian-admin@debian.org
259         RedirectPermanent / http://incoming.ports.debian.org/
260 </VirtualHost>
261
262 <VirtualHost <%= vhost_listen %> >
263         ServerName ftp.debian-ports.org
264         ServerAdmin debian-admin@debian.org
265         RedirectPermanent /archive http://www.ports.debian.org
266         RedirectPermanent /debian http://ftp.ports.debian.org/debian-ports
267         RedirectPermanent /debian-cd http://ftp.ports.debian.org/debian-ports-cd
268         RedirectPermanent / http://ftp.ports.debian.org/
269 </VirtualHost>
270
271 <VirtualHost <%= vhost_listen %> >
272         ServerName video.debian.net
273         ServerAdmin debian-admin@debian.org
274         Redirect / http://meetings-archive.debian.net/pub/debian-meetings/
275 </VirtualHost>
276
277 # historical sites
278 ##################
279 # now only redirects remain
280 <VirtualHost <%= vhost_listen %> >
281         ServerName women.debian.org
282         ServerAdmin debian-admin@debian.org
283
284         RedirectPermanent / http://www.debian.org/women/
285
286         RedirectPermanent /about/ http://www.debian.org/women/about
287         RedirectPermanent /contact/ http://www.debian.org/women/contact
288         RedirectPermanent /faqs/ http://www.debian.org/women/faq
289         RedirectPermanent /home/ http://www.debian.org/women/
290         RedirectPermanent /images/dw.png http://www.debian.org/women/dw.png
291         RedirectPermanent /involvement/ http://www.debian.org/women/participate
292         RedirectPermanent /mentoring/ http://www.debian.org/women/mentoring
293         RedirectPermanent /press/ http://wiki.debian.org/DebianWomen/Press
294         RedirectPermanent /profiles/ http://www.debian.org/women/profiles/
295 </VirtualHost>
296
297 <VirtualHost <%= vhost_listen %> >
298         ServerName volatile.debian.org
299         ServerAlias volatile-master.debian.org
300         ServerAdmin debian-admin@debian.org
301         RedirectPermanent / http://www.debian.org/volatile/
302 </VirtualHost>
303
304 <VirtualHost <%= vhost_listen %> >
305         ServerName ftp-master.metadata.debian.org
306         ServerAdmin debian-admin@debian.org
307         RedirectPermanent / http://metadata.ftp-master.debian.org/
308 </VirtualHost>
309
310 <VirtualHost <%= vhost_listen %> >
311         ServerName backports-master.debian.org
312         ServerAdmin debian-admin@debian.org
313         RedirectPermanent / https://backports.debian.org/
314 </VirtualHost>
315
316 # vim:ft=apache: