diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-29 22:09:24 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-29 22:14:04 +0100 |
commit | c81ce634d0351a658b5490f64d3982fd43ceb2d3 (patch) | |
tree | 4e25fb4c8eca9f293d6abbf7e41ce5df6a7f117b | |
parent | Cgit trailing commas. (diff) | |
download | webdav_server-c81ce634d0351a658b5490f64d3982fd43ceb2d3.tar.gz webdav_server-c81ce634d0351a658b5490f64d3982fd43ceb2d3.tar.xz |
cgit
-rw-r--r-- | manifests/site.pp | 14 | ||||
-rw-r--r-- | modules/cgit/manifests/init.pp | 1 | ||||
-rw-r--r-- | modules/cgit/templates/cgitrc.epp | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/manifests/site.pp b/manifests/site.pp index 4abad27..4f3d0ae 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -164,6 +164,7 @@ node 'hornquist.se' { auth_filter => 'hugo-authentication.lua', source_filter => 'hugo-highlighting.sh', scan_path => '/home/git/git', + enable_http_clone => false, clone_url => [ 'https://git.hornquist.se/$CGIT_REPO_URL', 'https://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL', @@ -320,13 +321,13 @@ node 'hornquist.se' { access_log => 'absent', error_log => 'absent', index_files => [], - try_files => [ '$uri', '@cgit' ], + try_files => [ '$uri', '@cgit' ], ssl => true, ssl_cert => "/etc/letsencrypt/live/${certname}/fullchain.pem", ssl_key => "/etc/letsencrypt/live/${certname}/privkey.pem", use_default_location => true, www_root => $cgit_root, - ssl_redirect => true, + ssl_redirect => true, # /usr/lib/cgit/cgit.cgi # /usr/share/cgit/cgit.css } @@ -345,7 +346,14 @@ node 'hornquist.se' { ], } - # TODO extra locations for dumb git clones? + nginx::resource::location { '~ \.git$': + server => 'cgit', + www_root => $cgit::scan_path, + location_cfg_append => { + auth_basic => '"CGit login"', + auth_basic_user_file => '/.htpasswd', + } + } nginx::resource::location { '/': try_files => ['$uri', '$uri/', '=404'], diff --git a/modules/cgit/manifests/init.pp b/modules/cgit/manifests/init.pp index 71ed6db..f7897bf 100644 --- a/modules/cgit/manifests/init.pp +++ b/modules/cgit/manifests/init.pp @@ -8,6 +8,7 @@ class cgit ( String $source_filter, String $scan_path, Array[String] $clone_url, + Boolean $enable_http_clone = false, Array[String] $public_repos = [], Array[Struct[{ name => String, diff --git a/modules/cgit/templates/cgitrc.epp b/modules/cgit/templates/cgitrc.epp index 9434213..0f4636d 100644 --- a/modules/cgit/templates/cgitrc.epp +++ b/modules/cgit/templates/cgitrc.epp @@ -42,7 +42,7 @@ case-sensative-sort=0 max-repo-count=100 -enable-http-clone=1 +enable-http-clone=<%= if $cgit::enable_http_clone { 1 } else { 0 } %> clone-url=<%= $cgit::clone_url.join(' ') %> readme=:README |