clean up how we do static pages, and merge release and www.ports into that
[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 vstatic-vhost-extra-deb.debian.org>
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 vstatic-vhost-extra-network-test.debian.org>
15         ServerAlias network-test-backend.debian.org
16 </Macro>
17
18 <Macro vstatic-vhost-extra-bits.debian.org>
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 vstatic-vhost-extra-metadata.ftp-master.debian.org>
25         AddDefaultCharset utf-8
26         <LocationMatch "/changelogs/(main|contrib|non-free)">
27                 ForceType text/plain
28         </LocationMatch>
29 </Macro>
30
31 <Macro vstatic-vhost-extra-release.debian.org>
32         RewriteEngine   on
33         RewriteRule             ^/migration/$                   /migration/testing.pl
34         RewriteRule             ^/migration/search/(.+)/$       /migration/testing.pl?package=$1
35         RewriteCond             %{QUERY_STRING} package=((.)(.*))
36         RewriteRule             ^/migration/testing.pl          /migration/cache/%2/%1.html [PT,L]
37         RewriteRule             ^/migration/testing.pl          /migration/cache/_index.html
38
39         Alias /proposed-updates/ /srv/static.debian.org/mirrors/release.debian.org-pu/cur/
40         <Directory /srv/static.debian.org/mirrors/release.debian.org-pu/cur>
41                 Require all granted
42                 Options Indexes SymLinksIfOwnerMatch MultiViews
43                 IndexOptions FancyIndexing NameWidth=*
44
45                 AddEncoding gzip .gz
46                 FilterDeclare gzip CONTENT_SET
47                 FilterProvider gzip inflate "%{req:Accept-Encoding} !~ /gzip/"
48                 FilterChain gzip
49                 <Files *.debdiff.gz>
50                         ForceType text/plain
51                         AddDefaultCharset utf-8
52                 </Files>
53         </Directory>
54 </Macro>
55
56 <Macro vstatic-vhost-extra-www.ports.debian.org>
57         <Directory /srv/static.debian.org/mirrors/www.ports.debian.org/cur>
58                 AllowOverride FileInfo Indexes Options=Multiviews
59                 Options Multiviews Indexes FollowSymLinks Includes
60                 IndexOptions FancyIndexing NameWidth=*
61                 Require all granted
62         </Directory>
63
64         AddOutputFilter INCLUDES .xhtml
65 </Macro>
66 <%=
67
68 def vhost(lines, sn, kwargs={})
69         if scope.function_has_static_component([sn])
70                 if not kwargs[:extra]
71                                 lines << "<Macro vstatic-vhost-extra-#{sn}>"
72                                 lines << "  # mod macro does not like empty macros, so here's some content:"
73                                 lines << "  <Directory /non-existant>"
74                                 lines << "  </Directory>"
75                                 lines << "</Macro>"
76                 end
77
78                 lines << "Use prepare-static-vhost #{sn}"
79
80                 if kwargs[:ssl]
81                         lines << "Use common-dsa-vhost-https-redirect #{sn}"
82                         lines << "Use static-vhost-ssl-#{sn}"
83                 else
84                         lines << "Use static-vhost-plain-#{sn}"
85                 end
86
87                 onion = scope.function_onion_global_service_hostname([sn])
88                 lines << "Use static-vhost-onion-#{sn} #{onion}" if onion
89
90                 lines << ""
91         end
92 end
93
94 lines = []
95 vhost(lines, "mozilla.debian.net")
96 vhost(lines, "backports.debian.org", :ssl => true)
97 vhost(lines, "incoming.debian.org")
98 vhost(lines, "incoming.ports.debian.org")
99 vhost(lines, "debdeltas.debian.net")
100 vhost(lines, "news.debian.net"         , :ssl => true)
101 vhost(lines, "debaday.debian.net"      , :ssl => true)
102 vhost(lines, "timeline.debian.net"     , :ssl => true)
103 vhost(lines, "network-test.debian.org" , :extra => true)
104 vhost(lines, "blends.debian.org"       , :ssl => true)
105 vhost(lines, "wnpp-by-tags.debian.net" , :ssl => true)
106 vhost(lines, "security-team.debian.org", :ssl => true)
107 vhost(lines, "d-i.debian.org"      , :ssl => true)
108 vhost(lines, "appstream.debian.org", :ssl => true)
109 vhost(lines, "dsa.debian.org"      , :ssl => true)
110 vhost(lines, "rtc.debian.org"      , :ssl => true)
111 vhost(lines, "onion.debian.org"    , :ssl => true)
112
113 vhost(lines, "bits.debian.org"     , :ssl => true, :extra => true)
114 vhost(lines, "micronews.debian.net", :ssl => true)
115 vhost(lines, "metadata.ftp-master.debian.org", :extra => true)
116
117 vhost(lines, "10years.debconf.org" , :ssl => true)
118 vhost(lines, "debconf0.debconf.org", :ssl => true)
119 vhost(lines, "debconf1.debconf.org", :ssl => true)
120 vhost(lines, "debconf2.debconf.org", :ssl => true)
121 vhost(lines, "debconf3.debconf.org", :ssl => true)
122 vhost(lines, "debconf4.debconf.org", :ssl => true)
123 vhost(lines, "debconf5.debconf.org", :ssl => true)
124 vhost(lines, "debconf6.debconf.org", :ssl => true)
125 vhost(lines, "debconf7.debconf.org", :ssl => true)
126 vhost(lines, "es.debconf.org"      , :ssl => true)
127 vhost(lines, "fr.debconf.org"      , :ssl => true)
128 vhost(lines, "miniconf10.debconf.org" , :ssl => true)
129
130 vhost(lines, "deb.debian.org", :extra => true)
131 vhost(lines, "release.debian.org", :ssl => true, :extra => true)
132 vhost(lines, "www.ports.debian.org", :ssl => true, :extra => true)
133
134 lines.join("\n")
135 -%>
136
137 # www.backports.org
138 ###################
139 # www.backports.org is the historical place for the backports
140 # website and archive.  It is now a CNAME to backports.debian.org:
141 # redirect http requests.
142 <VirtualHost <%= vhost_listen %> >
143         ServerName www.backports.org
144         ServerAlias lists.backports.org
145         ServerAdmin debian-admin@debian.org
146         RedirectPermanent / http://backports.debian.org/
147 </VirtualHost>
148
149 ######################
150 <VirtualHost <%= vhost_listen %> >
151         ServerName www.debian-ports.org
152         ServerAlias debian-ports.org
153         ServerAdmin debian-admin@debian.org
154         RedirectPermanent / https://www.ports.debian.org/
155 </VirtualHost>
156
157 <VirtualHost <%= vhost_listen %> >
158         ServerName ports.debian.org
159         ServerAlias ports.debian.net
160         ServerAdmin debian-admin@debian.org
161         RedirectPermanent / https://www.ports.debian.org/
162 </VirtualHost>
163
164 <VirtualHost <%= vhost_listen %> >
165         ServerName incoming.debian-ports.org
166         ServerAdmin debian-admin@debian.org
167         RedirectPermanent / http://incoming.ports.debian.org/
168 </VirtualHost>
169
170 <VirtualHost <%= vhost_listen %> >
171         ServerName ftp.debian-ports.org
172         ServerAdmin debian-admin@debian.org
173         RedirectPermanent /archive http://www.ports.debian.org
174         RedirectPermanent /debian http://ftp.ports.debian.org/debian-ports
175         RedirectPermanent /debian-cd http://ftp.ports.debian.org/debian-ports-cd
176         RedirectPermanent / http://ftp.ports.debian.org/
177 </VirtualHost>
178
179 <VirtualHost <%= vhost_listen %> >
180         ServerName video.debian.net
181         ServerAdmin debian-admin@debian.org
182         Redirect / http://meetings-archive.debian.net/pub/debian-meetings/
183 </VirtualHost>
184
185 # historical sites
186 ##################
187 # now only redirects remain
188 <VirtualHost <%= vhost_listen %> >
189         ServerName women.debian.org
190         ServerAdmin debian-admin@debian.org
191
192         RedirectPermanent / http://www.debian.org/women/
193
194         RedirectPermanent /about/ http://www.debian.org/women/about
195         RedirectPermanent /contact/ http://www.debian.org/women/contact
196         RedirectPermanent /faqs/ http://www.debian.org/women/faq
197         RedirectPermanent /home/ http://www.debian.org/women/
198         RedirectPermanent /images/dw.png http://www.debian.org/women/dw.png
199         RedirectPermanent /involvement/ http://www.debian.org/women/participate
200         RedirectPermanent /mentoring/ http://www.debian.org/women/mentoring
201         RedirectPermanent /press/ http://wiki.debian.org/DebianWomen/Press
202         RedirectPermanent /profiles/ http://www.debian.org/women/profiles/
203 </VirtualHost>
204
205 <VirtualHost <%= vhost_listen %> >
206         ServerName volatile.debian.org
207         ServerAlias volatile-master.debian.org
208         ServerAdmin debian-admin@debian.org
209         RedirectPermanent / http://www.debian.org/volatile/
210 </VirtualHost>
211
212 <VirtualHost <%= vhost_listen %> >
213         ServerName ftp-master.metadata.debian.org
214         ServerAdmin debian-admin@debian.org
215         RedirectPermanent / http://metadata.ftp-master.debian.org/
216 </VirtualHost>
217
218 # vim:ft=apache: