Modern Web-UI for SVN Repositories
Installing and configuring cSvn - a modern web interface written in C for Subversion repositories on your server.
Join the DZone community and get the full member experience.Join For Free
cSvn — is a web interface for Subversion repositories. cSvn is based on CGI script written in С.
cSvn supports Markdown files that are processed on the server side using the md4c library, which has proven itself in the KDE Plasma project. cSvn provides the ability to add site verification codes and scripts from systems such as Google Analytics and Yandex.Metrika for trafic analysis. Users who wonder to receive donations for his projects can create and import custom donation modal dialogs.
It should be noted that you can browse not only your own repositories, but also configure viewing of third-party resources via HTTPS and SVN protocols.
The cSvn package consists of two parts. First of which is a regular Linux daemon that is responsible for parsing the configuration file, and the second is a CGI script that responds to HTTP requests. Both parts of the package are installed simultaneously but are maintained independently of each other.
To obtain sources we have to checkout its from SVN repository:
and run the bootstrap script:
Also cSvn source packages are available for download on the Radix.pro FTP-server.
The bootstrap script especially 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 to install some stuff from 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 permissions to access the directory in which the cSvn CGI script was installed:
If you configured access to your repositories on behalf system user named svn, then it would be good to grant permissions to svn user to access to the directory /var/lib/csvn/ which is a home of csvnd(8) daemon:
and also run the csvnd daemon on behalf of that svn user.
To run the csvnd daemon on systems with BSD-like initialization such as Slackware we have to add following lines to the /etc/rc.d/rc.M and /etc/rc.d/rc.6 scripts correspondengly:
For systems which uses systemd initialization you have to set up your own systemd unit like follow:
Since we used the --with-scriptdir=/var/www/htdocs/csvn option on configuring stage, the cSvn CGI script installed in the /var/www/htdocs/csvn/ directory. In this case, the /etc/uwsgi/csvn.ini file should look like this:
Where /var/www/htdocs/csvn/csvn.cgi is the full name of installed cSvn CGI script.
To run the uWSGI daemon for cSvn 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 of all, we have to add a virtual server to the main Nginx config file:
The following configuration used uWsgi and will serve cSvn on a subdomain like csvn.example.org:
Configuring SVN Repositories
A detailed description of the configuration file format can be found in the csvnrc(5) manual page.
Here we will give a working example of a description of the cSvn repository which can be used as a template for your configurations.
To access your own repositories, we recommend the svn+ssh protocol.
Files needed to work on web-client side are placed in the /var/www/htdocs/csvn/.csvn/ directory. By editing the HTML header file /.csvn/html/header.html and cSvn config file /etc/csvnrc user can change favicon.ico, change the theme of syntax highlighting, choose images for his repositories, define keywords for search engines such as Google, and also bunch of the other settings.
Additional information about support of analysis services and custom donation dialogues you can find on csvnrc(5) page.
Opinions expressed by DZone contributors are their own.