diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/buildsystem/manifests/var/distros.pp | 6 | ||||
-rw-r--r-- | modules/buildsystem/templates/vhost_repository.conf | 55 |
2 files changed, 35 insertions, 26 deletions
diff --git a/modules/buildsystem/manifests/var/distros.pp b/modules/buildsystem/manifests/var/distros.pp index 87f78e19..ddd8ffc1 100644 --- a/modules/buildsystem/manifests/var/distros.pp +++ b/modules/buildsystem/manifests/var/distros.pp @@ -39,7 +39,11 @@ # 'distsuffix' => '.mga', # 'distribution' => 'Mageia', # 'vendor' => 'Mageia.Org', -# } +# }, +# # list of IP or hostnames allowed to access this distro on the +# # repository. If you don't want to filter allowed IPs, don't set +# # this value +# 'repo_allow_from' => [ '127.0.0.1', '10.0.0.1', '.mageia.org' ], # }, # } class buildsystem::var::distros( diff --git a/modules/buildsystem/templates/vhost_repository.conf b/modules/buildsystem/templates/vhost_repository.conf index cc0e437a..167c026e 100644 --- a/modules/buildsystem/templates/vhost_repository.conf +++ b/modules/buildsystem/templates/vhost_repository.conf @@ -1,40 +1,45 @@ -<% -# FIXME: add a reverse lookup for IPv6 adresses -# allowed hosts are: valstar, ecosse, jonund -# Which ip is 2a02:2178:2:7::5/64 ? -buildsystem_nodes = "2a02:2178:2:7::3/64 2a02:2178:2:7::4/64 2a02:2178:2:7::5/64 fe80::230:48ff:fecf:101c/64" +<%- 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 %> - Alias /distrib/infra_1/ "/distrib/bootstrap/distrib/infra_1/" - Alias /distrib/infra_2/ "/distrib/bootstrap/distrib/infra_2/" - - <Directory <%= mirror_root %>> - Order deny,allow - Deny from all - Allow from localhost, 127.0.0.1 - Allow from <%= buildsystem_nodes %> - Allow from .<%= @domain %> - Allow from 10.42.0 - # FIXME: add a reverse lookup for rabbit - Allow from 212.85.158.152 212.85.158.149 - Options Indexes FollowSymLinks - </Directory> +<%- + distros.each{|distroname,distro| + allow_from = distro['repo_allow_from'] != nil ? distro['repo_allow_from'] : [ 'all' ] +%> + Alias /bootstrap/<%= distroname %>/ "<%= bootstrap_reporoot %>/<%= distroname %>/" - <Directory /distrib/bootstrap/distrib/infra_1> + <Directory <%= bootstrap_reporoot %>/<%= distroname %>> Header append Cache-Control "public, must-revalidate" Order deny,allow - Allow from all +<%- + for allow in allow_from do +-%> + Allow from <%= allow %> +<%- + end +-%> Options Indexes FollowSymLinks </Directory> - <Directory /distrib/bootstrap/distrib/infra_2> + <Directory <%= mirror_reporoot %>/<%= distroname %>> Header append Cache-Control "public, must-revalidate" Order deny,allow - Allow from all + Deny from all +<%- + for allow in allow_from do +-%> + Allow from <%= allow %> +<%- + end +-%> Options Indexes FollowSymLinks </Directory> +<%- + } +-%> </VirtualHost> |