From 255c868d79be6b2725570a70c51ce9e54e9313bd Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Thu, 23 May 2013 15:05:56 +0000 Subject: buildsystem: don't hardcode distros in vhost_repository.conf Use buildsystem::var::distros settings in vhost_repository.conf template. The URLs for the infra_1 and infra_2 repositories have been changed, and will need to be updated in urpmi configuration on servers using those repositories. The old URLs were : - http://repository.mageia.org/distrib/infra_1/ - http://repository.mageia.org/distrib/infra_2/ The new URLs are now : - http://repository.mageia.org/bootstrap/infra_1/ - http://repository.mageia.org/bootstrap/infra_2/ --- .../buildsystem/templates/vhost_repository.conf | 55 ++++++++++++---------- 1 file changed, 30 insertions(+), 25 deletions(-) (limited to 'modules/buildsystem/templates') 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') +-%> 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/" - - > - 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 - +<%- + distros.each{|distroname,distro| + allow_from = distro['repo_allow_from'] != nil ? distro['repo_allow_from'] : [ 'all' ] +%> + Alias /bootstrap/<%= distroname %>/ "<%= bootstrap_reporoot %>/<%= distroname %>/" - + /<%= 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 - + /<%= 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 +<%- + } +-%> -- cgit v1.2.1