Enhancing VisualSVN Server to Allow Anonymous Access

Rick Strahl had a great recent post on Running VisualSVN Server for Subversion Source Control. I have been running VisualSVN Server for my repositories for a little while now and especially love how painless the setup is. Not to mention that VisualSVN Server is 100% free!

One part that I especially liked was the part I have been missing and that is anonymous access to repositories.  I have been thinking about having this for awhile and with Rick's post I was able to allow it:

Anonymous Repository Access

Speaking about authentication and repository access permissions, one thing that took me a while to get though is how to configure anonymous access. By default Visual SVN Server requires users to log in to access the repository, even when the Everyone account is set up with ReadOnly access. Unfortunately VisualSVN Server doesn't appear to provide an option to enable this functionality and it turned out to be a bit frustrating to set up the Everyone account with ReadOnly access and still be prompted for a required username and password. By default the Everyone account still needs to be an authenticated account.

As I mentioned I'm a dork when it comes to Apache configuration, but the fix for this is easy (thanks to Matthieu who commented on a previous post) by using Satisfy Any in the virtual directory configuration:

<Location /svn/>
  DAV svn

  SVNListParentPath on
  SVNParentPath "c:/SvnWestWind/"
  SVNIndexXSLT "/svnindex.xsl"
  SVNPathAuthz on

  AuthName "Subversion Repositories"
  AuthType Basic
  AuthBasicProvider file
  AuthUserFile "c:/SvnWestWind//htpasswd"
  AuthzSVNAccessFile "c:/SvnWestWind//authz"

  Satisfy Any
  Require valid-user
</Location>

 

This is sweet! But in the comments on user asked how to do get the everyone set up and where to find the virtual directory configuration file.  I had the same questions, but after about 3 minutes I figured it all out.

How to Get the Anonymous Access Up and Running on VisualSVN Server


1. Edit the file as in Rick's Post. The file can be found here:

%VisualSVN Server Root Install Directory%\conf\httpd.conf (most likely C:\Program Files\VisualSVN Server\conf\httpd.conf).

2. After you edit the file, restart the service for good measure (may not be required).
3. Open VisualSVN Server MMC snap in and right click on Repositories. Select {Properties...}. To do this for a single repository (instead of all, just select the properties of that repository instead).

image image

 
4. Click {Add..} (on the Security tab).

image 


5. Select Everyone. Click {OK}.

image 


6. Change access to {Read Only}. Click {Apply}. Click {OK}.

image 


7. Reload your web page or try to connect to the SVN repository with no username/password. You should be good to go! :D

Print | posted @ Saturday, October 4, 2008 2:50 PM

Comments on this entry:

Gravatar # re: Enhancing VisualSVN Server to Allow Anonymous Access
by Brian Boatright at 10/4/2008 4:45 PM

Cool! Thanks for this post and the step by step.
Gravatar # re: Enhancing VisualSVN Server to Allow Anonymous Access
by Kevin Peno at 10/21/2008 12:56 PM

I've been doign a slight variation to this for some time, but one thing that has annoyied me. If you do setup anon access, the WWW service of it will show everyone every repo in the site, regardless of their permissions. I've tried playing with the xsl files (anything not compiled), but jsut had no luck getting this changed. I really hope visualSVN is expanded to truely allow anon access in the future without such low level hacking.
Gravatar # re: Enhancing VisualSVN Server to Allow Anonymous Access
by Kevin Peno at 10/21/2008 12:58 PM

P.S.: by "showing everyone every repo in the site", I meant that it will list them all if you go to the svn root, access to each is appropriately controlled.
Gravatar # re: Enhancing VisualSVN Server to Allow Anonymous Access
by Robz at 10/21/2008 6:37 PM

@Kevin: You could limit this by putting "Everyone" ONLY in the repos you want to have complete anonymous access to.
Gravatar # re: Enhancing VisualSVN Server to Allow Anonymous Access
by Robz at 11/9/2008 8:51 AM

Watch out during upgrades! You will need to edit the httpd.conf file again.
Gravatar # re: Enhancing VisualSVN Server to Allow Anonymous Access
by Ivan Zhakov at 11/18/2008 10:56 AM

Good practice use httpd-custom.conf to customize VisualSVN Server, because it will not be overwritten on upgrade/reinstall. Just add something like this:
<Location /svn/>
Satisfy Any
<Location>
Gravatar # re: Enhancing VisualSVN Server to Allow Anonymous Access
by Robz at 11/24/2008 12:46 AM

@Ivan : Awesome! Thanks!
Gravatar # re: Enhancing VisualSVN Server to Allow Anonymous Access
by tommaso at 6/17/2009 7:47 AM

hi guys, I really need your help.

here is the problem: I have a software project in the repository but I don't want that some people access to one or more folders/files. If I set the security on those file everithing is ok. the problem is that, when I create a Branch I have to set again the security rule to access those critical folders/files. how can I do to ensure that access rules are inherited in the branch?

please help me!!

thank you very much!!

Tommaso
Gravatar # re: Enhancing VisualSVN Server to Allow Anonymous Access
by Robz at 8/2/2009 1:11 PM

@tommaso: What happens if they create the branch?

If you really want to limit access to folders/files - consider making those items an external DLL that you import into the project. In other words, those files/folders go into their own limited access repository.
Comments have been closed on this topic.