× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Re: subversion configuration

MoonSire
Aspirant

subversion configuration

I am trying to get a subversion server running on my RN314. I have the following packages installed:
root@sausage:/root# dpkg --get-selections | grep subversion
subversion install
subversion-ntgr install


I have created my repository in the directory
/data/Data/svn_repos


Frontview looks very boring since there are no configuration options:


My plan is to access the svn server through https (or http if I can't manage https) and I have found a guide here:(http://adminadventure.wordpress.com/2012/10/31/installing-subversion-on-debian-squeeze-for-http-and-https/) that I think I should be able to follow without any major problems. I just don't know what I dare to touch in the configuration files so that I don't mess up frontview or something else...

Has anyone successfully set up a subversion server on their ReadyNAS running OS6? How did you do it? 🙂
Message 1 of 16
MoonSire
Aspirant

Re: subversion configuration

I found the downloadable virtual machine, which enabled me to tinker freely without fear of breaking anything significant 😉

edit: after more reading, I think my instructions are very strange 😉 better not use these yet...
Message 2 of 16
twinpeaks1
Aspirant

Re: subversion configuration

Hi,

AFAIK, for SVN HTTP(S) access the apache modules "mod_dav_svn.so" and "mod_authz_svn.so" are missing. I think these should be provided by the subversion app.
Anyway, I just installed the svnserve (SVN://) method, to get at least any kind of subversion:

  • Select a place for the SVN repositories. I just created a share 'svn' from frontview for this. This is located at /data/svn. Probably best to don't make it accessible by any network protocol.

  • Create a SVN repository, I called it "projects". Rename it as you like.
    svnadmin create /data/svn/projects

  • Optionally, edit /data/svn/projects/conf/svnserve.conf. I disabled anonymous access completely:

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

  • Edit /data/svn/projects/conf/passwd
    Add usernames and passwords as desired.

  • Create /etc/systemd/system/svnserve.service

    [Unit]
    Description=SVN Server
    After=network.target

    [Service]
    Type=forking
    PIDFile=/run/svnserve.pid
    ExecStart=/usr/bin/svnserve -d -r /data/svn/ --pid-file /run/svnserve.pid

    [Install]
    WantedBy=multi-user.target

  • Start the SVN service with:
    systemctl start svnserve.service

  • If the above worked correctly you can install the service so that it starts automatically on bootup:
    systemctl enable svnserve.service


The SVN server should now be available at svn://<your nas address>/projects (or the name you gave your repository).

Disclaimer: I'm no Linux expert and this might not be the best/safest/whatever approach, but it works for me. Feel free to make suggestions for improvement!

twinpeaks
Message 3 of 16
m11hut
Aspirant

Re: subversion configuration

Hello,

Thanks for your information for setting up an svn. I followed your steps and was able to create one successfully. However, now I'm encountering an authorization failed message when attempting to commit to the repository. Do you, or anyone know how to solve this issue? I believe the issue is because I put the svn server repo directory into the /data/svn/ share, and when I try to connect with the svn user it's failing because it is expecting a valid user associated with my NAS, not the svn user. I'm not sure. I do however never get a prompt to login with a username or password.

Any clarification and insight into solving this issue would be greatly appreciated.

[EDIT]
I found the fix, it seems.

In the svnserve.conf file, just make sure the # symbols (comments) are removed before the:
anon-access = none
auth-access = write
password-db = passwd
Message 4 of 16
corylowe
Aspirant

Re: subversion configuration

Hi,

I'm trying to get subversion running on my RN104. I think I have everything setup, however I think I am missing the modules for apache here:

AFAIK, for SVN HTTP(S) access the apache modules "mod_dav_svn.so" and "mod_authz_svn.so" are missing. I think these should be provided by the subversion app.

How do I get these modules? I installed the app, but I don't see these modules anywhere.

Any help would be greatly appreciated.

Thanks,
Cory
Message 5 of 16
fencer
Aspirant

Re: subversion configuration

Thanks! This post helped me get my SVN up and running
Message 6 of 16
Mibaro88
Aspirant

Re: subversion configuration

Please can someone post a step by step guide for newbie? I have problem after the installation (I get some error here: Start the SVN service with:
systemctl start svnserve.service) my subversion still doesn't work and I don't know how to resolve.
Thank you
Message 7 of 16
Hairy1
Aspirant

Re: subversion configuration

I too am somewhat stuck here, I have svn installed, enabled ssh and have created the projects repo as mentioned, but I cannot connect to it or browse to it.
Where does svn keep its own configuration? I created the svn share in data, the repo I created is in data\svn\projects
The example above talks about creating a service in the etc folder, that doesn't exist on my 104.
Message 8 of 16
twinpeaks1
Aspirant

Re: subversion configuration

I can only speak for my RN102. The above steps were all I did to set up SVN. I can't remember under which firmware version I did the install, but it was the current version back then. I keep the FW always up-to-date, so now I have 6.2.2 and SVN is still running OK.
Are you sure that you don't have the /etc folder? What's the output of this command?
ls /

What firmware are you running?
Message 9 of 16
Hairy1
Aspirant

Re: subversion configuration

Hi TwinPeaks! Sorry for the tardy response, thought I would have got a notification that you replied, silly me I didn't tick the box.

Ok, Im running 6.2.2 according to the 104 admin page.
ls / does show an etc folder:
apps data frontview lost+found opt run srv usr
bin dev home media proc sbin sys var
boot etc lib mnt root selinux tmp

but I cannot see the etc folder when I navigate to the NAS. Im using a Mac, and browsing to the NAS via SMB and AFP.
I can see my shares, and the hidden folders in the data directory (like .apps) but I cannot see an etc folder anywhere. 😞

EDIT: Updated with the full output of ls
Message 10 of 16
Hairy1
Aspirant

Re: subversion configuration

Navigating to the NAS via my windows VM, I still cannot see the etc folder. Im browsing as the admin user btw.
Message 11 of 16
Hairy1
Aspirant

Re: subversion configuration

Got it! Edited the file within vi (yuck!) under SSH.

1 thing I couldn't do was enable the service to auto start, the error I got back is:
root@ReadyNAS2:/etc/systemd/system# systemctl enable svnserve.service
Failed to issue method call: Invalid argument
Message 12 of 16
twinpeaks1
Aspirant

Re: subversion configuration

Good to hear that you got a step further. These system files aren't shared via SMB, so you need direct access to edit them as you did with vi.
On Windows WinSCP is a great tool for such things that makes browsing the file system and editing files very easy, but as the name suggest, it's only for Windows.
Don't know if there are similar tools for Mac.

OK, regarding your error message. It's a bit vague, don't know what "invalid argument" means. Maybe double check that your svnserve.service file contais the above contents. Or maybe check the permissions:

root@readynas:~# ls -l /etc/systemd/system/svnserve.service
-rw-r--r-- 1 root root 224 Feb 14 2014 /etc/systemd/system/svnserve.service
Message 13 of 16
quickly_now
Apprentice

Re: subversion configuration

HOWTO:

This is how I got subversion running on my brand new 314, running stock 6.2.2.

Step 1. Install the subversion app.

This is non trivial because the installation through Frontview seems to be broken (please Netgear how about a check and fix?)

To install it I eventually was able to find (google it) the subversion for readynas OS subversion-ntgr.deb file. Download that, and then use the upload button in frontview to install it.

This will install subversion, but leaves you in the dark as to what to do next. Presumably it could work using the svn: access method, but I want http and https:.

Step 2. Install the missing modules into the web server.

Using SSH login, issue the commands:

apt-get update
apt-get install libapache2-svn

This will download and install mod_dav_svn.so and (although it does not seem to be used or needed... but might depending on access / authentication that you want to use) mod_authz_svn.so.

At this point you are not much further advanced because you need a place for your subversion repository, and a means of pointing the web server at it.

Hence:

Step 3. Make a place for your subversion repositories.

I created mine under /data/.svn

In there I have created htpasswd-file (the authentication password file), and a directory called repos.

under repos, are each of the subversion repositories.

DO NOT make a share through Frontview for the repository location. You DO NOT want to have SMB / NFS / AFS access into the gory guts of the repository, and you don't want standard web access to it either.

Step 4. Tell the web server how to get into the repository.


You need to have a ".conf" file for the web server so that it can figure out the map from a URL to the underlying storage.

NORMALLY, on OS6, it looks like there should be a file under /apps which is the http web server configuration for each app. However there is no such file for the subversion app, and if you made one it would not be used because there is another file which references them all, and it is auto-managed by Frontview (so edits would get eaten). So instead we create a new file in the global apache2 configuration files location.

So, make a new file called SUBVERSION.conf, and create this in /etc/apache/conf.d

In this file, I put this content:

LoadModule authn_default_module /usr/lib/apache2/modules/mod_authn_default.so

<Location /svn/>
DAV svn
SVNParentPath "/data/.svn/repos"

SVNListParentPath On

AuthType Basic
AuthBasicProvider file
AuthName "Source Repository"
AuthUserFile "/data/.svn/htpasswd-file"
Require valid-user
</Location>

Step 5. Make sure you have a valid username and password in you htpasswd-file (Mr Google will help out there).

A few commands will sort that out.

Step 6. Restart the web server.


systemctl restart apache2

Now, point your browser at your nas thus:

http://mynas/svn/

Where "mynas" is the name of your NAS.

You should be prompted for the username and password set up in the htpassword-file above, and when that is entered correctly, you should be able to see and browse the subversion repositories.

Step 7. Niceties


If your NAS is to use port forwarding through the public internet, then forwarding port 80 will show anyone who comes along that you have a readynas there. They will have to use your admin usename and password, but the less you show the better.

So make a new share called something like "webroot", make that the HTTP default, and in that make a file called "index.html". In that file, just enter some text like "Access Denied", save it, and then anyone who casually points a web browser at your NAS (on port 80) gets that message. They, and you, have to use https://yournas/admin to get the admin page.
Message 14 of 16
Hairy1
Aspirant

Re: subversion configuration

Hi quickly_now, thank you for your step by step guide!

Unfortunately I can't open the URL in step 6. The restart of the web server worked (once I fixed the SUBVERSION.conf script due to a copy paste error on my part).
I cannot see anything obvious wrong, I went through all the steps and they appeared to succeed, but the URL (using my nas server name) never returns and so I don't get asked for a username and password (which I generated with one of the various htpasswd generator websites).

Any pointers at what I should check?

EDIT: also I realised the path you suggested for SUBVERSION.conf was incorrect, it should be:
    /etc/apache2/conf.d


Cheers
John
Message 15 of 16
abubakr
Aspirant

Re: subversion configuration

Hello Everyone,

I've had the ReadyNas 314 with 8TB for a while now but still have not managed to set up SVN.

This is my first ever NAS.

I wanted to set up version control for personal programming projects.

I have looked at the guides above and this one http://www.readynas.com/forum/viewtopic.php?f=35&t=19839 however I still haven't managed to get anywhere.

Please can someone guide me to some detailed instructions of how to set up, install, and basic use/demo.

(Sorry if post is in the wrong place)

Regards
Message 16 of 16
Top Contributors
Discussion stats
  • 15 replies
  • 14275 views
  • 1 kudo
  • 9 in conversation
Announcements