You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Dave Rolsky <au...@urth.org> on 2002/10/16 20:45:38 UTC

Auto-create repository?

With CVS, if I want to create a new, separate project, and I have write
access to a given directory, I can do this:

 cvs -dautarch@urth.org:/var/lib/cvs import foo initial start

and CVS will create a directory /var/lib/cvs/foo under which files for the
"foo" project can be checked in.  This is entirely separate from the
/var/lib/cvs/bar directory for the "bar" project, and this is a good thing
if those projects have two different groups of developers, because the
permissions can be separate, branches and tags are separate, etc.

Now, with Subversion, to completely separate projects, I can create
multiple repositories under a filesystem directory like /var/lib/svn.
With a "SVNParentPath" directive to mod_dav_svn, I can make these all
accessible via HTTP(S) pretty easily, which is nice and slick.  And of
course, I can use Apache config to manage read/write permissions for each
project.

But there's not way to "auto-create" a new repository.  I still have to go
to the server and do "svnadmin create foo" to make a new, separate "foo"
project repository.

This is not a huge problem, obviously, but it might be nice to have way to
remotely create a new repository.  One usage example might be one where
you are hosting Subversion repositories for multiple companies/groups of
developers.  Each group of developers gets its own "SVN root directory",
under which they can have multiple projects.  Rather than give every
developer a shell account on that one machine, or even give every
developer group an account, it'd be nice to have a mechanism to let them
remotely create a new repository.  This is similar to the recent
discussion about creating parent paths when importing into an existing
repository, but a little different.


-dave

/*==================
www.urth.org
we await the New Sun
==================*/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Ben Collins-Sussman <su...@collab.net>.
Tim Moloney <mo...@mrsl.com> writes:

> Gustavo Niemeyer wrote:
> 
> >>I still think it might be useful to create one remotely,
> > [...]
> > IMHO, that's a task for a CGI script. You could do that in about 10
> > lines of python.
> 
> I tried doing this (but not with Python) but I couldn't figure out
> how to restart httpd.  In other words, after the repository is
> created and httpd.conf is updated to serve it, the CGI can not kill
> and restart httpd to make the new repository visible.

That's why we have the SVNParentPath httpd.conf directive.  Stop
defining repositories with SVNPath, and use SVNParentPath instead.  It
means you don't have to restart apache.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Greg Stein <gs...@lyra.org>.
On Wed, Oct 16, 2002 at 07:53:04PM -0300, Gustavo Niemeyer wrote:
> > >IMHO, that's a task for a CGI script. You could do that in about 10
> > >lines of python.
> > 
> > I tried doing this (but not with Python) but I couldn't figure out
> > how to restart httpd.  In other words, after the repository is
> > created and httpd.conf is updated to serve it, the CGI can not kill
> > and restart httpd to make the new repository visible.
> 
> Yes, it can kill it! With a SIGUSR1 signal, of course. :-)
> 
> This command will do the job for you:
> 
> apachectl graceful

You can't always issue the signal to restart Apache. If the CGI executes
under suexec, for example.

Also, (and I'm not sure if this is the right answer), but you may also need
to be 'root' if your Apache was started as root (then downgraded).

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Gustavo Niemeyer <ni...@conectiva.com>.
> >IMHO, that's a task for a CGI script. You could do that in about 10
> >lines of python.
> 
> I tried doing this (but not with Python) but I couldn't figure out
> how to restart httpd.  In other words, after the repository is
> created and httpd.conf is updated to serve it, the CGI can not kill
> and restart httpd to make the new repository visible.

Yes, it can kill it! With a SIGUSR1 signal, of course. :-)

This command will do the job for you:

apachectl graceful

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Tim Moloney <mo...@mrsl.com>.
Gustavo Niemeyer wrote:

>>I still think it might be useful to create one remotely,
> 
> [...]
> 
> IMHO, that's a task for a CGI script. You could do that in about 10
> lines of python.

I tried doing this (but not with Python) but I couldn't figure out
how to restart httpd.  In other words, after the repository is
created and httpd.conf is updated to serve it, the CGI can not kill
and restart httpd to make the new repository visible.

-- 
Tim Moloney
ManTech Real-time Systems Laboratory
2015 Cattlemen Road                             \     /
Sarasota, FL  34232                     .________\(O)/________.
(941) 377-6775 x208                        '  '  O(.)O  '  '


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Dave Rolsky <au...@urth.org>.
On Wed, 16 Oct 2002, Gustavo Niemeyer wrote:

> > I still think it might be useful to create one remotely,
> [...]
>
> IMHO, that's a task for a CGI script. You could do that in about 10
> lines of python.

Fair enough.


-dave

/*==================
www.urth.org
we await the New Sun
==================*/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Gustavo Niemeyer <ni...@conectiva.com>.
> I still think it might be useful to create one remotely,
[...]

IMHO, that's a task for a CGI script. You could do that in about 10
lines of python.

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Greg Stein <gs...@lyra.org>.
On Wed, Oct 16, 2002 at 04:49:39PM -0500, Dave Rolsky wrote:
>...
> Subversion, OTOH, actually increases the importance of the repository as a
> whole, especially because of the fact that revision numbers are globally
> shared across everything in the repository.  So obviously, each of the
> projects I currently have in a project subdirectory of my CVS directory
> will need its own separate SVN repository.

The revision numbers have no real significance. So the fact that several
projects all share the same repository/revnum is not that big of a deal.

    http://subversion.tigris.org/project_faq.html#globalrev


Having separate repositories is mostly based on security regimes, rather
than anything else. I've got Subversion running on webdav.org, and I plan to
put a number of unrelated projects into the same repos. They're all open
source, so no big deal. For now, the committers can commit anywhere (I trust
people to be adults), but I can always install a hook script to enforce some
ACLs (in fact, we distribute one in /trunk/tools/hook-scripts/).

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Dave Rolsky <au...@urth.org>.
On Wed, 16 Oct 2002, Gustavo Niemeyer wrote:

> > But there's not way to "auto-create" a new repository.  I still have to go
> > to the server and do "svnadmin create foo" to make a new, separate "foo"
> > project repository.
>
> There's no way to auto-create a remote repository in CVS either. You must
> provide users with user/password pairs, and that's what's going to be
> used for creating the repository. Of course, if they already got a
> password, they can create a new "repository" (a sub project, indeed),
> under an already existing cvsroot (a repository).
>
> You can do that with subversion as well. Just locate all "sub projects"
> inside the same repository. If you want to limit access in just created
> "sub projects" to that user who created it, you can easly do that with
> hook tricks.

I see what you're saying.  I think I'm confused by the fact that I have,
in the past, stuck lots of unrelated stuff in a single CVS repository,
because it's easy to do, and since there's very little shared between the
projects under a single repository except the files in CVSROOT, which I
often don't touch ;)

So in practice I'd end up sticking a lot of unrelated project in that
single repository.  I'd manage permissions at the project directory levle,
as opposed to the whole repository (though everyone has to write to
CVSROOT/history).  I can't imagine I'm alone in having done this, though,
given the way CVS is designed.

Subversion, OTOH, actually increases the importance of the repository as a
whole, especially because of the fact that revision numbers are globally
shared across everything in the repository.  So obviously, each of the
projects I currently have in a project subdirectory of my CVS directory
will need its own separate SVN repository.

I still think it might be useful to create one remotely, but I do see that
SVN and CVS do operate the same way, it's just my usage that differs.


-dave

/*==================
www.urth.org
we await the New Sun
==================*/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Gustavo Niemeyer <ni...@conectiva.com>.
> But there's not way to "auto-create" a new repository.  I still have to go
> to the server and do "svnadmin create foo" to make a new, separate "foo"
> project repository.

There's no way to auto-create a remote repository in CVS either. You must
provide users with user/password pairs, and that's what's going to be
used for creating the repository. Of course, if they already got a
password, they can create a new "repository" (a sub project, indeed),
under an already existing cvsroot (a repository).

You can do that with subversion as well. Just locate all "sub projects"
inside the same repository. If you want to limit access in just created
"sub projects" to that user who created it, you can easly do that with
hook tricks.

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Dave Rolsky <au...@urth.org>.
On Wed, 16 Oct 2002, Noel Yap wrote:

> I think the original poster had wanted to allow people
> to be able remotely to create repositories, not just
> different directories within one repository.

That's correct, although I do now realize that there is no such feature in
CVS.  That doesn't mean it wouldn't be useful for the situation I
described earlier.


-dave

/*==================
www.urth.org
we await the New Sun
==================*/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Noel Yap <ya...@yahoo.com>.
--- Dave Rolsky <au...@urth.org> wrote:
> On Wed, 16 Oct 2002, Noel Yap wrote:
> 
> > How will you control who is allowed to create
> > repositories?
> >
> > If you want to allow everyone to be able to create
> > repositories, you might be able to create a user
> > account for this sole purpose.
> 
> Anybody who had "write" access to the "root"
> location for a given
> repository directory.  So if the "/xcorp-svn" URI
> location corresponds to
> "/var/lib/xcorp-svn" on the filesystem, you could (I
> think) configure
> Apache to only allow certain people to perform DAV
> "write"-type methods
> for that location.
> 
> Then people who can't make a repository but can
> write to existing ones are
> given "write" access to "/xcorp-svn/foo".

I think the original poster had wanted to allow people
to be able remotely to create repositories, not just
different directories within one repository.

Noel

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Dave Rolsky <au...@urth.org>.
On Wed, 16 Oct 2002, Noel Yap wrote:

> How will you control who is allowed to create
> repositories?
>
> If you want to allow everyone to be able to create
> repositories, you might be able to create a user
> account for this sole purpose.

Anybody who had "write" access to the "root" location for a given
repository directory.  So if the "/xcorp-svn" URI location corresponds to
"/var/lib/xcorp-svn" on the filesystem, you could (I think) configure
Apache to only allow certain people to perform DAV "write"-type methods
for that location.

Then people who can't make a repository but can write to existing ones are
given "write" access to "/xcorp-svn/foo".


-dave

/*==================
www.urth.org
we await the New Sun
==================*/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Auto-create repository?

Posted by Noel Yap <ya...@yahoo.com>.
--- Dave Rolsky <au...@urth.org> wrote:
> But there's not way to "auto-create" a new
> repository.  I still have to go
> to the server and do "svnadmin create foo" to make a
> new, separate "foo"
> project repository.
> 
> This is not a huge problem, obviously, but it might
> be nice to have way to
> remotely create a new repository.  One usage example
> might be one where
> you are hosting Subversion repositories for multiple
> companies/groups of
> developers.  Each group of developers gets its own
> "SVN root directory",
> under which they can have multiple projects.  Rather
> than give every
> developer a shell account on that one machine, or
> even give every
> developer group an account, it'd be nice to have a
> mechanism to let them
> remotely create a new repository.  This is similar
> to the recent
> discussion about creating parent paths when
> importing into an existing
> repository, but a little different.

How will you control who is allowed to create
repositories?

If you want to allow everyone to be able to create
repositories, you might be able to create a user
account for this sole purpose.

Noel

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org