Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a scenario here and I'm hoping there's some tool our there that can do this.

I would like to be able to control a SVN checkout without being SSH'ed in. Meaning, I would be able to run svn update's and stat's without being SSH'ed into the server. Is there some type of web interface that would allow me to do this? Or is this just some one-off that I need to write?

Thanks.

UPDATE:

OK, here's the scenario. This may help clarify my needs.

  • Company X hosts www.foo.com on their servers
  • Foo inc. owns the code and wishes to host the SVN repo.
  • Company X does not want to give Foo inc. SSH into their servers for security reasons.

How does Foo inc. and Company X promote code to the Company X's servers? Company X is the easy case, I just can't figure out how to get Foo inc to. I know I can write some custom script with system calls but I was hoping for a packaged solution.

Thanks again. Reading great stuff so far.

share|improve this question

7 Answers 7

up vote 5 down vote accepted

Totally do-able and very thoroughly documented in the SVN book

Edit: to elaborate a bit: Subversion ships with an apache module mod_dav_svn which together with apache's mod_dav can be configured to give very flexible & configurable access to any, or all of your repositories over http/1.1 - ie svn list https://svn.my.domain/.

share|improve this answer
    
Maybe I misspoke, I'm not looking to access repos, I'm looking to access the working copy on our servers so I can update and stat them without having SSH access. –  lumberg55 Aug 11 '09 at 17:30

If you're simply looking to view a repository, simple tools like websvn mentioned above may do the trick. If, however, you're looking to manage a checkout by either committing or pulling a fresh copy of code from a web browser, you could use something simple like a system call in perl via a cgi application. The code could be as simple as stuffing this in a cgi:

#! /usr/bin/perl -w

my @args = ("svn", "update", '/path/to/checkout');
system(@args) == 0 or die "system @args failed: $?";
share|improve this answer

Subversion supports several access methods that support full manipulation of the repository:

  • http/https: requires the use of Apache 2 with the mod_dav_svn module
  • file: requires "direct" access to the repository filesystem (network filesystems should be fine, if less performant)
  • svn: a svn proprietary protocol that requires you run the svnserve process. There is a variant of this called svn+ssh which runs the daemon on-demand over an SSH connection, but this doesn't meet your requirements

If you want to perform a checkout, you have to choose one of the above. All of these require that you have a SVN client on your client system (the command line interface or a GUI like TortoiseSVN)

The other options that some people have suggested (WebSVN, etc.) are typically PHP or Perl CGI applications that provide a read-only view of the repository. Some will let you export whole directories, but they won't let you perform a proper checkout that you can subsequently check changes into.

There is also the post-commit hook option that will keep a checked-out copy of the repository in a mirror directory which you can expose via your webserver, but this is really just a poor man's version of the CGI applications mentioned.

share|improve this answer

You may be able to use something like PHP Shell (http://phpshell.sourceforge.net/) to do this. It really depends on the use case. If you want a secure way to give others users the ability to perform commands on the working copy, your best bet may be a one-off script. However, if this is only for your own use and you are willing to put up with PHP Shell and having to enter the commands you that you would like to run as if you are SSHed in, then it should get the job done.

You should also investigate the use of svn repository hooks to accomplish what you want (depending on your use case). Using a post-commit hook you can e.g. update the checkout when ever a commit is made to a particular branch. (Simply use svn look to see if any files from that branch are changed and if so run svn up on your repository. You may have to use sudo to get the permissions right since the hook runs as your web server or svnserve user.) The subversion manual is a good resource for learning more about this.

share|improve this answer

This is VERY useful.

http://tortoisesvn.tigris.org/

share|improve this answer
    
+1 because its quite a good tool for windows Users –  ThorstenS Aug 11 '09 at 7:02
1  
Ok, I'm taking my -1 back because of the possibility using TortoiseSVN in conjunction with http. You will have to go through extra steps, however, to make your SVN repo available via http. See disabledleopard's answer for this. –  squillman Aug 11 '09 at 8:10

I'm confused about what you want to do. Do you want to view a repository? See the contents, see the history, see the logs? If you really want to deal with a checkout instead of a repository, why? What will it be used for? You don't mention being about to edit the checkout, which makes stat a little bit pointless. I suspect there are other ways of doing what you want. Update your question with what you're trying to do and I'll try to give more specific help.

share|improve this answer

Try DoctorSVN, it does not have a proper release and is a little buggy but with some tweaks you can get it to work. Hope that helps.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.