aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Dessaux2022-07-24 21:47:16 +0200
committerJulien Dessaux2022-07-24 21:47:16 +0200
commit267940e52db87569f0289307d4b8722a116aa308 (patch)
tree4f5866f0393051f1766e18ba89f4ee765e11def7
parentUpdated git documentations and wrote a blog post about it (diff)
downloadwww-267940e52db87569f0289307d4b8722a116aa308.tar.gz
www-267940e52db87569f0289307d4b8722a116aa308.tar.bz2
www-267940e52db87569f0289307d4b8722a116aa308.zip
Fixed git articles
Diffstat (limited to '')
-rw-r--r--content/blog/miscellaneous/gitolite-cgit.md5
-rw-r--r--content/docs/adyxax.org/git/gitolite.md12
2 files changed, 14 insertions, 3 deletions
diff --git a/content/blog/miscellaneous/gitolite-cgit.md b/content/blog/miscellaneous/gitolite-cgit.md
index bd76991..b480082 100644
--- a/content/blog/miscellaneous/gitolite-cgit.md
+++ b/content/blog/miscellaneous/gitolite-cgit.md
@@ -2,6 +2,9 @@
title: Migrating from gitea to gitolite and cgit
description: A quest for simplicity
date: 2022-07-15
+tags:
+ - FreeBSD
+ - git
---
## Introduction
@@ -27,4 +30,4 @@ The main challenge I encountered was how to make `go get` or `go install` work w
I solved that issue of injecting this header by:
- setting a `cgit.extra-head-content` in the gitconfig of my go repositories
-- configuring gitolite to accept such header by customizing its `GIT_CONFIG_KEYS`
+- configuring gitolite to accept such header by customizing its `GIT_CONFIG_KEYS` and working around regex character checks
diff --git a/content/docs/adyxax.org/git/gitolite.md b/content/docs/adyxax.org/git/gitolite.md
index a9aba2e..89fe6ef 100644
--- a/content/docs/adyxax.org/git/gitolite.md
+++ b/content/docs/adyxax.org/git/gitolite.md
@@ -56,12 +56,20 @@ In order to customize the cgit frontend, I needed to allow some git configuratio
GIT_CONFIG_KEYS => 'cgit.desc cgit.extra-head-content cgit.homepage cgit.hide cgit.ignore cgit.owner cgit.section',
```
-These keys allow me to specify repositories like this:
+Sadly, the html meta tag we need to add contains `<` and `>` characters, which can have a special meaning in regular expressions. Because of that these characters are banned from values by gitolite, but we have a workaround if we add the following bellow our `GIT_CONFIG_KEYS` line:
+```perl
+SAFE_CONFIG => {
+ LT => '<',
+ GT => '>',
+},
+```
+
+Thanks to this translation table, we can now specify a go repository like this:
```perl
repo adyxax/bareos-zabbix-check
RW+ = adyxax
config cgit.desc = A Zabbix check for bareos backups
- config cgit.extra-head-content=<meta name="go-import" content="git.adyxax.org/adyxax/bareos-zabbix-check git https://git.adyxax.org/adyxax/bareos-zabbix-check">
+ config cgit.extra-head-content = %LTmeta name='go-import' content='git.adyxax.org/adyxax/bareos-zabbix-check git https://git.adyxax.org/adyxax/bareos-zabbix-check'/%GT
config cgit.owner = Julien Dessaux
config cgit.section = Active
```