From aa952445fc4ad0e3c146f8243f3d8a8476d4aa47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 29 Dec 2021 22:29:59 +0100 Subject: htpasswd --- manifests/site.pp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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, }, } -- cgit v1.2.3