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