dist-git/README.md

110 lines
3.3 KiB
Markdown
Raw Normal View History

2017-02-11 21:51:45 +01:00
DistGit
=======
2015-04-10 10:25:09 +02:00
2018-03-25 10:38:27 +02:00
DistGit (Distribution Git) is Git with additional data storage. It is designed to hold content of source rpms and consists of these three main components:
2015-04-10 08:23:03 +02:00
2017-02-11 21:51:45 +01:00
1. Git repositories
2015-04-10 08:23:03 +02:00
2. Lookaside cache to store source tarballs
2017-02-11 21:51:45 +01:00
3. Scripts to manage both
2015-04-10 08:23:03 +02:00
2018-02-21 11:02:33 +01:00
Read here for information about the most recent release: https://github.com/release-engineering/dist-git/wiki
2018-02-21 11:00:57 +01:00
2015-04-17 07:58:59 +02:00
How Does It Work
2015-04-10 08:23:03 +02:00
----------------
2017-02-11 21:51:45 +01:00
RPM source package typically contains a spec file and the sources (upstream tarball + additional patches). Source tarballs, being binary and potentially large, are not very well suited to be placed in a Git repository. On each their update, Git would produce a huge, meaningless diff. That's why DistGit was introduced as it employs an efficient lookaside cache where the tarballs can be stored. The Git repo itself can then be left to do what it does best: keep track of changes on the spec file, downstream patches, and an additional text file called `sources` that contains link to the source tarball in the lookaside cache.
2015-04-14 10:02:09 +02:00
2015-04-15 11:09:07 +02:00
![storage](/images/storage.png)
2017-02-11 21:51:45 +01:00
User Guide
----------
2015-04-13 14:33:47 +02:00
2015-04-17 07:58:59 +02:00
#### 1. Build and Install the Package:
2015-04-13 14:33:47 +02:00
2019-05-28 16:51:21 +02:00
The project is prepared to be built as an RPM package. You can easily build it on [Fedora](https://getfedora.org/) or [CentOS](https://www.centos.org/) with EPEL7 enabled using a tool called [rpkg](https://pagure.io/rpkg-util).
2017-02-11 21:51:45 +01:00
To build the current release, use the following command in the repo directory:
2017-02-11 20:56:10 +00:00
```
$ rpkg srpm && rpkg local
2017-02-11 20:56:10 +00:00
```
2015-04-13 14:33:47 +02:00
2017-02-11 21:51:45 +01:00
Install the resulting RPM package:
2017-02-11 20:56:10 +00:00
```
# dnf install ./noarch/*
```
Clean-up:
```
$ rpkg clean -x
2017-02-11 20:56:10 +00:00
```
2015-04-13 14:33:47 +02:00
#### 2. Configuration:
2017-02-11 21:51:45 +01:00
Enable the lookaside cache by using and modifying the example httpd config:
2015-04-13 14:33:47 +02:00
```
# cd /etc/httpd/conf.d/dist-git/
# cp lookaside-upload.conf.example lookaside-upload.conf
# vim lookaside-upload.conf
```
2017-02-11 21:51:45 +01:00
Lookaside Cache uses https communication and client authenticates with ssl client certificate. The Dist Git service provider needs to issue the client certificate for every user.
2015-04-13 14:33:47 +02:00
2017-02-11 21:51:45 +01:00
#### 3. Users and Groups:
2015-04-13 14:33:47 +02:00
2017-02-11 21:51:45 +01:00
All DistGit users need to:
2017-02-11 20:56:10 +00:00
2017-02-11 21:51:45 +01:00
1. have an ssh server access with private key authentication
2. be in a *packager* group on the server
3. be provided with an ssl client certificate to authenticate with the lookaside cache
2015-04-13 14:33:47 +02:00
2017-02-11 21:51:45 +01:00
#### 4. Install DistGit Web Interface:
2015-04-13 14:33:47 +02:00
2017-02-11 21:51:45 +01:00
Install Cgit, the web interface for Git:
2017-02-11 20:56:10 +00:00
```
# dnf install cgit
```
2015-04-13 14:33:47 +02:00
2017-02-11 21:51:45 +01:00
And point it to the DistGit repositories:
2017-02-11 20:56:10 +00:00
2015-04-13 14:33:47 +02:00
```
2017-04-08 15:15:36 +02:00
echo "scan-path=/var/lib/dist-git/git/" >> /etc/cgitrc
2015-04-13 14:33:47 +02:00
```
2017-02-11 21:51:45 +01:00
It is useful to comment out `cache-size` entry in /etc/cgitrc (or set it to zero) to always get up-to-date repository state at each page refresh.
2015-04-13 14:33:47 +02:00
The web interface will be available on address like `http://your-server/cgit`.
2015-04-17 07:58:59 +02:00
#### 5. Systemd Services:
2015-04-13 14:33:47 +02:00
```
# systemctl start sshd
# systemctl start httpd
# systemctl start dist-git.socket
```
2017-02-11 21:51:45 +01:00
#### 6. DistGit client tools:
2019-03-07 20:03:42 +01:00
To interact with DistGit server, you can use use [rpkg](https://pagure.io/rpkg-util) or [fedpkg](https://pagure.io/fedpkg) command-line tools.
2019-04-04 09:52:19 +02:00
#### 7. Deployment
You can see example of deployement in [Fedora Infastructure](https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/roles/distgit) and in [Copr](https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/roles/copr/dist_git).
2019-04-04 09:54:46 +02:00
2020-05-11 12:14:43 +02:00
Developer Guide
---------------
#### Tests
```
nosetests -vs .
```
2019-04-04 09:54:46 +02:00
LICENSE
-------
Whole project use MIT license. File upload.cgi uses GPLv1.