aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem/templates/vhost_repository.conf
blob: 167c026e2ad50b0045fdf7c3f7927ab5ed88b092 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<%-
mirror_root = scope.lookupvar('buildsystem::var::repository::mirror_root')
mirror_reporoot = scope.lookupvar('buildsystem::var::repository::mirror_reporoot')
bootstrap_reporoot = scope.lookupvar('buildsystem::var::repository::bootstrap_reporoot')
distros = scope.lookupvar('buildsystem::var::distros::distros')
-%>
<VirtualHost *:80>
        ServerName <%= scope.lookupvar('buildsystem::var::repository::hostname') %>
        DocumentRoot <%= mirror_root %>
<%-
    distros.each{|distroname,distro| 
	allow_from = distro['repo_allow_from'] != nil ? distro['repo_allow_from'] : [ 'all' ]
%>
	Alias /bootstrap/<%= distroname %>/ "<%= bootstrap_reporoot %>/<%= distroname %>/"

	<Directory  <%= bootstrap_reporoot %>/<%= distroname %>>
          Header append Cache-Control "public, must-revalidate"
          Order deny,allow
<%-
        for allow in allow_from do
-%>
          Allow from <%= allow %>
<%-
        end
-%>
          Options Indexes FollowSymLinks
        </Directory>

	<Directory  <%= mirror_reporoot %>/<%= distroname %>>
          Header append Cache-Control "public, must-revalidate"
          Order deny,allow
          Deny from all
<%-
	for allow in allow_from do
-%>
          Allow from <%= allow %>
<%-
        end
-%>
          Options Indexes FollowSymLinks
        </Directory>
<%-
    }
-%>
</VirtualHost>