Gitile
Gitile (pronounced /gitil/) is a small git forge written in Guile Scheme. It can currently show public repository contents on a website. Visit this project's repository to have a look at what it can do.
How to Build Gitile
Gitile requires Guile of course, in addition to the following Guile libraries:
- guile-git (for accessing git repositories)
- guile-commonmark (for markdown highlighting)
- guile-syntax-highlight (for other syntax highlighting)
- guile-fibers (for running a multithreaded web server)
- guile-gcrypt (for a hash computation)
You will also need the usual suspects:
- autotools
- make
- pkg-config
From this repository, run the following:
./bootstrap
./configure
make
To install run:
make install
How to Run Gitile?
Before running gitile, you will need a configuration file. The configuration is a record that contains all of the following keys, as in the following example:
;; gitile.conf
(config
(port 8080)
(host "localhost")
(database ((asset-directory . #f)
(avatar-url-template . "https://avatar.lepiller.eu/cat-avatar-generator.php?seed=$hash")
(avatar-hash-algorithm . sha1)))
(repositories "/srv/git")
(base-git-url "https://git.example.org/git")
(index-title "My projects")
(intro ((p "Content of the intro on index page")))
(footer ((p "Footer content")))))
- port: the port on which to listen
- host: the host on which to listen
- database: currently abused to set additional optional parameters
- repositories: The directory in which public repositories can be found
- base-git-url: The base url for cloning repositories
- index-title: The title for the index page
- intro: The content of the introduction text on the index page. It is a list of sxml expressions.
- footer: The content of the footer text on all pages. It is also a list of sxml expressions.
Database can be set to an alist of the following keys and values:
- asset-directory: the string with a full path to the static asset directory of gitile to serve them for development or the #f value to disable this feature.
- avatar-url-template: the string containing an avatar generator url template where the string $hash is replaced with commit email hash.
- avatar-hash-algorithm: the symbol of a gcrypt hash algorithm used for computing commit email hash.
The config example above represents the default values for these keys.
Save the file as gitile.conf
(or whatever name you like) and run gitile with
./pre-inst-env scripts/gitile -c gitile.conf
It should be running on localhost:8080
.
If you don't get any assets, configure asset-directory as described above, but note that this is only suitable for local development. For production you need to have them served directly, for instance with Nginx acting as a reverse proxy for gitile.
Repository Configuration
In order to show information such as a description, a nice name, and a short
summary for each repository, you need to configure it in the repository, with
git config
. We use the gitweb.*
configuration space for that.
- gitweb.description: The long description shown on the index page, it can contain arbitrary html tags.
- gitweb.synopsis: The short summary shown on the project page.
- gitweb.name: The nice name shown on the index page.
For instance, you can set the following on a repository:
cd /srv/git/my-repo
git config --local gitweb.description "My repository is a wonderful project that will <b>conquer</b> the world!"
git config --local gitweb.synopsis "A repo to conquer the world"
git config --local gitweb.name "My Repository"