Fossil User Forum

Guidelines for making a public Fossil host
Login

Guidelines for making a public Fossil host

Guidelines for making a public Fossil host

(1) By sekao on 2020-03-27 20:25:58 [link] [source]

I'm interested in making a simple Fossil host like chiselapp.com. Correct me if i'm wrong, but i assume that Chisel is using Fossil's CGI functionality to serve the UI for each repo (with their chosen skin and other settings). Is this the recommended way to make a fossil host? Is there any way to programmatically get the HTML for a given repo's page so we don't need to run the fossil binary on every HTTP request? I'm sure it's fast enough, i'm just wondering if there are other options for implementing that. Thanks.

(2) By Stephan Beal (stephan) on 2020-03-27 20:41:41 in reply to 1 [link] [source]

The HTML is generated dynamically, partly using state available only in the fossil binary (exposed via TH1) and dependent on the permissions of who is logged in, so it's not possible to simply extract a site's skin for caching purposes.

Though i don't know how Chisel is implemented, it really has no choice other than to run the fossil binary for each repo. It presumably installs a CGI wrapper script for each repo (that's how i have always managed my many repos).

(3) By sekao on 2020-03-27 20:54:58 in reply to 2 [link] [source]

That is probably what i'll try first. However, i'm interested in figuring out if it would be feasible to build a completely custom UI by just running my own queries into each repo. I know this is probably a lot of work, but what if i restricted it to only public, read-only data? In other words, submitting forum posts and any other things that involve writing to the db must be done in your local checkout and pushed.

(4) By Stephan Beal (stephan) on 2020-03-27 21:10:23 in reply to 3 [link] [source]

You can do a very limited form of custom frontend using the JSON API, as demonstrated in this wiki-only custom frontend:

https://fossil.wanderinghorse.net/wikis/cson/

That site uses a completely custom HTML/JS frontend on top of the wiki JSON API to host wiki pages which are written in the GoogleCode wiki dialect and rendered client-side (that was my preferred wiki format back at that time (2011 or 12)).

But such frontends are limited to what the JSON API can do:

https://fossil-scm.org/fossil/doc/trunk/www/json-api/

Noting that JSON requires a custom build, as it's not enabled in the pre-built binaries.

Aside from that, there's never been a custom frontend demonstrated for fossil, and it would seem to be unfeasible, perhaps even impossible, using only currently-existing features.

(6) By sekao on 2020-03-27 21:21:57 in reply to 4 [link] [source]

I didn't know about this, i have a lot of reading to do tonight! Just to be clear, the HTTP mode works by invoking fossil in a separate process and getting the JSON back, right? I assume this isn't some kind of long-running background process that you query whenever you want. I'm ok with the former, i just want to be sure.

(5) By Jacob MacDonald (jaccarmac) on 2020-03-27 21:12:34 in reply to 3 [link] [source]

Should definitely possible, and if the architecture of Chisel is the same as it was in 2017, Chisel itself runs its own queries when editing the properties of repositories. I ran into a version mismatch issue a couple years ago, documented on the old mailing list. Looking at Chisel's code from that time period might prove useful.

(7) By sekao on 2020-03-27 21:26:56 in reply to 5 [link] [source]

I'll check that out. BTW, hi jacob. This is zach, i think you commented on one of my clojure videos a while ago. If i do end up making a fossil host, you can probably guess what language it'll be in :D

(8) By Jacob MacDonald (jaccarmac) on 2020-03-27 23:11:31 in reply to 7 [source]

Figured when I saw the username show up in my inbox. Always fun to run into folks discovering unrelated cool tech :)