Prerequisites:
- WD My Book World Edition II Network-Attached Storage
- A way to remotely log in into the box using the Secure Shell protocol (SSH). You may use the Terminal app on a Mac or Cygwin on Windows.
A word about your folder structure
Before you begin, decide how you are going to organize your SVN repository. For example, you might want to create a root folder for all your repositories, i.e. /shares/svnroot/
.
Then, you can create as many repositories as you like in that folder, i.e. /shares/svnroot/myproject/
.
Step 1: Enable SSH
- Log into the box’s web administrative interface.
- Go to System – Advanced.
- Under “Root access”, check the “SSH access” box. Test to log in by opening a shell and type the following command (replace the example IP with your box’s IP):
ssh 192.168.0.001 -l root
when prompted, enter your root password (the default password is
welc0me
).
Step 2: Install Optware Packet Manager
Instructions from http://mybookworld.wikidot.com/optware:
Run the following commands one-by-one:
feed=http://ipkg.nslu2-linux.org/feeds/optware/cs05q1armel/cross/unstable ipk_name=$(wget -qO- $feed/Packages | awk '/^Filename: ipkg-opt/ {print $2}') wget $feed/$ipk_name tar -xOvzf $ipk_name ./data.tar.gz | tar -C / -xzvf - mkdir -p /opt/etc/ipkg echo "src armel http://ipkg.nslu2-linux.org/feeds/optware/cs05q1armel/cross/unstable" > /opt/etc/ipkg/armel-feed.conf wget http://mybookworld.wikidot.com/local--files/optware/sort_dirname.tar.gz tar xvfz sort_dirname.tar.gz -C /
Step 3: Install Subversion
Run the following command:
/opt/bin/ipkg install svn
This will download and install Subversion in the following location:
/opt/bin
Step 4: Create an SVN user
Ideally, you would create a dedicated user to run your SVN server.
Unfortunately, I run into a permission problem here. I created an SVN user and set it as an owner of the SVN repository with read and write permissions set. Nonetheless, the Subversion daemon was not able to write to any file in the repository.
If anybody knows of a solution, please leave a comment.
For now, I am running SVN as root. So if you are following the instructions, no action needed in this step.
Step 5: Create and Configure a Repository
Create your repository with the following command:
/opt/bin/svnadmin create /repopath
(where /repopath
is path to your repository, for example /shares/svnroot/myproject
)
Now you will need to set up who will be able to access the repository:
Open file /shares/svnroot/myproject/conf/svnserve.conf
in “vi” editor:
vi /shares/svnroot/myproject/conf/svnserve.conf
Enter
i
to enter the editing mode. Locate and change those lines:
anon-access = none auth-access = write password-db = passwd
When you are done editing, enter
Escape
to exit editing mode. Then enter :wq
to save the file and exit the “vi” editor. Set up SVN users in /shares/svnroot/myproject/conf/passwd
in “vi” editor in the same way. More information about setting up svnserve
Step 6: Start SVN Server
Run the following command:
/opt/bin/svnserve -d
If you don’t want to type (or reveal) the full path to your repository, you can invoke svnserve with
-r /shares/svnroot<
:
/opt/bin/svnserve -d -r /shares/svnroot
This way, the users can access the repository like this:
svn://192.168.0.001/myproject
If you would need to stop the SVN server for some reason, type
killall svnserve
Step 7: Import an existing project
If you already have some files that you want to add to your SVN repository, you can import them:
/opt/bin/svn import /myprojectpath file:///shares/svnroot/myproject -m "initial import"
Step 8: Checkout your project and create a working copy
Now you have your SVN server running. Your users can now checkout the project into a working copy:
svn checkout svn://192.168.0.001/shares/svnroot/myproject /local/dir/
Or, if you started svnserve with an
-r /shares/svnroot
option:
svn checkout svn://192.168.0.001/myproject /local/dir/
Enter username and password when prompted.
Hello,
Thanks for the info. After a bunch of digging I found that the trustees system is blocking access to svn for non-root users.
For me running
/usr/local/bin/settrustees -D
got svn working with a dedicated svn user. I unfortunately couldnt get trustees to work properly with svn while enabled.
Thanks for your input Dave.