Friday, September 16, 2011

Dlink DNS320 NAS as SVN Server

Continuing my previous post about Dlink DNS320 NAS, I would like to share about making this NAS as SVN Server. I am still amazed by this NAS and how handy and quite powerful it becomes, because I have Debian Squeeze installed and running on it. Once I have Debian Squeeze installed I could installed anything I need from the repositories. Please read my previous post on how to install it on this NAS.

Here is how I setup this NAS to become svn server.

Create svn repos directory:

# apt-get update
# apt-get install subversion

# mkdir -p /var/svn/

# svnadmin create /var/svn/projectalpha

Add svn user and group:
# adduser --system --group --shell /usr/sbin/nologin --disabled-login svn

Set the appropriate ownership for the repository directory:
# chown -R svn.svn /var/svn

Add exisiting user to svn group so they will have access to the repo directory:
# useradd -G svn arsya

Now set up an ssh server, clients will connect to this machine using ssh:
Set up ssh server if does not exist yet:
# apt-get install openssh-server

Perform the following command to test via svn+ssh protocol:
$ svn co svn+ssh://username@hostname/var/svn/projectalpha

Now, what if you have your ssh server running on custom port? How can you tell your svn client to use it?

If you are using subversion, the one the you (apt-get) installed earlier, simply update your subversion configuration file in ~/.subversion/config:
sshtunnel = ssh -p

If you are using tortoisesvn client in windows, then you need to go to TortoiseSVN->Settings->Network and set the SSH client to:
C:\Program Files\TortoiseSVN\bin\TortoisePlink.exe -P

Note that I do not need to install apache2 web server, since svn+ssh is enough for me to use. Also it would save some memory usage in this limited memory NAS.

No comments:

Post a Comment