From 5da6e5f3cac510dbf64e4d863c3f00c312bf3348 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 17 Jul 2022 15:26:23 +0200 Subject: Updated git documentations and wrote a blog post about it --- content/blog/miscellaneous/gitolite-cgit.md | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 content/blog/miscellaneous/gitolite-cgit.md (limited to 'content/blog') diff --git a/content/blog/miscellaneous/gitolite-cgit.md b/content/blog/miscellaneous/gitolite-cgit.md new file mode 100644 index 0000000..bd76991 --- /dev/null +++ b/content/blog/miscellaneous/gitolite-cgit.md @@ -0,0 +1,30 @@ +--- +title: Migrating from gitea to gitolite and cgit +description: A quest for simplicity +date: 2022-07-15 +--- + +## Introduction + +I switched to gitea in 2020 in order to host repositories for non tech people, but I no longer have that need. + +Gitea is simple enough to host but it has way too many features and way too frequent (security) updates! I therefore chose to simplify things again and went back to gitolite which I used for almost a decade before I switched to gitea. I chose to keep a web frontend because I do not want to link to github in my blog articles and settled on cgit to fill that role. + +## Installation and configuration + +The installation is documented in the following docs articles on this website: +- [gitolite]({{< ref "gitolite" >}}) +- [cgit]({{< ref "cgit" >}}) + +If you are following these installation notes as a guide, there is one important thing to know: I wanted to keep gitea links mostly working (at least redirecting to the correct repository), so I create all my publicly available repositories under an `adyxax` folder. This shows mostly in the cgit and nginx configurations. + +## Challenges + +The main challenge I encountered was how to make `go get` or `go install` work with cgit. When go tries to fetch a dependency from a remote git repository, it expects a particular header to be present in the http response, something like: +```html + +``` + +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` -- cgit v1.2.3