Make an apache site for syncproxies
[mirror/dsa-puppet.git] / modules / roles / templates / syncproxy / syncproxy.debian.org-apache.erb
1 ##
2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
4 ##
5
6 <%
7   vhost_listen = [ (bind != '') ? "#{bind}:80" : "*:80",  (bind6 != '') ? "#{bind6}:80" : "*:80"].uniq.join(' ')
8 %>
9
10 <Virtualhost <%= vhost_listen %> >
11    ServerName <%= syncproxy_name %>
12    DocumentRoot /srv/www/syncproxy.debian.org/htdocs
13
14    <Directory /srv/www/syncproxy.debian.org/htdocs>
15       Require all granted
16    </Directory>
17
18    CustomLog /var/log/apache2/syncproxy.debian.org-access.log privacy
19    ErrorLog /var/log/apache2/syncproxy.debian.org-error.log
20
21 <%=
22 lines = []
23 %w{debian debian-backports debian-debug debian-security}.each do |archive|
24   varname = 'has_srv_mirrors_' + archive.gsub(/[\/-]/,'_')
25   if has_variable?(varname) and (eval(varname)) == 'true'
26     lines << "  Alias /#{archive}/project/trace/ /srv/mirrors/#{archive}/project/trace/"
27     lines << "  <Directory /srv/mirrors/#{archive}/project/trace/>"
28     lines << "    Require all granted"
29     lines << "    IndexOptions NameWidth=* +SuppressDescription"
30     lines << "    Options +Indexes"
31     lines << "  </Directory>"
32   end
33 end
34
35 lines.join("\n")
36 %>
37
38 </VirtualHost>
39
40 # vim: set ts=3 sw=3 et: