Tag Archives: SubVersion

HOWTO: Setup a SVN Repository on a Synology NAS (DS1511+)

This document describes setting up a SVN repository on a DSM 3.1 that will be accessable tunneld through SSH like Eclips and Netbeans do.

 

 

Step 1, install SVN from the repository

Login on your NAS as root and run the following command to install SVN. We presume you already have the NAS boostraped ( read more about this in the forum of Synology )

ipkg install svn

Step 2, Setup svnowner user

Add the user svnowner to the /etc/passwd, /etc/shaddow and /etc/group files. I am using UID and GUID 146 for this, check if this ID is really free on your system, else use another UID and GUID

Update the passwd file:
vi /etc/passwd

Add the line:
svnowner:x:146:146:Subversion:/opt/svn:/bin/sh 


Update the shadow file:

vi /etc/shaddow

Add the line:
svnowner:*:10933:0:99999:7::: 

Update the group file:
vi /etc/group

Add the line:
svnowner:x:146:svn 

 

Step 3, Create the SVN root directory
mkdir /opt/svn
chown svnowner:svnowner /opt/svn


Step 4, Initialize the Repository
su – svnowner
svnadmin create –fs-type fsfs /opt/svn/repos

Recommended reading about SVN from the PDF Book below:
Chapter 5: Repository Administration 
http://svnbook.red-bean.com/en/1.6/svn-book.pdf


Step 5, Setup svnserve

Edit the /etc/services file 
su – root
vi /etc/services

and add the following two lines:
svn             3690/tcp                        # Subversion 
svn             3690/udp                        # Subversion            

Edit the /etc/inetd.conf file and add the svnserve
vi /etc/inetd.conf

Add the line
svn stream tcp nowait svnowner /opt/bin/svnserve svnserve -i -r /var/svn 

Restart the intetd with
kill -HUP inetd 

Step 6, Setup authentication
 

NeIn this setup we use the plain text authentication for the repository. It is usefull for a LAN, but not suitable for an internet connection since the communication is in plain text and unencrypted. In a new blog post I’ll cover how to setup an encrypted svn repository using SASL

 vi /opt/svn/repos/conf/passwd

Add your users under [users] the example will add a user joe with password doe
[users]
john = doe

Next we assign what the users can do. The following example will disable public access and allows the user john to perform write and read transactions

vi /opt/svn/repos/conf/svnserve.conf

 

[general]
anon-access = none
auth-access = write
realm = MyRepository
password-db = passwd

 


Step 7, Enjoy!
Go give it a try!

 

NOTE If this setup was to short, have a look at a very extended description at the wiki
http://forum.synology.com/wiki/index.php/Step-by-step_guide_to_installing_Subversion