Geeks With Blogs

News
Rob Reynolds

Subscribe to Fervent Coder RSS
Subscribe to Fervent Coder by Email

About Me

I manage several open source projects. Need...
   ...package management for Windows?
   ...automated builds?
   ...database change management (migrations)?
   ...your application to check email?
   ...a monitoring utility?

I also write for



Like what you are reading? Want to buy me a cup of coffee?
PayPal - The safer, easier way to pay online!

Fervent Coder Coding Towards Utopia...by Rob Reynolds

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

Posted on Saturday, October 4, 2008 2:50 PM Code , ApplicationsToysOther | Back to top


Comments on this post: Enhancing VisualSVN Server to Allow Anonymous Access

# re: Enhancing VisualSVN Server to Allow Anonymous Access
Requesting Gravatar...
Cool! Thanks for this post and the step by step.
Left by Brian Boatright on Oct 04, 2008 4:45 PM

# re: Enhancing VisualSVN Server to Allow Anonymous Access
Requesting Gravatar...
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.
Left by Kevin Peno on Oct 21, 2008 12:56 PM

# re: Enhancing VisualSVN Server to Allow Anonymous Access
Requesting Gravatar...
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.
Left by Kevin Peno on Oct 21, 2008 12:58 PM

# re: Enhancing VisualSVN Server to Allow Anonymous Access
Requesting Gravatar...
@Kevin: You could limit this by putting "Everyone" ONLY in the repos you want to have complete anonymous access to.
Left by Robz on Oct 21, 2008 6:37 PM

# re: Enhancing VisualSVN Server to Allow Anonymous Access
Requesting Gravatar...
Watch out during upgrades! You will need to edit the httpd.conf file again.
Left by Robz on Nov 09, 2008 8:51 AM

# re: Enhancing VisualSVN Server to Allow Anonymous Access
Requesting Gravatar...
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>
Left by Ivan Zhakov on Nov 18, 2008 10:56 AM

# re: Enhancing VisualSVN Server to Allow Anonymous Access
Requesting Gravatar...
@Ivan : Awesome! Thanks!
Left by Robz on Nov 24, 2008 12:46 AM

# re: Enhancing VisualSVN Server to Allow Anonymous Access
Requesting Gravatar...
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
Left by tommaso on Jun 17, 2009 7:47 AM

# re: Enhancing VisualSVN Server to Allow Anonymous Access
Requesting Gravatar...
@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.
Left by Robz on Aug 02, 2009 1:11 PM

Comments have been closed on this topic.
Copyright © Robz / Fervent Coder | Powered by: GeeksWithBlogs.net | Join free