aboutsummaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-01-03 15:04:53 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-01-03 15:04:53 +0100
commitc994b9baaabea481d06bf80fbb19dc43dd1ec9cc (patch)
tree0e01b2414b00a7e7ec6d3a94644155bc174575ee /roles
parentfc5551b90f4317ccdf2d8c6b6a331647d676e138 (diff)
downloadansible-memzero-c994b9baaabea481d06bf80fbb19dc43dd1ec9cc.tar.gz
ansible-memzero-c994b9baaabea481d06bf80fbb19dc43dd1ec9cc.zip
git: enable cgit cache, about page, clone-url
Diffstat (limited to 'roles')
-rwxr-xr-xroles/git/files/gitolite-cgit/entrypoint.sh7
-rw-r--r--roles/git/files/gitolite-cgit/etc/cgitrc16
2 files changed, 23 insertions, 0 deletions
diff --git a/roles/git/files/gitolite-cgit/entrypoint.sh b/roles/git/files/gitolite-cgit/entrypoint.sh
index 905bf97..873a0ac 100755
--- a/roles/git/files/gitolite-cgit/entrypoint.sh
+++ b/roles/git/files/gitolite-cgit/entrypoint.sh
@@ -22,9 +22,16 @@ if [ ! -f /var/lib/git/.ssh/authorized_keys ]; then
su - git -c 'gitolite setup --pubkey /tmp/admin.pub'
rm -f /tmp/admin.pub
else
+ # Fixup gitolite, eg in case a new repo was added manually.
su - git -c 'gitolite setup'
fi
+# -- SETUP: cgit ---------------------------------------------------------------
+
+# Ensure default cache directory exists.
+# Adapt if cache-root is changed in cgitrc(5).
+mkdir -p /var/cache/cgit
+
# -- SETUP: sshd ---------------------------------------------------------------
# Generate ssh host keys (nop if keys already exist).
diff --git a/roles/git/files/gitolite-cgit/etc/cgitrc b/roles/git/files/gitolite-cgit/etc/cgitrc
index e60b893..b84b441 100644
--- a/roles/git/files/gitolite-cgit/etc/cgitrc
+++ b/roles/git/files/gitolite-cgit/etc/cgitrc
@@ -1,8 +1,13 @@
# cgitrc(5)
+# Enable caching of html files to /var/cache/cgit (unit is objects).
+cache-size=1000
+
root-title=git.memzero.de
root-desc=private git repostitory
+clone-url=https://git.memzero.de/$CGIT_REPO_URL ssh://git.memzero.de/$CGIT_REPO_URL git@git.memzero.de:$CGIT_REPO_URL
+
virtual-root=/
enable-blame=1
@@ -23,6 +28,17 @@ about-filter=/usr/lib/cgit/filters/about-formatting.sh
remove-suffix=1
section-from-path=1
+# -- About page
+
+# Global default files to look for to render the repos about page (first match taken).
+#
+# Leading colon means to search for <readme> file relative from remote HEAD
+# (aka default branch).
+# Cgit allows to specify a different refspec (<ref>:<readme>) to render the
+# about page, however this is mainly useful for repo specific settings.
+readme=:README.md
+readme=:README.txt
+
# -- Repositories
#
# Scan *scan-path* for repositories. Since *project-list* is specified before,