diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-30 01:13:26 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-30 01:13:26 +0100 |
commit | b88ef9140cb89ca05b8d6ecc3c20060b544889c8 (patch) | |
tree | aff0dedadc6d594802d07959da5cff871a9f1d17 | |
parent | Move cgit setup to module. (diff) | |
download | cgit-b88ef9140cb89ca05b8d6ecc3c20060b544889c8.tar.gz cgit-b88ef9140cb89ca05b8d6ecc3c20060b544889c8.tar.xz |
Cgit fixes.
-rw-r--r-- | manifests/init.pp | 1 | ||||
-rw-r--r-- | 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', |