Pergunta

I've been working for a while now trying to understand SVN better. I am working with a Mac OSX Lion server. I've been able to set up and getting a SVN running on the machine and make it so I can check in and out documents. However, I want to make it accessible to additional services over the internet,so while many of my colleagues and I are traveling, we can still work in conjunction. I have forwarded port 3690 (I believe that's the SVN port) and the port for ssh was set up previously.

I installed the SVN Repository at /Library/Subversion/Repository/, and I have Versions and Terminal on the server to test with. I can connect by using the file:// path parameter but I can not connect using svn+ssh://username@localhost/MyProject.

I know for a fact that I can connect through ssh and the error is "No repository found". I'm guessing I need a different path, but all the Mac OS articles I've read only tell how to set it up on the host not for use over LAN or externally.

Any ideas or thoughts are greatly appreciated. As a reference to the steps I've taken below are some of the links to articles I was working from.

Foi útil?

Solução

First of all, make sure that your Mac firewall isn't blocking you. Can you remotely log in via ssh from another system to your system? If not, go to System Preferences, select the Security and Privacy preference, then select Firewall. You'll need to click the Advanced... button.

Once there, make sure Remote Login (SSH) is active through the Firewall.

Once you've allowed ssh access to your Mac, you'll need to make sure that you have svn+ssh setup correctly. Try from your own Mac to access the repository via svn+ssh:// and not via file://. If you can't do that, you don't have svn+ssh setup correctly.

Setting up Subversion to use svn+ssh is the trickiest of the four ways to access a Subversion repository. Unlike svn:// and http://, the repository server isn't running until the user logs into your system.

When a user connects vis svn+ssh, they immediately start up svnserve in order to access the Subversion repository (that's the svn part of svn+ssh).

Because svnserve runs as the user who used ssh to access the repository, each directory and file created in the physical repository directory will be owned by that user. Thus, you need to make sure that all users who have access to that repository are in the same primary group, and any created files or directories in the Subversion repository directory are read/writeable by that group.

In order to ensure that, you need to take the following steps:

  • Make sure all Mac users who have access to your Subversion repository have the same primary group. You create a group in your Mac using the Users and Groups preference pane. Click on the + as when you're creating a new user, but select Group from the Drop down list. Put everyone who is going to log on in this group.
  • When you create the Subversion repository
    • Make sure that all files and directories the repository directory tree are owned by the Subversion group via the chgrp command.
    • Use the chmod command to make sure the entire directory tree are read/writeable by that Subversion group.
  • You need to set each user's umask to 002 or 0002 instead of the default 022 or 0022. This way, when the user creates a new directory or file in the repository, it can be read and written by any other user in the group. Otherwise, one user will create a change, but other users won't be able to make modifications.

Take a look at these links from the on line Subversion manual:

Outras dicas

Yes, I'm adding another answer...

You might want to try a third party server like Assembla instead of trying it on your Mac. This will give everyone access without making your personal machine a server that needs to be up 24/7/365.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top