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