eb59b0c8cc463354d62907a13c459434abe4e693
[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 <% @binds.each do |bind| -%>
7   Use common-debian-service-https-redirect "<%= bind %>" "<%= @syncproxy_name %>"
8 <% end -%>
9
10 <Virtualhost <%= @binds.map { |bind| "#{bind}:443" }.join(' ') %> >
11    ServerName <%= @syncproxy_name %>
12    DocumentRoot /srv/www/syncproxy.debian.org/htdocs
13
14    Use common-debian-service-ssl <%= @syncproxy_name %>
15    Use common-ssl-HSTS
16    Use http-pkp-<%= @syncproxy_name %>
17
18    <Directory /srv/www/syncproxy.debian.org/htdocs>
19       Require all granted
20    </Directory>
21
22    CustomLog /var/log/apache2/syncproxy.debian.org-access.log privacy
23    ErrorLog /var/log/apache2/syncproxy.debian.org-error.log
24
25 <%=
26 lines = []
27 %w{debian debian-debug debian-ports debian-security}.each do |archive|
28   varname = 'has_srv_mirrors_' + archive.gsub(/[\/-]/,'_')
29   if has_variable?(varname) and (eval("@"+varname))
30     lines << "  Alias /#{archive}/project/trace/ /srv/mirrors/#{archive}/project/trace/"
31     lines << "  <Directory /srv/mirrors/#{archive}/project/trace/>"
32     lines << "    Require all granted"
33     lines << "    Options +Indexes"
34     lines << "  </Directory>"
35   end
36 end
37
38 lines.join("\n")
39 %>
40
41 </VirtualHost>
42
43 # vim: set ts=3 sw=3 et: