From b88ef9140cb89ca05b8d6ecc3c20060b544889c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 30 Dec 2021 01:13:26 +0100 Subject: Cgit fixes. --- manifests/init.pp | 1 + manifests/nginx.pp | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index e788703..98071d6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -16,6 +16,7 @@ class cgit ( Variant[Boolean, Enum['nginx']] $manage_server = false, Optional[String] $server_name = undef, Optional[String] $certname = undef, + String $htpasswd = '/var/lib/nginx/cgit-htpasswd', ) { notify { 'certname': diff --git a/manifests/nginx.pp b/manifests/nginx.pp index f2a1396..329c21d 100644 --- a/manifests/nginx.pp +++ b/manifests/nginx.pp @@ -9,7 +9,7 @@ class cgit::nginx { try_files => [ '$uri', '@cgit' ], ssl => false, use_default_location => true, - www_root => $cgit_root, + www_root => $cgit::root, } } else { nginx::resource::server { 'cgit': @@ -22,7 +22,7 @@ class cgit::nginx { ssl_cert => "/etc/letsencrypt/live/${cgit::certname}/fullchain.pem", ssl_key => "/etc/letsencrypt/live/${cgit::certname}/privkey.pem", use_default_location => true, - www_root => $cgit_root, + www_root => $cgit::root, ssl_redirect => true, } } @@ -41,8 +41,7 @@ class cgit::nginx { ], } - $cgit_htpasswd = '/var/lib/nginx/cgit-htpasswd' - file { $cgit_htpasswd: + file { $cgit::htpasswd: ensure => file, content => $cgit::users.map |$user| { [$user['name'], $user['pass']].join(':') @@ -70,7 +69,7 @@ class cgit::nginx { ssl_only => $cgit::certname != undef, location_cfg_append => { auth_basic => '"CGit login"', - auth_basic_user_file => $cgit_htpasswd, + auth_basic_user_file => $cgit::htpasswd, }, fastcgi => 'unix:/run/fcgiwrap.socket', fastcgi_params => 'fastcgi_params', -- cgit v1.2.3