cGit-UI: A Web Interface for Git Repositories
Check out cGit-UI, which provides a helpful web interface for your Git repo.
Join the DZone community and get the full member experience.Join For Free
cGit-UI is a web interface for Git repositories. cGit-UI is based on CGI script written in С.
cGit-UI supports Markdown files that are processed on the server side using the md4c library, which has proven itself in the KDE Plasma project. cGit-UI provides the ability to add site verification codes and scripts from systems such as Google Analytics and Yandex.Metrika for traffic analysis. Users who want to receive donations for projects can create and import custom donation modal dialogs.
Also, cGit-UI depends on the cScm package. Therefore, before installing cGit-UI, you have to install and configure the cScm Configuration Daemon.
To obtain sources, we have to check it out from the SVN repository:
Then, run the bootstrap script:
Also, the cGit-UI source packages are available for download on the Radix.pro FTP-server.
The bootstrap script was created for Autotools install automation. To install Autotools into the source directory on the build machine (i.e. when build == host), the bootstrap script can be run without arguments.
In this case, Autotools will be installed from current root file system.
For the cross environment, the --target-dest-dir option allows us to install some stuff from the development root file system:
For example, in this case, the aclocal.m4 script will be collected from the
Install on the Build Machine
Cross Compilation Example
Also, we can make use of additional variables, such as CFLAGS, LDFLAGS:
The system user, on whose behalf the Nginx server is launched, must have permission to access the directory in which the cGit-UI CGI script was installed:
Additionally, if the Nginx user doesn't have permission to access repositories, we have to changethe owner of the /var/www/htdocs/cgit/cgit-ui.cgi script and set the SUID or SGID bit:
Since we used the --with-scriptdir=/var/www/htdocs/cgit option on the configuring stage, the cGit-UI CGI script installed in the /var/www/htdocs/cgit/ directory. In this case, the /etc/uwsgi/cgit-ui.ini file should look like this:
/var/www/htdocs/cgit/cgit-ui.cgi is the full name of installed cGit-UI CGI script.
To run the uWSGI daemon for the cGit-UI, backend we can make use following start/stop script:
To run this daemon on systems with BSD-like initialization, such as Slackware, we have to add the following lines to the /etc/rc.d/rc.M and /etc/rc.d/rc.6 scripts correspondingly.
First, we have to add a virtual server to the main Nginx config file:
The following configuration used uWsgi and will serve cGit-UI on a subdomain like cgit.example.org:
Configuring Git Repositories
A detailed description of the configuration file format can be found in the cgit-ui.rc(5) manual page:
As an example, we will look at a working configuration file in which the pkgtools.git repository is presented.
Opinions expressed by DZone contributors are their own.