summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/site.pp10
1 files changed, 9 insertions, 1 deletions
diff --git a/manifests/site.pp b/manifests/site.pp
index e05b1da..9e272b7 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -347,13 +347,21 @@ node 'hornquist.se' {
],
}
+ $cgit_htpasswd = '/var/lib/nginx/cgit-htpasswd'
+ file { $cgit_htpasswd:
+ ensure => file,
+ content => $cgit::users.map |$user| {
+ [$user['name'], $user['pass']].join(':')
+ }.join("\n")
+ }
+
nginx::resource::location { '~ \.git$':
server => 'cgit',
www_root => $cgit::scan_path,
ssl_only => true,
location_cfg_append => {
auth_basic => '"CGit login"',
- auth_basic_user_file => '/.htpasswd',
+ auth_basic_user_file => $cgit_htpasswd,
},
}