aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem/templates/vhost_repository.conf
blob: ffc0d868c91638d176b6a2c41d807789869f4df8 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<%-
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')
distribdir = scope.lookupvar('buildsystem::var::repository::distribdir')
distros = scope.lookupvar('buildsystem::var::distros::distros')
-%>
<VirtualHost *:80>
        ServerName <%= scope.lookupvar('buildsystem::var::repository::hostname') %>
        DocumentRoot <%= mirror_root %>

        # Some simple API to check existence of SRPMs for QA
        RewriteEngine On

        RewriteCond /distrib/bootstrap/distrib/$2/SRPMS/$3/$1s_testing/$4.src.rpm -f
        RewriteRule ^/qa/checksrpm/(update|backport)/([1-9][0-9]*)/([a-z_]+)/([^/]+)$ http://repository.mageia.org/qa/checksrpm/found [L,R=302]

        RewriteRule ^/qa/checksrpm/ - [L,G]

<%-
    distros.keys.sort.each{|distroname| 
	distro = distros[distroname]
	allow_from = distro['repo_allow_from'] != nil ? distro['repo_allow_from'] : [ 'all' ]
%>
	Alias /bootstrap/<%= distroname %>/ "<%= bootstrap_reporoot %>/<%= distroname %>/"

<%- if distro['no_mirror'] -%>
	Alias /<%= distribdir %>/<%= distroname %>/ "<%= bootstrap_reporoot %>/<%= distroname %>/"
<%- end -%>

	<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>