aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2020-06-28 20:48:06 +0000
committerPascal Terjan <pterjan@mageia.org>2020-06-28 20:48:06 +0000
commitec92e347631abc76485aae135691d93e707dcc4b (patch)
treee0c6a2aa3653d1e30431363299485f5d30304604 /modules
parentb25a543dfd218cc5725d82fec4dbd9af1f50564b (diff)
downloadpuppet-ec92e347631abc76485aae135691d93e707dcc4b.tar
puppet-ec92e347631abc76485aae135691d93e707dcc4b.tar.gz
puppet-ec92e347631abc76485aae135691d93e707dcc4b.tar.bz2
puppet-ec92e347631abc76485aae135691d93e707dcc4b.tar.xz
puppet-ec92e347631abc76485aae135691d93e707dcc4b.zip
Simplify repository vhost
We use the same access list for all versions of the distribution on the HTPP server (our internal machines) so there is no reason to duplicate it per distro. This also allows to access files at the top level directory (like mageia_timestamp).
Diffstat (limited to 'modules')
-rw-r--r--modules/buildsystem/templates/vhost_repository.conf18
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/buildsystem/templates/vhost_repository.conf b/modules/buildsystem/templates/vhost_repository.conf
index b5f2fa04..0e50d78b 100644
--- a/modules/buildsystem/templates/vhost_repository.conf
+++ b/modules/buildsystem/templates/vhost_repository.conf
@@ -3,6 +3,8 @@ 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')
+repo_allow_from_ips = scope.lookupvar('buildsystem::var::distros::repo_allow_from_ips')
+repo_allow_from_domains = scope.lookupvar('buildsystem::var::distros::repo_allow_from_ips')
distros = scope.lookupvar('buildsystem::var::distros::distros')
-%>
<VirtualHost *:80>
@@ -18,9 +20,7 @@ distros = scope.lookupvar('buildsystem::var::distros::distros')
RewriteRule ^/qa/checksrpm/ - [L,G]
<%-
- distros.keys.sort.each{|distroname|
- distro = distros[distroname]
- if distro['repo_allow_from_ips'] != nil || distro['repo_allow_from_domains'] != nil then
+ if repo_allow_from_ips != nil || repo_allow_from_domains != nil then
access_requires = [ 'all denied' ]
if distro['repo_allow_from_ips'] != nil then
for allow in distro['repo_allow_from_ips'] do
@@ -36,13 +36,15 @@ distros = scope.lookupvar('buildsystem::var::distros::distros')
access_requires = [ 'all granted' ]
end
%>
- Alias /bootstrap/<%= distroname %>/ "<%= bootstrap_reporoot %>/<%= distroname %>/"
-
-<%- if distro['no_mirror'] -%>
+ Alias /bootstrap/ "<%= bootstrap_reporoot %>/"
+<%-
+ distros.keys.sort.each{|distroname|
+ distro = distros[distroname]
+ if distro['no_mirror'] -%>
Alias /<%= distribdir %>/<%= distroname %>/ "<%= bootstrap_reporoot %>/<%= distroname %>/"
<%- end -%>
- <Directory <%= bootstrap_reporoot %>/<%= distroname %>>
+ <Directory <%= bootstrap_reporoot %>>
Header append Cache-Control "public, must-revalidate"
<%-
for req in access_requires do
@@ -54,7 +56,7 @@ distros = scope.lookupvar('buildsystem::var::distros::distros')
Options Indexes FollowSymLinks
</Directory>
- <Directory <%= mirror_reporoot %>/<%= distroname %>>
+ <Directory <%= mirror_reporoot %>>
Header append Cache-Control "public, must-revalidate"
<%-
for req in access_requires do