]> gitweb.fluxo.info Git - puppet-git.git/commitdiff
Feat: parametrize caching
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 7 Sep 2025 13:38:10 +0000 (10:38 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 7 Sep 2025 13:38:10 +0000 (10:38 -0300)
manifests/cgit.pp
templates/cgitrc.erb

index 069e3565bdb9ac4951775aa424b6b23110f64a71..26cb7d93b7783704b2ad0c86d2d41c0a29fc3baa 100644 (file)
@@ -1,9 +1,16 @@
 class git::cgit(
-  $css        = '/cgit-css/cgit.css',
-  $logo       = '/cgit.png',
-  $root_title = 'Git Repository Browser',
-  $root_desc  = 'a fast webinterface for the git dscm',
-  $clone_url  = 'https://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL git://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL git@$HTTP_HOST:$CGIT_REPO_URL'
+  $css               = '/cgit-css/cgit.css',
+  $logo              = '/cgit.png',
+  $root_title        = 'Git Repository Browser',
+  $root_desc         = 'a fast webinterface for the git dscm',
+  $clone_url         = 'https://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL git://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL git@$HTTP_HOST:$CGIT_REPO_URL'
+  $cache             = '1',
+  $cache_size        = '10000',
+  $cache_about_ttl   = '15',
+  $cache_dynamic_ttl = '15',
+  $cache_static_ttl  = '4460',
+  $cache_root_ttl    = '15',
+  $cache_repo_ttl    = '120',
 ) {
   package { 'cgit':
     ensure  => $::lsbdistcodename ? {
index fb97e329887bc86e556c6e569a7a615409e7d189..8917fb978e1e58b6efa8313943b9dee9c8d5cd8f 100644 (file)
@@ -1,4 +1,3 @@
-#
 # cgit config
 # see cgitrc(5) for details
 
@@ -13,9 +12,16 @@ root-desc=<%= @root_desc %>
 clone-url=<%= @clone_url %>
 snapshots=tar.gz tar.bz2
 
+# caching
+cache=<% @cache %>
+cache-size=<% @cache_size %>
+cache-about-ttl=<% @cache_about_ttl %>
+cache-dynamic-ttl=<% @cache_dynamic_ttl %>
+cache-static-ttl=<% @cache_static_ttl %>
+cache-root-ttl=<% @cache_root_ttl %>
+cache-repo-ttl=<% @cache_repo_ttl %>
+
 # switches
-nocache=1
-cache-size=0
 enable-http-clone=1
 enable-index-links=1
 enable-http-clone=1