Mananging a few fossil repositories can be daunting compared to the ease of using github for projects.
I host my fossil repositories on the same machine as my blog. nginx serves my blog as static files courtesy of jekyll and it passes fossil requests to the inetd-managed fossil server on port 8080. I’m using FreeBSD, so adjust your setup accordingly.
The relevant section in /usr/local/etc/nginx/nginx.conf:
server {
server_name fossil.appamatto.com;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
To have inetd manage fossil we need to first add it as a service in /etc/services:
fossil 8080/tcp # Fossil repo hosting
and then let inetd know what to do with fossil requests in /etc/inetd.conf (on one line):
fossil stream tcp nowait.1000 root /home/appamatto/bin/fossil
/home/appamatto/bin/fossil http /home/appamatto/fossil
Lastly, make sure to start your servers and enable their start on boot. In /etc/rc.conf:
nginx_enable="YES"
inetd_enable="YES"
and then in the shell:
# /usr/local/etc/rc.d/nginx start
# /etc/rc.d/inetd start
The above inetd setup assumes that my fossil repositories are stored in ~/fossil. The magic happens in the fossil http command, which is built to serve a directory of fossil files using a url scheme that chops off the .fossil extension. For example, the repository for this blog is stored in ~/fossil/appamatto.fossil and the url for the repository is /appamatto.
Now that I’ve setup my repository server to manage multiple repositories I am no longer afraid to create quick one-off repositories for my smaller projects. I’d love to hear about further fossil management— managing user credentials across multiple repositories (see update) or their web templates/styles.
It turns out that single sign-on between fossil repositories is easy to setup. Fossil creator drh gives a bit of explanation on the mailing list.
Navigate to Login-Group in the Admin area of your fossil repository. Create a new group (I called mine “group”) and then enter the path to the other repository you’re joining. If you’re using the instructions in this post then the path should be something like /foo.fossil. Thanks for the tip, dchestnykh!