Mythic Beasts

Hosting CVS

This page explains how you can host a CVS repository from your Mythic Beasts shell account. It assumes that you have at least some experience of using a CVS repository. For more information on CVS itself, please see the CVS manual, or run pinfo cvs from your shell account.

There are two methods of hosting a CVS repository from your account. The first method is suitable for creating a private CVS repository for personal use only. This is done using the CVS ext protocol, and can be done from any Mythic Beasts shell account. If you want a multi-user CVS repository, or a repository that can be made publicly accessible, then you will need our vCVS service. Please see here for an overview of the vCVS service, or see below for details on configuring your vCVS repository.

The ext protocol

CVS allows a repository to be accessed using Remote SHell (RSH), or in our case, Secure SHell (SSH) as the transport. This is the CVS "ext" protocol. This allows you to turn any directory you can access with SSH into a private CVS repository. The ext protocol is accessed by specifying a CVSROOT in the following format:


:ext:USER@HOST:PATH
        

USER and HOST specify the username and hostname for your shell account. PATH specifies the absolute path to the directory you wish to use as your CVS repository. For example:


:ext:user1@sphinx.mythic-beasts.com:/home/user1/myCVS
        

Before you can use the ext method with an SSH account, you must tell CVS to use SSH rather than the default of RSH. You can do this by setting the CVS_RSH environment variable:


export CVS_RSH=ssh
        

Now you must tell CVS where your CVS repository is, using the CVSROOT environment variable:


export CVSROOT=:ext:user1@sphinx.mythic-beasts.com:/home/user1/myCVS
        

You can now create your repository using the CVS init command:


cvs init
        

You now have a working CVS repository! Now you just need to add a module and start committing. There are details on how to do it in the CVS documentation, but as a brief summary:


mkdir myModule
cd myModule
cvs import -m "Initial commit" myModule user1 start
cd ..
cvs checkout myModule
cd myModule
[ create a file called, for example, foo.c ]
cvs add foo.c
cvs commit
        

The vCVS service

A vCVS repository allows you to control what users can access your repository. You will have been given a directory which is your vCVS repository root, for example:


/home/user/vcvs/repos
        

If you do not have this information, please contact support. Before you can use your repository, you must use the vcvs_admin utility to configure your user accounts. To do this run vcvs_admin with your repository root as its only parameter:


vcvs_admin /home/user/vcvs/repos
        

vcvs_admin allows you to add and remove user accounts, and specify which accounts are read-only and which accounts have commit rights on some or all modules. By default your repository will come with two accounts, one user account and one "anonymous" account. To see the list of accouts use the list command:


vcvs_admin> list

 Username            Password    Real user           Read-only
 ------------------- ----------- ------------------- ---------
 pdw                 locked      pdw                 no
 anonymous           locked      pdw                 yes
        

Initially, the passwords for both accounts will be locked. Before you can start using the accounts, you will need to set the passwords. You may decide that you do not wish to give public read-only access to your repository, in which case you can safely delete the "anonymous" account. You can create accounts using the adduser command, and set passwords for existing accounts using the passwd command:


vcvs_admin> passwd pdw
Set password: foobar
vcvs_admin(modified)> adduser user1
Generate password for user (y/n) y
Set password: tec50xaux
vcvs_admin(modified)> deluser anonymous
Delete user anonymous? (y/n) y
vcvs_admin(modified)> list

 Username            Password    Real user           Read-only
 ------------------- ----------- ------------------- ---------
 pdw                 set         pdw                 no
 anonymous           locked      pdw                 yes
 user1               set         pdw                 no

vcvs_admin(modified)> commit
Write changes to disk? (y/n) y
/home/pdw/tmp/vcvs/repos/CVSROOT/readers,v  <--  /home/pdw/tmp/vcvs/repos/CVSROOT/readers
new revision: 1.2; previous revision: 1.1
done
/home/pdw/tmp/vcvs/repos/CVSROOT/passwd,v  <--  /home/pdw/tmp/vcvs/repos/CVSROOT/passwd
new revision: 1.3; previous revision: 1.2
done
/home/pdw/tmp/vcvs/repos/CVSROOT/committers,v  <--  /home/pdw/tmp/vcvs/repos/CVSROOT/committers
file is unchanged; reverting to previous revision 1.2
done
Changes have been committed
vcvs_admin>

        

In order for your changes to take effect, you must type commit, as above. For information on the commands available type help at the vcvs_admin prompt.

Note that it is not possible to restrict which modules a user can read - all users, including the anonymous user, can read all modules. For this reason you should not mix private and public data in the same vCVS repository.

You can use the vcvs_admin utility to create modules and grant write priviledges to individual users:


vcvs_admin> addmodule myModule
vcvs_admin(modified)> grant myModule pdw
vcvs_admin(modified)> listmodules

 Module              Committers
 ------------------- -----------------------------------------
 CVSROOT
 myModule            pdw

vcvs_admin(modified)>
        

Once you have set up your user accounts and modules, you can connect to the repository using the pserver protocol. Your CVSROOT is:


:pserver:user1@sphinx.mythic-beasts.com:/home/user/vcvs/repos
        

Note that the username should be the name of a vCVS account created by the vcvs_admin program, and not your shell account username (although they may be the same).

It's easiest to store this in the CVSROOT environment variable:


export CVSROOT=:pserver:user1@sphinx.mythic-beasts.com:/home/user/vcvs/repos
        

As vCVS uses the pserver protocol you must log in before you can access the repository:


cvs login
        

Type the password set by vcvs_admin when prompted.

You can now checkout any modules created using the vcvs_admin command and start adding files using standard cvs commands.

Copyright © 2000-2008 Mythic Beasts Ltd. All Rights Reserved.