Osteoarchaeologist is a set of files that will help you set up Fossil-SCM on shared hosting like Dreamhost. It could also be used on a VPS or anywhere you want to personally host Fossils as a central resource.
What is Fossil? From the website: "Fossil is a simple, high-reliability, distributed software configuration management system with integrated Bug Tracking, Wiki, Forum, Technotes and a built-in web interface." But there's not a good centralized hosting for Fossils like Github/lab or Bitbucket (yet), so I wanted a place to put all of my repos. I already had a Dreamhost account so I built these scripts to help me use Fossil on Dreamhost.
The interface is not pretty, but functional. It's mostly written in PHP, which some say ain't sexy, but it's pre-installed on Dreamhost and most shared hosts so it plays well with others.
- You have a site with Apache and PHP installed. Tested with Dreamhost's Ubuntu and PHP 7.x setup.
- You want the site you put your fossils on to be locked down with basic authentication using Apache's authentication handler. If you don't want to do this, look at
list.php
as an alternative. It doesn't have the ability to create and delete repositories, but it also doesn't allow bad actors to do bad things. - You can ssh into your hosting or otherwise install the fossil executable.
- An example htaccess file
- A php file that lists, creates and destroys repos, along with a configuration file.
- A php file that only lists, without create and destroy is also available.
- A working repo.cgi (based on examples found on Fossil-scm site) to allow apache to reach through to the fossil binary for UI and cloning.
- An index.html to tell people to go away.
- A robots.txt file to tell robots to go away.
- Not included: an
htpasswd
file - but there are instructions on how to set one up.
- Set up a site on a hosting provider. Much of the below is based on what I did for my host at Dreamhost, but it probably translates to other hosts.
- Get a cert so you can turn on https. You probably don't want to push and pull your code over unencrypted connections. Let's Encrypt works well and Dreamhost makes it easy to integrate.
- Download and install fossil (I put it in
~/bin
). You can either ssh into the server and usewget
or download it to your local system and upload through sftp or similar. Make sure to set the execute bit for a group of users that includes the apache/httpd user (chmod +x
). - Decide where you will put your repositories (your fossil files). It should not be in your http doc root. I put it in
~/repos
. Make that directory (mkdir ~/repos
). Make sure your apache/httpd user can read and write to this directory.
These steps assume you will lock down your entire site with a password. If not, skip to "open site" notes below.
- Create a password for your apache site. I followed the tutorial on wpwhitesecurity.
- Put the resulting
.htpasswd
file outside your httpd doc root. I put mine in `~/httpdpasswords.
- Put the resulting
- Put the included
htaccess
in your doc root and rename (mv
) it to.htaccess
. - Change the
AuthUserFile
link in.htaccess
to point to your newly created.htpasswd
file from Step 1. - Put
index.html
file in your http doc root. This doesn't do much, but will likely prevent a directory listing in case something gets misconfigured. - Put
repo.cgi
into your http doc root. This is the bit that allows your localfossil
to communicate withfossil
on this new server. More information on this on the fossil wiki.- Change the path on line 1 in
repo.cgi
(#!/home/YOURUSER/bin/fossil
) to the location of your fossil binary. - Change the path on line 2 in
repo.cgi
(directory: /home/YOURUSER/repos/
) to the location of your repos.
- Change the path on line 1 in
- Copy
index.php
ando_config.php
into your http doc root. You should not have to change anything inindex.php
, all of the properties are defined ino_config.php
. - Update the properties in
o_config.php
. They should be documented correctly, but if you have trouble, open an issue. - Open your website. It should load correctly with a list of files. If it does not, check the apache error log.
As stated in the assumptions section above, this setup assumes one person (or a trusted few people) can see, create and delete all of the fossils on this server. There's no user by user validation so it's imperative that the site be locked down with a server-level password at least. If you don't want the ease and associated danger of creating and deleting fossils from the website, you can use the list.php
file. Alternatively, there are $allow_create
and $allow_delte
configuration variables in o_config.php
. Note: if you use list.php
or turn off allow
functions but leave the site open, the world could see all of the fossils and potentially clone them (although you can prevent that in the individual fossil permissions).
Feel free to contact me to discuss any issues, questions, or comments.
My contact info can be found on my GitHub page.
Copyright 2019 Mark Williams
Released under Apache 2.0 license. See License file.
https://curiouser.cheshireeng.com/2016/07/05/fun-with-dreamhost-fossil/