move lintian to standard static setup
[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]
123                         lines << "Use common-dsa-vhost-https-redirect #{sn}"
124                         lines << "Use static-vhost-ssl-#{sn}"
125                 else
126                         lines << "Use static-vhost-plain-#{sn}"
127                 end
128
129                 onion = scope.function_onion_global_service_hostname([sn])
130                 lines << "Use static-vhost-onion-#{sn} #{onion}" if onion
131
132                 lines << ""
133         end
134 end
135
136 lines = []
137 vhost(lines, "mozilla.debian.net")
138 vhost(lines, "backports.debian.org", :ssl => true)
139 vhost(lines, "incoming.debian.org")
140 vhost(lines, "incoming.ports.debian.org")
141 vhost(lines, "debdeltas.debian.net")
142 vhost(lines, "news.debian.net"         , :ssl => true)
143 vhost(lines, "debaday.debian.net"      , :ssl => true)
144 vhost(lines, "timeline.debian.net"     , :ssl => true)
145 vhost(lines, "network-test.debian.org" , :extra => true)
146 vhost(lines, "blends.debian.org"       , :ssl => true)
147 vhost(lines, "wnpp-by-tags.debian.net" , :ssl => true)
148 vhost(lines, "security-team.debian.org", :ssl => true)
149 vhost(lines, "d-i.debian.org"      , :ssl => true)
150 vhost(lines, "appstream.debian.org", :ssl => true)
151 vhost(lines, "dsa.debian.org"      , :ssl => true)
152 vhost(lines, "rtc.debian.org"      , :ssl => true)
153 vhost(lines, "onion.debian.org"    , :ssl => true)
154
155 vhost(lines, "bits.debian.org"     , :ssl => true, :extra => true)
156 vhost(lines, "micronews.debian.net", :ssl => true)
157 vhost(lines, "metadata.ftp-master.debian.org", :extra => true)
158
159 vhost(lines, "10years.debconf.org" , :ssl => true)
160 vhost(lines, "debconf0.debconf.org", :ssl => true)
161 vhost(lines, "debconf1.debconf.org", :ssl => true)
162 vhost(lines, "debconf2.debconf.org", :ssl => true)
163 vhost(lines, "debconf3.debconf.org", :ssl => true)
164 vhost(lines, "debconf4.debconf.org", :ssl => true)
165 vhost(lines, "debconf5.debconf.org", :ssl => true)
166 vhost(lines, "debconf6.debconf.org", :ssl => true)
167 vhost(lines, "debconf7.debconf.org", :ssl => true)
168 vhost(lines, "es.debconf.org"      , :ssl => true)
169 vhost(lines, "fr.debconf.org"      , :ssl => true)
170 vhost(lines, "miniconf10.debconf.org" , :ssl => true)
171
172 vhost(lines, "deb.debian.org", :extra => true)
173 vhost(lines, "release.debian.org", :ssl => true, :extra => true)
174 vhost(lines, "www.ports.debian.org", :ssl => true, :extra => true)
175 vhost(lines, "lintian.debian.org", :ssl => true, :extra => true)
176
177 lines.join("\n")
178 -%>
179
180 # www.backports.org
181 ###################
182 # www.backports.org is the historical place for the backports
183 # website and archive.  It is now a CNAME to backports.debian.org:
184 # redirect http requests.
185 <VirtualHost <%= vhost_listen %> >
186         ServerName www.backports.org
187         ServerAlias lists.backports.org
188         ServerAdmin debian-admin@debian.org
189         RedirectPermanent / http://backports.debian.org/
190 </VirtualHost>
191
192 ######################
193 <VirtualHost <%= vhost_listen %> >
194         ServerName www.debian-ports.org
195         ServerAlias debian-ports.org
196         ServerAdmin debian-admin@debian.org
197         RedirectPermanent / https://www.ports.debian.org/
198 </VirtualHost>
199
200 <VirtualHost <%= vhost_listen %> >
201         ServerName ports.debian.org
202         ServerAlias ports.debian.net
203         ServerAdmin debian-admin@debian.org
204         RedirectPermanent / https://www.ports.debian.org/
205 </VirtualHost>
206
207 <VirtualHost <%= vhost_listen %> >
208         ServerName incoming.debian-ports.org
209         ServerAdmin debian-admin@debian.org
210         RedirectPermanent / http://incoming.ports.debian.org/
211 </VirtualHost>
212
213 <VirtualHost <%= vhost_listen %> >
214         ServerName ftp.debian-ports.org
215         ServerAdmin debian-admin@debian.org
216         RedirectPermanent /archive http://www.ports.debian.org
217         RedirectPermanent /debian http://ftp.ports.debian.org/debian-ports
218         RedirectPermanent /debian-cd http://ftp.ports.debian.org/debian-ports-cd
219         RedirectPermanent / http://ftp.ports.debian.org/
220 </VirtualHost>
221
222 <VirtualHost <%= vhost_listen %> >
223         ServerName video.debian.net
224         ServerAdmin debian-admin@debian.org
225         Redirect / http://meetings-archive.debian.net/pub/debian-meetings/
226 </VirtualHost>
227
228 # historical sites
229 ##################
230 # now only redirects remain
231 <VirtualHost <%= vhost_listen %> >
232         ServerName women.debian.org
233         ServerAdmin debian-admin@debian.org
234
235         RedirectPermanent / http://www.debian.org/women/
236
237         RedirectPermanent /about/ http://www.debian.org/women/about
238         RedirectPermanent /contact/ http://www.debian.org/women/contact
239         RedirectPermanent /faqs/ http://www.debian.org/women/faq
240         RedirectPermanent /home/ http://www.debian.org/women/
241         RedirectPermanent /images/dw.png http://www.debian.org/women/dw.png
242         RedirectPermanent /involvement/ http://www.debian.org/women/participate
243         RedirectPermanent /mentoring/ http://www.debian.org/women/mentoring
244         RedirectPermanent /press/ http://wiki.debian.org/DebianWomen/Press
245         RedirectPermanent /profiles/ http://www.debian.org/women/profiles/
246 </VirtualHost>
247
248 <VirtualHost <%= vhost_listen %> >
249         ServerName volatile.debian.org
250         ServerAlias volatile-master.debian.org
251         ServerAdmin debian-admin@debian.org
252         RedirectPermanent / http://www.debian.org/volatile/
253 </VirtualHost>
254
255 <VirtualHost <%= vhost_listen %> >
256         ServerName ftp-master.metadata.debian.org
257         ServerAdmin debian-admin@debian.org
258         RedirectPermanent / http://metadata.ftp-master.debian.org/
259 </VirtualHost>
260
261 # vim:ft=apache: