summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-12-29 22:29:59 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-12-29 22:29:59 +0100
commitaa952445fc4ad0e3c146f8243f3d8a8476d4aa47 (patch)
treec6471bec90d1b54cbd5fc444eb91305b23643b7d
parentcgit ssl only. (diff)
downloadwebdav_server-aa952445fc4ad0e3c146f8243f3d8a8476d4aa47.tar.gz
webdav_server-aa952445fc4ad0e3c146f8243f3d8a8476d4aa47.tar.xz
htpasswd
-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,
},
}