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