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