# Subversion and Git Integration OpenProject can (by default) browse subversion and git repositories, but it does not serve them to git/svn clients. However, with the help of the apache webserver it is possible to serve repositories. ## Set-up OpenProject should run integrated in your apache setup. This can be done in several ways (for example by using the passenger module). In this document we assume that you run OpenProject using a separate process, which listens for requests on http://localhost:3000. We let apache serve svn and git repositories (with the help of some modules) and authenticate against the OpenProject user database. Therefore we use an authentication perl script located in extra/svn/OpenProjectAuthentication.pm . It requires some apache modules to be enabled and installed:
aptitude install libapache2-mod-perl2 libapache2-svn a2enmod proxy proxy_http cgiNote that mod_cgi is required by git. If you use SVN only, you do not need that. The same thing applies vice versa with libapache2-svn - you do not need that if you use git only. Also, the extra/svn/OpenProjectAuthentication.pm script needs to be in your apache perl path (for example it might be sym-linked into /etc/apache2/Apache). To make the authentication work, you need to generate a secret repository API key. To do this, open your OpenProject installation in your favourite web browser, log in as an administrator and go to Modules -> Administration -> Settings -> Repositories. On that page, enable the "Enable WS for repository management" setting and generate an API key (do not for get to save the settings). We need that API key later in our apache config. Find a place to store the repositories. For this guide we assume that you put your svn repositories in /srv/openproject/svn and your git repositories in /srv/openproject/git . All things in that repository should be accessible by the apache system user and by the user running your openproject server. ## An example apache configuration We provide an example apache configuration. Some details are explained inline as comments. # Load OpenProject per module used to authenticate requests against the user database. # Be sure that the OpenProjectAuthentication.pm script is located in your perl path. PerlSwitches -I/srv/www/perl-lib -T PerlLoadModule Apache::OpenProjectAuthentication
ruby extra/svn/reposman.rb \ --openproject-host "http://127.0.0.1:3000" \ --owner "www-data" \ --group "openproject" \ --public-mode '2750' \ --private-mode '2750' \ --svn-dir "/srv/openproject/svn" \ --url "file:///srv/openproject/svn" \ --key "REPLACE WITH REPOSITORY API KEY" \ --scm Subversion \ --verbosethe downside (if you want to call it a downside) is that you have to choose which kind (svn or git) of repository you want to create.