Difference between revisions of "Concurrent Versions System"

From ArchWiki
Jump to: navigation, search
m (remove contractions)
m (add ja link)
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category: Development (English)]] [[Category:Web Server (English)]]
+
[[Category:Version Control System]]
{{i18n|Concurrent Versions System}}
+
[[ja:Concurrent Versions System]]
 
+
{{out of date}}
 
''"[http://www.nongnu.org/cvs/ Concurrent Versions System] is a version control system, an important component of Source Configuration Management (SCM). Using it, you can record the history of sources files, and documents. It fills a similar role to the free software RCS, PRCS, and Aegis packages."''
 
''"[http://www.nongnu.org/cvs/ Concurrent Versions System] is a version control system, an important component of Source Configuration Management (SCM). Using it, you can record the history of sources files, and documents. It fills a similar role to the free software RCS, PRCS, and Aegis packages."''
  
Line 8: Line 8:
 
== Installation ==
 
== Installation ==
  
Update or install to the latest version of cvs and xinetd (as root):
+
Install {{Pkg|cvs}} and {{Pkg|xinetd}}.
# pacman -S cvs xinetd
 
  
 
+
Create the cvs group - members of this group will have write access to the repository:  
Create the cvs group - members of this group will have write access to the repository (as root):  
 
 
  # groupadd cvs
 
  # groupadd cvs
  
 
+
Create the cvs user in the cvs group (-md makes the home directory):
Create the cvs user in the cvs group (-md makes the home directory) (as root):
 
 
  # useradd -md /home/cvsroot -g cvs -p Insecure0 cvs
 
  # useradd -md /home/cvsroot -g cvs -p Insecure0 cvs
  
Line 23: Line 20:
 
Initialize your CVS repository (as cvs):
 
Initialize your CVS repository (as cvs):
 
  cvs% cvs -d /home/cvsroot init
 
  cvs% cvs -d /home/cvsroot init
 
  
 
The permissions on the directory (not the files inside, however) should be 2775 (drwxrwxr-x), but if not, run (as cvs):
 
The permissions on the directory (not the files inside, however) should be 2775 (drwxrwxr-x), but if not, run (as cvs):
 
  cvs% chmod 2775 /home/cvsroot
 
  cvs% chmod 2775 /home/cvsroot
  
 
+
Add any users that you want to have local access to the repository to the group cvs by using the following two steps.
Add any users that you want to have local access to the repository to the group cvs by using the following two steps. The 'adduser' script is very handy.
+
You can add pre-existing users to the cvs group with the command:
 
 
 
 
You can add pre-existing users to the cvs group with the command (as root):
 
 
  # gpasswd -a username cvs
 
  # gpasswd -a username cvs
  
 +
Make a xinetd config file:
  
Make a file in /etc/xinetd.d/ called cvspserver with these contents (as root):
+
{{hc|/etc/xinetd.d/cvspserver|<nowiki>service cvspserver
 +
{
 +
        port            = 2401
 +
        socket_type    = stream
 +
        protocol        = tcp
 +
        wait            = no
 +
        user            = root
 +
        passenv        = /home/cvsroot
 +
        server          = /usr/bin/cvs
 +
        server_args    = -f --allow-root=/home/cvsroot pserver
 +
}</nowiki>}}
  
service cvspserver
+
Ensure you have the following line in {{ic|/etc/services}} (add it if not):
{
+
cvspserver 2401/tcp
        port            = 2401
 
        socket_type    = stream
 
        protocol        = tcp
 
        wait            = no
 
        user            = root
 
        passenv        = /home/cvsroot
 
        server          = /usr/bin/cvs
 
        server_args    = -f --allow-root=/home/cvsroot pserver
 
}
 
  
 +
Unset the {{ic|HOME}} variable
 +
# unset HOME
  
Edit /etc/services and add this line containing the information for cvspserver service if does not exist (as root):
+
And [[restart]] {{ic|xinetd.service}}.
cvspserver 2401/tcp    #CVS PServer
 
 
 
Now restart xinetd (as root):
 
/etc/rc.d/xinetd restart
 
  
 
== Configuration ==
 
== Configuration ==
  
Become cvs ("su cvs") and create a 'passwd' file in ~/CVSROOT. To add entries in the file you can use htpasswd command (present in the apache package) like that:
+
Become cvs ("su cvs") and create a 'passwd' file in {{ic|~/CVSROOT}}. To add entries in the file you can use htpasswd command (present in the apache package) like that:
  
 
  htpasswd -b filename username password
 
  htpasswd -b filename username password
Line 71: Line 64:
 
  other:Insecure0:cvs
 
  other:Insecure0:cvs
  
 
+
Now create a 'writers' file in {{ic|~/CVSROOT}}, which grants write privileges to the users you created in 'passwd':
Now create a 'writers' file in ~/CVSROOT, which grants write privileges to the users you created in 'passwd':
 
 
  luser
 
  luser
 
  other
 
  other
  
 
+
Now create a 'readers' file in {{ic|~/CVSROOT}}, which grants read privileges to the users you created in 'passwd':
Now create a 'readers' file in ~/CVSROOT, which grants read privileges to the users you created in 'passwd':
 
 
  anonymous
 
  anonymous
  
NOTE: if a user is present in the readers file cannot have write access too!!
+
{{note|If a user is present in the readers file cannot have write access too.}}
  
 
== Use ==
 
== Use ==

Latest revision as of 13:07, 15 August 2016

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Concurrent Versions System#)

"Concurrent Versions System is a version control system, an important component of Source Configuration Management (SCM). Using it, you can record the history of sources files, and documents. It fills a similar role to the free software RCS, PRCS, and Aegis packages."

This is a quick guide on how to set up the latest CVS server.

Installation

Install cvs and xinetd.

Create the cvs group - members of this group will have write access to the repository:

# groupadd cvs

Create the cvs user in the cvs group (-md makes the home directory):

# useradd -md /home/cvsroot -g cvs -p Insecure0 cvs

Initialization

Initialize your CVS repository (as cvs):

cvs% cvs -d /home/cvsroot init

The permissions on the directory (not the files inside, however) should be 2775 (drwxrwxr-x), but if not, run (as cvs):

cvs% chmod 2775 /home/cvsroot

Add any users that you want to have local access to the repository to the group cvs by using the following two steps. You can add pre-existing users to the cvs group with the command:

# gpasswd -a username cvs

Make a xinetd config file:

/etc/xinetd.d/cvspserver
service cvspserver
{
        port            = 2401
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = root
        passenv         = /home/cvsroot
        server          = /usr/bin/cvs
        server_args     = -f --allow-root=/home/cvsroot pserver
}

Ensure you have the following line in /etc/services (add it if not):

cvspserver 2401/tcp

Unset the HOME variable

# unset HOME

And restart xinetd.service.

Configuration

Become cvs ("su cvs") and create a 'passwd' file in ~/CVSROOT. To add entries in the file you can use htpasswd command (present in the apache package) like that:

htpasswd -b filename username password

then edit che file and add che group, should look like this:

# Format is username:password:group

anonymous::
luser:HopefullySecure0:cvs
other:Insecure0:cvs

Now create a 'writers' file in ~/CVSROOT, which grants write privileges to the users you created in 'passwd':

luser
other

Now create a 'readers' file in ~/CVSROOT, which grants read privileges to the users you created in 'passwd':

anonymous
Note: If a user is present in the readers file cannot have write access too.

Use

You can test out the server using the following commands:

export CVSROOT=:pserver:my_user_name@127.0.0.1:/home/cvsroot
cvs login
mkdir ~/sandbox
mkdir ~/sandbox/myproject
cd ~/sandbox/myproject
echo "this is a sample file" > myfile
cvs import -m "description of myproject" myproject v1 r1
cd ..
rm -R myproject
cvs checkout myproject
cd myproject
echo "some changes to the file" >> myfile
cvs commit -m "Explain changes here" myfile