Redirect ports.d.o to www.ports.d.o
[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-security/  http://cdn-fastly.deb.debian.org/debian-security/
10 </Macro>
11 <% end -%>
12
13
14 <%=
15
16 def vhost(lines, sn, type=nil, extra=nil)
17   if scope.function_has_static_component([sn])
18     t = 'common-static-vhost'
19     if type then t += "-#{type}"; end
20
21     e = ''
22     if extra then e += " #{extra}"; end
23
24     lines << "Use #{t} #{sn}#{e}"
25   end
26 end
27
28 lines = []
29 vhost(lines, "mozilla.debian.net")
30 vhost(lines, "backports.debian.org", "ssl")
31 vhost(lines, "incoming.debian.org")
32 vhost(lines, "debdeltas.debian.net")
33 vhost(lines, "news.debian.net"         , "ssl")
34 vhost(lines, "debaday.debian.net"      , "ssl")
35 vhost(lines, "timeline.debian.net"     , "ssl")
36 vhost(lines, "network-test.debian.org" , "with-extra", '"ServerAlias network-test-backend.debian.org"')
37 vhost(lines, "blends.debian.org"       , "with-extra", '"ServerAlias blends-backend.debian.org"')
38 vhost(lines, "wnpp-by-tags.debian.net" , "with-extra", '"ServerAlias wnpp-by-tags-backend.debian.org"')
39 vhost(lines, "security-team.debian.org", "with-extra", '"ServerAlias security-team-backend.debian.org"')
40 vhost(lines, "d-i.debian.org"      , "ssl")
41 vhost(lines, "appstream.debian.org", "ssl")
42 vhost(lines, "dsa.debian.org"      , "ssl")
43 vhost(lines, "rtc.debian.org"      , "ssl")
44
45 vhost(lines, "10years.debconf.org" , "ssl")
46 vhost(lines, "debconf0.debconf.org", "ssl")
47 vhost(lines, "debconf1.debconf.org", "ssl")
48 vhost(lines, "debconf2.debconf.org", "ssl")
49 vhost(lines, "debconf3.debconf.org", "ssl")
50 vhost(lines, "debconf4.debconf.org", "ssl")
51 vhost(lines, "debconf5.debconf.org", "ssl")
52 vhost(lines, "debconf6.debconf.org", "ssl")
53 vhost(lines, "debconf7.debconf.org", "ssl")
54 vhost(lines, "es.debconf.org"      , "ssl")
55 vhost(lines, "fr.debconf.org"      , "ssl")
56 vhost(lines, "miniconf10.debconf.org" , "ssl")
57
58 vhost(lines, "deb.debian.org", "with-extra", '"Use vhost-deb.debian.org-extra"')
59
60 lines.join("\n")
61 -%>
62
63 ######################
64 # metadata.ftp-master.debian.org
65 <% if scope.function_has_static_component(['metadata.ftp-master.debian.org']) -%>
66 <VirtualHost <%= vhost_listen %> >
67         ServerName metadata.ftp-master.debian.org
68         ServerAdmin debian-admin@lists.debian.org
69
70         ErrorLog /var/log/apache2/metadata.ftp-master.debian.org-error.log
71         CustomLog /var/log/apache2/metadata.ftp-master.debian.org-access.log privacy
72
73         Use common-static-base metadata.ftp-master.debian.org
74         AddDefaultCharset utf-8
75         <LocationMatch "/changelogs/(main|contrib|non-free)">
76                 ForceType text/plain
77         </LocationMatch>
78 </VirtualHost>
79 <% end -%>
80
81 ######################
82 # bits.debian.org
83 <% if scope.function_has_static_component(['bits.debian.org']) -%>
84 <Macro static-bits.debian.org-base>
85         ServerName bits.debian.org
86         ServerAdmin debian-admin@lists.debian.org
87
88         ErrorLog /var/log/apache2/bits.debian.org-error.log
89         <IfModule mod_geoip.c>
90                 CustomLog /var/log/apache2/bits.debian.org-public-access.log privacy+geo
91         </IfModule>
92
93         Use common-static-base bits.debian.org
94 </Macro>
95
96 <Virtualhost <%= vhost_listen %> >
97         RewriteEngine on
98
99         RewriteEngine On
100         RewriteCond %{REQUEST_URI} !^/feeds/
101         RewriteRule ^/(.*)$ https://bits.debian.org/$1 [R,L]
102         #RewriteRule ^/(.*)$ https://bits.debian.org/$1 [R=301,L]
103
104         Use static-bits.debian.org-base
105         CustomLog /var/log/apache2/bits.debian.org-access.log privacy
106 </VirtualHost>
107
108 <Virtualhost <%= vhost_listen_443 %> >
109         Use static-bits.debian.org-base
110         CustomLog /var/log/apache2/bits.debian.org-access.log privacyssl
111
112         Use common-debian-service-ssl bits.debian.org
113         Use common-ssl-HSTS
114 </VirtualHost>
115 <% end -%>
116
117 # www.backports.org
118 ###################
119 # www.backports.org is the historical place for the backports
120 # website and archive.  It is now a CNAME to backports.debian.org:
121 # redirect http requests.
122 <VirtualHost <%= vhost_listen %> >
123         ServerName www.backports.org
124         ServerAlias lists.backports.org
125         ServerAdmin debian-admin@debian.org
126         RedirectPermanent / http://backports.debian.org/
127 </VirtualHost>
128
129 ######################
130 # www.ports.debian.org
131 <% if scope.function_has_static_component(['www.ports.debian.org']) -%>
132 <Virtualhost <%= vhost_listen %> >
133         ServerName www.ports.debian.org
134         ServerAlias www.ports-backend.debian.org
135         ServerAdmin debian-admin@lists.debian.org
136
137         ErrorLog /var/log/apache2/www.ports.debian.org-error.log
138         CustomLog /var/log/apache2/www.ports.debian.org-access.log privacy
139
140         <IfModule mod_userdir.c>
141                 UserDir disabled
142         </IfModule>
143         ServerSignature On
144
145         DocumentRoot /srv/static.debian.org/mirrors/www.ports.debian.org/cur
146         <Directory /srv/static.debian.org/mirrors/www.ports.debian.org/cur>
147                 AllowOverride FileInfo Indexes Options=Multiviews
148                 Options Multiviews Indexes FollowSymLinks Includes
149                 IndexOptions FancyIndexing NameWidth=*
150                 <% if @lsbmajdistrelease > '7' -%>
151                         Require all granted
152                 <% else -%>
153                         Order allow,deny
154                         Allow from all
155                 <% end -%>
156         </Directory>
157
158         AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
159         AddOutputFilter INCLUDES .xhtml
160 </VirtualHost>
161 <% end -%>
162
163 <VirtualHost <%= vhost_listen %> >
164         ServerName www.debian-ports.org
165         ServerAlias debian-ports.org
166         ServerAdmin debian-admin@debian.org
167         RedirectPermanent / http://www.ports.debian.org/
168 </VirtualHost>
169
170 <VirtualHost <%= vhost_listen %> >
171         ServerName ports.debian.org
172         ServerAlias ports.debian.net
173         ServerAdmin debian-admin@debian.org
174         RedirectPermanent / http://www.ports.debian.org/
175 </VirtualHost>
176
177 # video.debian.net
178 ###################
179 <VirtualHost <%= vhost_listen %> >
180         ServerName video.debian.net
181         ServerAdmin debian-admin@debian.org
182
183         Redirect / http://meetings-archive.debian.net/pub/debian-meetings/
184 </VirtualHost>
185
186 # historical sites
187 ##################
188 # now only redirects remain
189 <VirtualHost <%= vhost_listen %> >
190         ServerName women.debian.org
191         ServerAdmin debian-admin@debian.org
192
193         RedirectPermanent / http://www.debian.org/women/
194
195         RedirectPermanent /about/ http://www.debian.org/women/about
196         RedirectPermanent /contact/ http://www.debian.org/women/contact
197         RedirectPermanent /faqs/ http://www.debian.org/women/faq
198         RedirectPermanent /home/ http://www.debian.org/women/
199         RedirectPermanent /images/dw.png http://www.debian.org/women/dw.png
200         RedirectPermanent /involvement/ http://www.debian.org/women/participate
201         RedirectPermanent /mentoring/ http://www.debian.org/women/mentoring
202         RedirectPermanent /press/ http://wiki.debian.org/DebianWomen/Press
203         RedirectPermanent /profiles/ http://www.debian.org/women/profiles/
204 </VirtualHost>
205
206 <VirtualHost <%= vhost_listen %> >
207         ServerName volatile.debian.org
208         ServerAlias volatile-master.debian.org
209         ServerAdmin debian-admin@debian.org
210         RedirectPermanent / http://www.debian.org/volatile/
211 </VirtualHost>
212
213 <VirtualHost <%= vhost_listen %> >
214         ServerName ftp-master.metadata.debian.org
215         ServerAdmin debian-admin@debian.org
216         RedirectPermanent / http://metadata.ftp-master.debian.org/
217 </VirtualHost>
218
219 # vim:ft=apache: