Avoid double redirection for www.ports.debian.org
[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
15 <%=
16
17 def vhost(lines, sn, type=nil, extra=nil)
18   if scope.function_has_static_component([sn])
19     t = 'common-static-vhost'
20     if type then t += "-#{type}"; end
21
22     e = ''
23     if extra then e += " #{extra}"; end
24
25     lines << "Use #{t} #{sn}#{e}"
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", '"ServerAlias network-test-backend.debian.org"')
39 vhost(lines, "blends.debian.org"       , "with-extra", '"ServerAlias blends-backend.debian.org"')
40 vhost(lines, "wnpp-by-tags.debian.net" , "with-extra", '"ServerAlias wnpp-by-tags-backend.debian.org"')
41 vhost(lines, "security-team.debian.org", "with-extra", '"ServerAlias security-team-backend.debian.org"')
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", '"Use vhost-deb.debian.org-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 # www.backports.org
120 ###################
121 # www.backports.org is the historical place for the backports
122 # website and archive.  It is now a CNAME to backports.debian.org:
123 # redirect http requests.
124 <VirtualHost <%= vhost_listen %> >
125         ServerName www.backports.org
126         ServerAlias lists.backports.org
127         ServerAdmin debian-admin@debian.org
128         RedirectPermanent / http://backports.debian.org/
129 </VirtualHost>
130
131 ######################
132 # www.ports.debian.org
133 <% if scope.function_has_static_component(['www.ports.debian.org']) -%>
134
135 Use common-dsa-vhost-https-redirect www.ports.debian.org
136
137 <Virtualhost <%= vhost_listen_443 %> >
138         ServerName www.ports.debian.org
139         ServerAlias www.ports-backend.debian.org
140         ServerAdmin debian-admin@lists.debian.org
141
142         ErrorLog /var/log/apache2/www.ports.debian.org-error.log
143         CustomLog /var/log/apache2/www.ports.debian.org-access.log privacy
144
145         Use common-debian-service-ssl www.ports.debian.org
146         Use common-ssl-HSTS
147
148         <IfModule mod_userdir.c>
149                 UserDir disabled
150         </IfModule>
151         ServerSignature On
152
153         DocumentRoot /srv/static.debian.org/mirrors/www.ports.debian.org/cur
154         <Directory /srv/static.debian.org/mirrors/www.ports.debian.org/cur>
155                 AllowOverride FileInfo Indexes Options=Multiviews
156                 Options Multiviews Indexes FollowSymLinks Includes
157                 IndexOptions FancyIndexing NameWidth=*
158                 Require all granted
159         </Directory>
160
161         AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
162         AddOutputFilter INCLUDES .xhtml
163 </VirtualHost>
164 <% end -%>
165
166 <VirtualHost <%= vhost_listen %> >
167         ServerName www.debian-ports.org
168         ServerAlias debian-ports.org
169         ServerAdmin debian-admin@debian.org
170         RedirectPermanent / https://www.ports.debian.org/
171 </VirtualHost>
172
173 <VirtualHost <%= vhost_listen %> >
174         ServerName ports.debian.org
175         ServerAlias ports.debian.net
176         ServerAdmin debian-admin@debian.org
177         RedirectPermanent / https://www.ports.debian.org/
178 </VirtualHost>
179
180 # video.debian.net
181 ###################
182 <VirtualHost <%= vhost_listen %> >
183         ServerName video.debian.net
184         ServerAdmin debian-admin@debian.org
185
186         Redirect / http://meetings-archive.debian.net/pub/debian-meetings/
187 </VirtualHost>
188
189 # historical sites
190 ##################
191 # now only redirects remain
192 <VirtualHost <%= vhost_listen %> >
193         ServerName women.debian.org
194         ServerAdmin debian-admin@debian.org
195
196         RedirectPermanent / http://www.debian.org/women/
197
198         RedirectPermanent /about/ http://www.debian.org/women/about
199         RedirectPermanent /contact/ http://www.debian.org/women/contact
200         RedirectPermanent /faqs/ http://www.debian.org/women/faq
201         RedirectPermanent /home/ http://www.debian.org/women/
202         RedirectPermanent /images/dw.png http://www.debian.org/women/dw.png
203         RedirectPermanent /involvement/ http://www.debian.org/women/participate
204         RedirectPermanent /mentoring/ http://www.debian.org/women/mentoring
205         RedirectPermanent /press/ http://wiki.debian.org/DebianWomen/Press
206         RedirectPermanent /profiles/ http://www.debian.org/women/profiles/
207 </VirtualHost>
208
209 <VirtualHost <%= vhost_listen %> >
210         ServerName volatile.debian.org
211         ServerAlias volatile-master.debian.org
212         ServerAdmin debian-admin@debian.org
213         RedirectPermanent / http://www.debian.org/volatile/
214 </VirtualHost>
215
216 <VirtualHost <%= vhost_listen %> >
217         ServerName ftp-master.metadata.debian.org
218         ServerAdmin debian-admin@debian.org
219         RedirectPermanent / http://metadata.ftp-master.debian.org/
220 </VirtualHost>
221
222 # vim:ft=apache: