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