4. Plugins

4.1. CVS
4.2. CVSTracker
4.3. SVN

Note

Since GForge 4.0, plugins are necessary as source code management is now provided by plugins (SCM* plugins).

For each plugin, you can find an INSTALL file in the plugin tarball.

4.1. CVS

4.1.1. Overview

CVS is now managed via the scmcvs plugin which is included in the plugins/ directory in the tarball downloaded from gforge.org. Most of the files in scmcvs are intended for auto-installation on Debian systems and do not apply to the majority of users. The scmcvs plugin is activated by default in the gforge.sql database and all that you have to do is copy the plugins/scmcvs/etc/* directories to /etc/gforge directory and possibly modify the files slightly.

4.1.2. Cronjobs

Cronjobs for CVS are included in cronjobs/crontab.in, but are commented out by default for your security. The CVS cronjobs are in /var/www/gforge/cronjobs/cvs-cron and consist of:

  • usergroup.php creates user and groups in /etc/passwd, /etc/shadow, and /etc/group.

  • cvs.php creates repositories.

  • ssh_create.php copies SSH keys to user directories.

  • history_parse.php collects statistics.

There are other cronjobs that can be activated too:

  • plugins/scmcvs/cronjobs/tarballs.php creates tarballs

  • plugins/scmcvs/bin/snapshots.sh creates tarballs. CVSROOT and SCMSNAPSHOTSDIR variables are hard-coded in the script, so you'll have to edit the script if necessary.

Make sure these files are executed as root, and have proper execution bits set. Each of these cronjobs has configuration parameters which you may have to edit manually for your specific system. Here is a list of CVS cronjobs:

If you are using CVS 1.12, replace syncmail with updated version.

# cd /var/www/gforge
# cp plugins/scmcvs/bin/syncmail-cvs-1.12 cronjobs/cvs-cron/syncmail

Replace %1{sVv} in /var/www/gforge/cronjobs/cvs-cron/cvs.php with %p %{sVv}. Search for LockDir= in cronjobs/cvs-cron/cvscreate.sh and add the following line after it:

echo "UseNewInfoFmtStrings=yes" >> $repositorypath/CVSROOT/config
				

4.1.3. Installation

Warning

This guide doesn't cover chrooted CVS repositories which are always recommended.

  1. Create default location for CVS repositories ($cvsdir_prefix in GForge configuration file):

    # mkdir /cvsroot
    
  2. Optional: Set up basic index.php file for CVS virtual host if desired. This guide has not further instructions on enabling CVS virtual host.

    # mkdir /var/www/cvs
    # cp /var/www/gforge/cronjobs/cvs-cron/www/* /var/www/cvs
    
  3. Copy the scmcvs plugin config to /etc/gforge:

    # cp -R /var/www/gforge/plugins/scmcvs/etc/* /etc/gforge
    
  4. Make sure the cvs crons are executable:

    # cd /var/www/gforge/cronjobs/cvs-cron/
    # chmod 755 *.php *.sh
    
  5. Copy CVS restricted shell:

    # cp /var/www/gforge/cronjobs/cvs-cron/cvssh.pl /bin
    
  6. Edit GForge Config File /etc/gforge/local.inc and change $sys_path_to_scmweb to be /var/www/gforge/plugins/scmcvs/cgi-bin.

  7. You may have to edit /etc/gforge/plugins/scmcvs/cvsweb.conf to change the cvsroot location:

    'gforge'  => ['GForge-CVS', '/cvsroot/'],
    
  8. Install the following non-core Perl modules:

    • IPC::Run

    • URI::Escape

  9. You may want to user CVS pserver. First, assure that cvspserver service is defined in /etc/services. It will look like this:

    cvspserver      2401/tcp
    cvspserver      2401/udp
    

    Add entry for pserver in /etc/inetd.conf:

    cvspserver stream tcp nowait root /var/www/gforge/plugins/scmcvs/bin/cvs-pserver cvs-pserver

    Make sure that the wrapper script is executable:

    # chmod +x /var/www/gforge/plugins/scmcvs/bin/cvs-pserver
    

    The used wrapper script /var/www/gforge/plugins/scmcvs/bin/cvs-pserver assumes that CVS repositories are in chroot environment and you may want to edit the script and change CHROOTDIR and CVSROOT variables.

    Warning

    CVS pserver has long history of vulnerabilities and its use is highly discouraged.

4.2. CVSTracker

4.2.1. Overview

The cvstracker plugin allows for some integration between CVS commits and the bug tracker and task manager. So, for example, when you commit, you can reference bug and task IDs in your commit message and have the commit linked to the corresponding bug and task.

See the plugins/cvstracker/README file for details. This plugin is enabled by default in the gforge.sql database file. As with the other plugins, you may manually place the config files in /etc/gforge/plugins/cvstracker/ and uncomment the cronjob in crontab.in.

You will also have to copy the newcommit.php file to your gforge www/plugins/cvstracker/ dir

4.2.2. Installation

# cd /var/www/gforge/plugins/cvstracker/
# cp -R etc/plugins/cvstracker/ /etc/gforge/plugins/
				

Edit /etc/gforge/plugins/cvstracker/config.php and change parameters.

Uncomment update_loginfo.php in crontab.

Note

CVS Tracker is not enabled by default for project. You'll have to manually enable it.

4.3. SVN

4.3.1. Overview

SVN is also managed via plugin – the scmsvn plugin is included and activated by default in GForge. As with scmcvs, you have to move the scmcvs/etc/plugins/* files to /etc/gforge/plugins/* and may have to make minor modifications for your specific setup.

There are two ways to manage SVN – one is to have SVN over DAV and the other is to have SVN over SSH just as you do with CVS. If you choose to use DAV, you will need the mod_auth_gforge library compiled and installed in your apache and the appropriate virtual host settings in your httpd.conf. mod_auth_gforge is available from gforge.org. The cronjobs to manage SVN are in cronjobs/dav-svn/ and so are sample httpd.conf virtual host settings. Each of these cronjobs has configuration parameters which you may have to edit manually for your specific system.

Configuring svnserv for svn-over-ssh:

4.3.2. Installation

Note

Instructions here are far from complete.

#Create default location for SVN repositories
mkdir /svnroot

# Optional - Set up some basic files for SVN-over-DAV only
mkdir /var/www/svn
cp /var/www/gforge/cronjobs/dav-svn/www/* /var/www/svn/

#copy the scmsvn config files to /etc/gforge/
cp -R gforge/plugins/scmsvn/etc/plugins/scmsvn/ /etc/gforge/plugins/