From e85eb98480d0c7af950859e95819901a20923fe7 Mon Sep 17 00:00:00 2001 From: Bradley Taunt Date: Fri, 31 May 2024 14:53:12 -0400 Subject: Begin porting over wiki pages --- wiki/cgit.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 wiki/cgit.md (limited to 'wiki/cgit.md') diff --git a/wiki/cgit.md b/wiki/cgit.md new file mode 100644 index 0000000..ebf8845 --- /dev/null +++ b/wiki/cgit.md @@ -0,0 +1,61 @@ +--- +layout: page +title: cgit +permalink: /wiki/cgit +--- + +This page contains a comprehensive guide to setting up cgit on NearlyFreeSpeech. It is assumed that you already have an account with NFS and also have access to a "site" online. + +Most of the following has been lifted from [NearlyFreeSpeech cgit application walkthrough](https://members.nearlyfreespeech.net/wiki/Applications/Cgit) but has been tweaked and updated. + +You can see a **live version** [here](https://git.btxx.org). + +## Building cgit + +The following assumes that you wish to have cgit running at the top-level of your chosen domain (ie. git.example.com) + +SSH into your account then download and unpack the latest release: + + git clone git://git.zx2c4.com/cgit cgit-src + cd cgit-src + +Create a cgit.conf file with desired locations: + + CGIT_SCRIPT_PATH = /home/public + CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH) + CGIT_CONFIG = $(CGIT_SCRIPT_PATH)/cgitrc + CACHE_ROOT = $(CGIT_SCRIPT_PATH)/cgitcache + prefix = $(CGIT_SCRIPT_PATH)/local + +Get the git sources (needed to build libgit): + + git submodule init + git submodule update + +Build and install it: + + gmake install + +## Configuration + +Make a text file named `cgitrc` where you specified CGIT_CONFIG and add the following (these are some personal defaults to make things cleaner): + + logo=/cgit.png + root-title=main root title + root-desc=description for your git server + root-readme=/home/public/about.md + virtual-root=/ + + about-filter=/home/public/cgit-src/filters/about-formatting.sh + readme=:README.md + readme=:README + + include=/home/protected/cgitrepos + +Then in the specified file (`cgitrepos`), place your repos, ex: + + repo.url=MyRepo + repo.path=/home/public/MyRepo.git + repo.desc=This is my git repository + +**And you should be good to go!** -- cgit v1.2.3-54-g00ecf