On Feb 3, 2010, at 1:33 AM, Ron Aaron wrote:

> Hi all -
>
> At the moment, I'm serving a number of repositories from the same  
> CGI-based
> Apache server, using a separate script for each repo.  This works  
> fine, of
> course.
>
> What I would like to do, is have "magic" happen so that I can simply  
> put a new
> Fossil repo on the server, and have it available without  
> necessitating another
> CGI script.

With check-in http://www.fossil-scm.org/fossil/vinfo/49cffc0187 the  
multi-repository feature of Fossil is enhanced in two ways:

(1) For the "fossil http" and "fossil server" commands when the  
REPOSITORY is really a directory full of repositories, there is now a  
new command-line option:  "--notfound URL".  If the pathname does not  
match any of the repositories in the directory, then instead of  
issuing a 404 Not Found reply, the server issues a 302 Moved  
Temporarily redirect to the URL specified as an option to the -- 
notfound.  You can use this to specify a default repository, or to  
redirect to some other page that provides a listing of available  
repositories.  Example:

      fossil server -port 80 -notfound default .

In the above, Fossil listens on port 80 and processes requests against  
repositories in the working directory.  If the pathname does not  
specify a valid repository, the repository "default.fossil" is used.

The command above works all the time on windows.  On unix, you have to  
be root in order to bind to port 80.  But this is safe, it turns out.   
Fossil will automatically put itself into a chroot jail and drop root  
privileges prior to processing user input.  Fossil will chroot to the  
directory that holds the repository.  If a repository is specified  
directly, then fossil will take on the same userid and groupid as the  
repository file. If a directory-of-repositories is specified, then  
fossil will take on the userid and groupid of the directory.
As of the 49cffc check-in the automatic chroot jail feature works with  
the "server" command in addition to the "http" command, and automatic  
chroot jail also works with the directory-of-repositories feature.

(2) The CGI script now has additional options to make use of the  
directory-of-repository feature and the --notfound redirect.  Example:

       #!/usr/bin/fossil
       directory: /home/www/fossil
       notfound: /sqlite

In the example above, the directory /home/www/fossil presumably  
contains many fossil repositories.  The first element of the pathname  
selects the repository.  If the first element of the pathname does not  
match any repository, then a 302 redirect to /sqlite (which will  
target the sqlite.fossil repository)l is performed.

Setting up a Fossil server is getting complicated with all these new  
possibilities.  Can someone please write up a concise tutorial for new  
users.  Perhaps begin with the simple and easy cases, then guide the  
reader toward more complex settings made possible by resent changes.

D. Richard Hipp
d...@hwaci.com



_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to