diff options
Diffstat (limited to '')
-rw-r--r-- | modules/cgit/manifests/init.pp | 12 | ||||
-rw-r--r-- | modules/cgit/templates/hugo-authentication.lua.epp (renamed from modules/cgit/files/filters/hugo-authentication.lua) | 14 |
2 files changed, 17 insertions, 9 deletions
diff --git a/modules/cgit/manifests/init.pp b/modules/cgit/manifests/init.pp index c1a981b..71ed6db 100644 --- a/modules/cgit/manifests/init.pp +++ b/modules/cgit/manifests/init.pp @@ -8,6 +8,10 @@ class cgit ( String $source_filter, String $scan_path, Array[String] $clone_url, + Array[String] $public_repos = [], + Array[Struct[{ + name => String, + pass => String }]] $users = [], ) { # TODO figure out where CSS comes from @@ -48,7 +52,7 @@ class cgit ( ensure => directory, } - [$about_filter, $source_filter, $auth_filter].each |$f| { + [$about_filter, $source_filter].each |$f| { file { "${filterpath}/${f}": ensure => file, source => "puppet:///modules/cgit/filters/${f}", @@ -59,4 +63,10 @@ class cgit ( } } + file { "${filterpath}/${auth_filter}": + ensure => file, + content => epp("cgit/${auth_filter}.epp"), + mode => '0444', + } + } diff --git a/modules/cgit/files/filters/hugo-authentication.lua b/modules/cgit/templates/hugo-authentication.lua.epp index df97579..0c73644 100644 --- a/modules/cgit/files/filters/hugo-authentication.lua +++ b/modules/cgit/templates/hugo-authentication.lua.epp @@ -24,17 +24,15 @@ local protected_repos = { } local public_repos = {} -public_repos["wiki-public" ] = true -public_repos["lyslib" ] = true -public_repos["calp" ] = true -public_repos["texttv" ] = true -public_repos["scheme-monad" ] = true -public_repos["scheme/math-parse" ] = true -public_repos["file-descriptor-graph"] = true +<%- $cgit::public_repos.each |$repo| { -%> +public_repos["<%= $repo %>"] = true +<%- } -%> -- A list of users and hashes, generated with `mkpasswd -m sha-512 -R 300000`. local users = { - hugo = "$6$13z1Pf.U8itrCRX6$g2BZpaMk1CLiT6117paWXB2qdQFRc3rsGWL4iF5h5QbHo27oljTdHk69oQWAvqlVf13aLTUF3nYw65lEp88r/1" + <%- $cgit::users.each |$user| { -%> + <%= $user['name'] %> = "<%= $user['pass'] %>" + <%- } -%> } -- Set this to a path this script can write to for storing a persistent |