SVN

From HackAarhus

Jump to: navigation, search

Just setup svn and tested that it worked. So if you want a repository for your project, you can simply ask and I (User:Illio) (or someone else) will set it up for you. If you want to use Git, then you need to set that up on the server first.. I don't have any experience with this, so can't set it up for you.

If you have access with ssh and you're a sudoer, you can do the following to create a new project (we should probably create an interactive script for this - but I don't have the time right now):

svnadmin create --fs-type fsfs /var/svn-repos/project_PROJECTNAME
chown -R www-data:subversion /var/svn-repos/*
chmod -R 770 /var/svn-repos/*
htpasswd -c /etc/apache2/svn_passwd/project_PROJECTNAME.passwd YOURUSER

Replacing PROJECTNAME with whatever your project's name should be and replacing YOURUSER with the username you want to use. Be sure to check that no one has used the specific project name before.

Now you need to add the project to WebDAV so you can check it out over https (and not just svn+ssh.. which isn't always that practical..). So open /etc/apache2/conf.d/dav_svn.conf for editing and add a section like this:

<Location /svn/project/PROJECTNAME>
          DAV svn
          SVNPath /var/svn-repos/project_PROJECTNAME
          AuthType Basic
          AuthName "Whatever you want to greet SVN users with.. just some short name"
          AuthUserFile /etc/apache2/svn_passwd/project_PROJECTNAME.passwd
          Require valid-user
          SSLRequireSSL
</Location>

Once again replacing PROJECTNAME with your project's name. After having done this, you restart apache like so: "apache2ctl restart", check that you didn't break anything (i.e. check that www.hackaarhus.dk still shows up correctly).

Now you can access your svn repository at https://www.hackaarhus.dk/svn/project/PROJECTNAME (once again, replace PROJECTNAME) with the username and password chosen when you ran the htpasswd command (running it again but without the -c parameter adds new users to the same passwd file.. running it again with the -c parameter deletes any former users defined in the passwd file). For any of you who may be new to svn, you can checkout an svn repository from a shell like so:

 svn co https://www.hackaarhus.dk/svn/project/PROJECTNAME --username YOURUSER

It will tell you the SSL certificate is unsigned, but just accept it permamently, so it doesn't ever bother you about that again. .. For more info on SVN, check out this quick reference: http://www.cs.put.poznan.pl/csobaniec/Papers/svn-refcard.pdf ... There are also a lot of graphic tools for SVN, so just don't have to worry about shells.. TortoiseSVN on Windows, and something like eSVN or RapidSVN for *nix.

There's already a project called "test", but it was just to check that the svn setup worked.. so if you, for some odd and downright stupid reason, want the name "test" for your project, you can just delete the repository that's there (but don't do that unless you know what you're doing.. you need to remove references to it in conf files and such)

Personal tools