CVS Repositories

From WeBWorK_wiki
Jump to navigation Jump to search
This article has been retained as a historical document. It is not up-to-date and the formatting may be lacking. Use the information herein with caution.
Outdated IMPORTANT: The content of this page is outdated. Do not rely on the information contained in this page.

Repository arrangement

The WeBWorK CVS repositories are stored in subdirectories of /webwork/cvs on the devel.webwork.rochester.edu server. Each repository is run by a different school. The name of each repository is equal to the second-level domain name of the school which runs it. In other words:

($school) = $domain =~ m/([^.]+)\.edu$/;

The only exception to this rule is the system repository, which contains the WeBWorK system source code.

The mode of each repository's main directory should be 775. The owner should be some member of the wwdev group (whoever is maintaining CVS at the time), and the group should be a group with the same name as the repository. This group should contain each user who should have commit access to the repository.

The CVSROOT subdirectory and its contents, on the other hand, should have mode 755. This is to prevent the deletion (and replacement) of the passwd and readers files, which are required for secure read-only operation of the CVS pserver. The only exception to this is the history file, which should be group-writable.

For example, the rochester repository, run by the University of Rochester (domain name rochester.edu), is stored in the directory /webwork/cvs/rochester, and has owner sh002i, group rochester, and mode 775. The members of the rochester group are gage, apizer, sh002i, malsyned, lr003k, and voloshin.

Creating a new repository

All actions, unless otherwise noted, should be performed by a user who is a member of the group wwdev. The variable $school represents the name of the school. Wherever you see $school in this document, substitue the name of the school, as defined above.

Step 1: Create a group for the school

$ sudo pw group add $school

Step 2: Create users for the school

$ sudo adduser -quiet

Use the value of $school as the username. Use the defaults for all other prompts, except for Invite $school into other groups. Reply to that prompt with:

cvs $school

Being a member of the group cvs allows the users to make CVS lock files.

Step 3: Create the repository's main directory

$ cd /webwork/cvs
$ mkdir $school
$ chmod g+w $school
$ sudo chgrp $school $school

Step 4: Initialize and secure the repository

$ cvs -d /webwork/cvs/$school init

Step 5: Configure anonymous read-only access

$ echo "anoncvs:" > /webwork/cvs/$school/CVSROOT/passwd
$ echo "anoncvs" > /webwork/cvs/$school/CVSROOT/readers
$ chmod -R g-w /webwork/cvs/$school/CVSROOT
$ touch /webwork/cvs/$school/CVSROOT/history
$ chmod g+w /webwork/cvs/$school/CVSROOT/history

Edit the file /usr/local/sbin/cvs-pserver, adding a --allow-root option for the repository. Don't forget the backslash at the end of the line. Please keep the list sorted alphabetically be name to make it easier to edit in the future. The line you create should look like:

--allow-root=/webwork/cvs/$school

Step 6: Tell CVS where to store lock files

Uncomment the line beginning with LockDir in the file $school/CVSROOT/config and set its value to /webwork/cvs/lock/$school.

Add the lock directory and make it world-writeable and sticky:

$ mkdir /webwork/cvs/lock/$school
$ chmod 1777 /webwork/cvs/lock/$school

Step 7: Add files

Each school's repository should probably contain (at least) a module called ${school}_problib.

If the school already has a CVS module, you may be able to move the module into the new repository. Refer to http://ximbiot.com/cvs/manual/cvs-1.11.21/cvs_2.html#SEC25

If you do this, make sure the copied files are group writeable and have the group $school.

  $ cd /webwork/cvs/$school
  $ sudo chgrp -R $school ${school}_problib
  $ sudo chmod -R g+w ${school}_problib

If the school has a directory tree which is not revision controlled, you can import it. For more information, refer to http://ximbiot.com/cvs/manual/cvs-1.11.21/cvs_3.html#SEC40

Step 8: Allow the viewCVS CGI access to the repository

Edit the file /usr/local/viewcvs-0.9.2/viewcvs.conf, adding an entry to the cvs_roots list. The name should be the full name of the school. The path should be /webwork/cvs/$school. Please keep the list sorted alphabetically be name to make it easier to edit in the future. Each line except the last line must end with a comma.

Step 9: Add the repository to the WeBWorKCVS topic

The WeBWorKCVS topic contains a list of all defined repositories. Add the new repository to this list. Again, please keep the list sorted alphabetically be name.

How CVS commit emails work

CVS mails are currently disabled for all repositories besides system. For system, they are sent to openwebwork-cvs@lists.sf.net.