Tutorial: Git hosting

In this tutorial, we will follow root as she configures her GNU Guix server to host git repositories.

1. Add Beaver Labs' channel

root follows the instructions in Tutorial: Add Beaver Labs' Channel to Guix. She runs:

guix describe

She checks in the output that Beaver Lab's channel is here (as shown above).

2. Configure SSH

Accessing git repositories requires SSH access1. This is outside the scope of this tutorial. root checks that the intended users are able to connect through SSH.

3. Private or public repos

root must now decide between two mutually exclusive options:

Private and semi-public only
repositories will writable or readable only by authenticated users
Private and public
allow, on a per-repository basis, read access to anonymous users.

3.1. Private and semi-public only

root just has to make sure git is installed on her server. She can do so by editing her /etc/config.scm file and adding a (packages git) form to it. Here is a complete minimal configuration example:

(use-modules
 (beaver system)
 (beaver functional-services)
 (gnu packages version-control))
(-> (minimal-ovh)
    (.openssh)
    (packages git))

3.2. Private and public

root can use Beaver Labs' os/git function to create a special git user on her server. A complete minimal configuration example is:

(use-modules
 (beaver system)
 (beaver functional-services)
 (gnu packages version-control))
(-> (minimal-ovh)
    (.openssh)
    (os/git))

4. Follow-up

Congratulations ! root can now tell her users that they have the ability to host private repositories on the server, by following the "host a git repository" tutorial.

5. Advertisement

Did you like what you read ?

You can help me write more by:

Footnotes:

1

Or file access, or HTTP, or git protocol (see https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols, but SSH is the easiest to set up).