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