re-write how static vhosts with extra config work
[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 vhost-deb.debian.org-extra>
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 vhost-network-test.debian.org-extra>
15         ServerAlias network-test-backend.debian.org
16 </Macro>
17
18 <%=
19
20 def vhost(lines, sn, type=nil)
21   if scope.function_has_static_component([sn])
22     t = 'common-static-vhost'
23     if type then t += "-#{type}"; end
24
25     lines << "Use #{t} #{sn}"
26   end
27 end
28
29 lines = []
30 vhost(lines, "mozilla.debian.net")
31 vhost(lines, "backports.debian.org", "ssl")
32 vhost(lines, "incoming.debian.org")
33 vhost(lines, "incoming.ports.debian.org")
34 vhost(lines, "debdeltas.debian.net")
35 vhost(lines, "news.debian.net"         , "ssl")
36 vhost(lines, "debaday.debian.net"      , "ssl")
37 vhost(lines, "timeline.debian.net"     , "ssl")
38 vhost(lines, "network-test.debian.org" , "with-extra")
39 vhost(lines, "blends.debian.org"       , "ssl")
40 vhost(lines, "wnpp-by-tags.debian.net" , "ssl")
41 vhost(lines, "security-team.debian.org", "ssl")
42 vhost(lines, "d-i.debian.org"      , "ssl")
43 vhost(lines, "appstream.debian.org", "ssl")
44 vhost(lines, "dsa.debian.org"      , "ssl")
45 vhost(lines, "rtc.debian.org"      , "ssl")
46
47 vhost(lines, "10years.debconf.org" , "ssl")
48 vhost(lines, "debconf0.debconf.org", "ssl")
49 vhost(lines, "debconf1.debconf.org", "ssl")
50 vhost(lines, "debconf2.debconf.org", "ssl")
51 vhost(lines, "debconf3.debconf.org", "ssl")
52 vhost(lines, "debconf4.debconf.org", "ssl")
53 vhost(lines, "debconf5.debconf.org", "ssl")
54 vhost(lines, "debconf6.debconf.org", "ssl")
55 vhost(lines, "debconf7.debconf.org", "ssl")
56 vhost(lines, "es.debconf.org"      , "ssl")
57 vhost(lines, "fr.debconf.org"      , "ssl")
58 vhost(lines, "miniconf10.debconf.org" , "ssl")
59
60 vhost(lines, "deb.debian.org", "with-extra")
61
62 lines.join("\n")
63 -%>
64
65 ######################
66 # metadata.ftp-master.debian.org
67 <% if scope.function_has_static_component(['metadata.ftp-master.debian.org']) -%>
68 <VirtualHost <%= vhost_listen %> >
69         ServerName metadata.ftp-master.debian.org
70         ServerAdmin debian-admin@lists.debian.org
71
72         ErrorLog /var/log/apache2/metadata.ftp-master.debian.org-error.log
73         CustomLog /var/log/apache2/metadata.ftp-master.debian.org-access.log privacy
74
75         Use common-static-base metadata.ftp-master.debian.org
76         AddDefaultCharset utf-8
77         <LocationMatch "/changelogs/(main|contrib|non-free)">
78                 ForceType text/plain
79         </LocationMatch>
80 </VirtualHost>
81 <% end -%>
82
83 ######################
84 # bits.debian.org
85 <% if scope.function_has_static_component(['bits.debian.org']) -%>
86 <Macro static-bits.debian.org-base>
87         ServerName bits.debian.org
88         ServerAdmin debian-admin@lists.debian.org
89
90         ErrorLog /var/log/apache2/bits.debian.org-error.log
91         <IfModule mod_geoip.c>
92                 CustomLog /var/log/apache2/bits.debian.org-public-access.log privacy+geo
93         </IfModule>
94
95         Use common-static-base bits.debian.org
96 </Macro>
97
98 <Virtualhost <%= vhost_listen %> >
99         RewriteEngine on
100
101         RewriteEngine On
102         RewriteCond %{REQUEST_URI} !^/feeds/
103         RewriteRule ^/(.*)$ https://bits.debian.org/$1 [R,L]
104         #RewriteRule ^/(.*)$ https://bits.debian.org/$1 [R=301,L]
105
106         Use static-bits.debian.org-base
107         CustomLog /var/log/apache2/bits.debian.org-access.log privacy
108 </VirtualHost>
109
110 <Virtualhost <%= vhost_listen_443 %> >
111         Use static-bits.debian.org-base
112         CustomLog /var/log/apache2/bits.debian.org-access.log privacyssl
113
114         Use common-debian-service-ssl bits.debian.org
115         Use common-ssl-HSTS
116 </VirtualHost>
117 <% end -%>
118
119 ######################
120 # release.debian.org
121 <% if scope.function_has_static_component(['release.debian.org']) -%>
122 Use common-dsa-vhost-https-redirect release.debian.org
123 <VirtualHost <%= vhost_listen_443 %> >
124         ServerName release.debian.org
125         ServerAdmin debian-admin@debian.org
126
127         ErrorLog /var/log/apache2/release.debian.org-error.log
128         CustomLog /var/log/apache2/release.debian.org-access.log privacy
129
130         Use common-debian-service-ssl release.debian.org
131         Use common-ssl-HSTS
132
133         Use common-static-base release.debian.org
134
135         RewriteEngine   on
136         RewriteRule             ^/migration/$                   /migration/testing.pl
137         RewriteRule             ^/migration/search/(.+)/$       /migration/testing.pl?package=$1
138         RewriteCond             %{QUERY_STRING} package=((.)(.*))
139         RewriteRule             ^/migration/testing.pl          /migration/cache/%2/%1.html [PT,L]
140         RewriteRule             ^/migration/testing.pl          /migration/cache/_index.html
141
142         Alias /proposed-updates/ /srv/static.debian.org/mirrors/release.debian.org-pu/cur/
143         <Directory /srv/static.debian.org/mirrors/release.debian.org-pu/cur>
144                 Require all granted
145                 Options Indexes SymLinksIfOwnerMatch MultiViews
146                 IndexOptions FancyIndexing NameWidth=*
147
148                 AddEncoding gzip .gz
149                 FilterDeclare gzip CONTENT_SET
150                 FilterProvider gzip inflate "%{req:Accept-Encoding} !~ /gzip/"
151                 FilterChain gzip
152                 <Files *.debdiff.gz>
153                         ForceType text/plain
154                 </Files>
155         </Directory>
156 </VirtualHost>
157 <% end -%>
158
159 # www.backports.org
160 ###################
161 # www.backports.org is the historical place for the backports
162 # website and archive.  It is now a CNAME to backports.debian.org:
163 # redirect http requests.
164 <VirtualHost <%= vhost_listen %> >
165         ServerName www.backports.org
166         ServerAlias lists.backports.org
167         ServerAdmin debian-admin@debian.org
168         RedirectPermanent / http://backports.debian.org/
169 </VirtualHost>
170
171 ######################
172 # www.ports.debian.org
173 <% if scope.function_has_static_component(['www.ports.debian.org']) -%>
174
175 Use common-dsa-vhost-https-redirect www.ports.debian.org
176
177 <Virtualhost <%= vhost_listen_443 %> >
178         ServerName www.ports.debian.org
179         ServerAlias www.ports-backend.debian.org
180         ServerAdmin debian-admin@lists.debian.org
181
182         ErrorLog /var/log/apache2/www.ports.debian.org-error.log
183         CustomLog /var/log/apache2/www.ports.debian.org-access.log privacy
184
185         Use common-debian-service-ssl www.ports.debian.org
186         Use common-ssl-HSTS
187
188         <IfModule mod_userdir.c>
189                 UserDir disabled
190         </IfModule>
191         ServerSignature On
192
193         DocumentRoot /srv/static.debian.org/mirrors/www.ports.debian.org/cur
194         <Directory /srv/static.debian.org/mirrors/www.ports.debian.org/cur>
195                 AllowOverride FileInfo Indexes Options=Multiviews
196                 Options Multiviews Indexes FollowSymLinks Includes
197                 IndexOptions FancyIndexing NameWidth=*
198                 Require all granted
199         </Directory>
200
201         AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
202         AddOutputFilter INCLUDES .xhtml
203 </VirtualHost>
204 <% end -%>
205
206 <VirtualHost <%= vhost_listen %> >
207         ServerName www.debian-ports.org
208         ServerAlias debian-ports.org
209         ServerAdmin debian-admin@debian.org
210         RedirectPermanent / https://www.ports.debian.org/
211 </VirtualHost>
212
213 <VirtualHost <%= vhost_listen %> >
214         ServerName ports.debian.org
215         ServerAlias ports.debian.net
216         ServerAdmin debian-admin@debian.org
217         RedirectPermanent / https://www.ports.debian.org/
218 </VirtualHost>
219
220 <VirtualHost <%= vhost_listen %> >
221         ServerName incoming.debian-ports.org
222         ServerAdmin debian-admin@debian.org
223         RedirectPermanent / http://incoming.ports.debian.org/
224 </VirtualHost>
225
226 <VirtualHost <%= vhost_listen %> >
227         ServerName ftp.debian-ports.org
228         ServerAdmin debian-admin@debian.org
229         RedirectPermanent /archive http://www.ports.debian.org
230         RedirectPermanent /debian http://ftp.ports.debian.org/debian-ports
231         RedirectPermanent /debian-cd http://ftp.ports.debian.org/debian-ports-cd
232         RedirectPermanent / http://ftp.ports.debian.org/
233 </VirtualHost>
234
235 # video.debian.net
236 ###################
237 <VirtualHost <%= vhost_listen %> >
238         ServerName video.debian.net
239         ServerAdmin debian-admin@debian.org
240
241         Redirect / http://meetings-archive.debian.net/pub/debian-meetings/
242 </VirtualHost>
243
244 # historical sites
245 ##################
246 # now only redirects remain
247 <VirtualHost <%= vhost_listen %> >
248         ServerName women.debian.org
249         ServerAdmin debian-admin@debian.org
250
251         RedirectPermanent / http://www.debian.org/women/
252
253         RedirectPermanent /about/ http://www.debian.org/women/about
254         RedirectPermanent /contact/ http://www.debian.org/women/contact
255         RedirectPermanent /faqs/ http://www.debian.org/women/faq
256         RedirectPermanent /home/ http://www.debian.org/women/
257         RedirectPermanent /images/dw.png http://www.debian.org/women/dw.png
258         RedirectPermanent /involvement/ http://www.debian.org/women/participate
259         RedirectPermanent /mentoring/ http://www.debian.org/women/mentoring
260         RedirectPermanent /press/ http://wiki.debian.org/DebianWomen/Press
261         RedirectPermanent /profiles/ http://www.debian.org/women/profiles/
262 </VirtualHost>
263
264 <VirtualHost <%= vhost_listen %> >
265         ServerName volatile.debian.org
266         ServerAlias volatile-master.debian.org
267         ServerAdmin debian-admin@debian.org
268         RedirectPermanent / http://www.debian.org/volatile/
269 </VirtualHost>
270
271 <VirtualHost <%= vhost_listen %> >
272         ServerName ftp-master.metadata.debian.org
273         ServerAdmin debian-admin@debian.org
274         RedirectPermanent / http://metadata.ftp-master.debian.org/
275 </VirtualHost>
276
277 # vim:ft=apache: