|
5 | 5 |
|
6 | 6 | A daemon to mirror remote Git repositories and serve them over HTTP, automatically updating the mirror as needed.
|
7 | 7 |
|
8 |
| -It was developed to be used in CI environments to improve the performance of Git clone operations. |
| 8 | +It was developed to be used in CI environments to improve the performance of Git clone and fetch operations. |
9 | 9 |
|
10 | 10 | The project is a C++ clone of jonasmalacofilho's [git-cache-http-server](https://github.com/jonasmalacofilho/git-cache-http-server).
|
| 11 | +However, there are these differences and improvements: |
| 12 | +* The repository cache is updated sequentially and for each git fetch or clone operation to avoid race conditions when the remote is updated while some request is updating the cache. |
| 13 | +* The authentication works by fetching or cloning the remote instead of testing if the remote is accessible using the credentials. |
| 14 | +* It can easily be configured to run as a systemd daemon. |
11 | 15 |
|
12 | 16 | ## Build Instructions
|
13 | 17 |
|
14 |
| -* Clone the repository and initialize submodules. |
15 |
| -* Build the project with `cmake`. |
16 |
| -* You can build a `deb` package using the target `package` in CMake. |
| 18 | +It was developed on Debian-based platforms, it can probably also be compiled on other platforms, but don't ask me how. |
| 19 | + |
| 20 | +* Clone the Git repository and initialize submodules. |
| 21 | +* Install zlib1g-dev `sudo apt-get install zlib1g-dev` |
| 22 | +* Build the project with CMake. |
| 23 | +* You can build a *deb* package using the target *package* in CMake. |
17 | 24 |
|
18 | 25 | ## Server Setup
|
19 | 26 |
|
20 |
| -* Install `git`. |
21 |
| -* Install `gchsd` from the `deb` package. |
22 |
| -* Configure a cache directory (default is `/tmp/gchsd`) and listen port (default is `80`) in `/etc/gchsd.conf`. |
23 |
| -* Start the `gchsd` daemon with `sudo systemctl start gchsd`. |
| 27 | +* Install *git*. |
| 28 | +* Install *gchsd* from the *deb* package. |
| 29 | +* Configure a cache directory (default is */tmp/gchsd*) and listen port (default is *80*) in */etc/gchsd.conf*. |
| 30 | +* Start the *gchsd* daemon with `sudo systemctl start gchsd`. |
24 | 31 | * You can use `sudo systemctl enable gchsd` to start the daemon automatically after a system restart.
|
25 | 32 |
|
26 | 33 | ## Client Setup
|
27 | 34 |
|
28 |
| -* Run `git config --global url."http://<mirror_server_addr>/".insteadOf https://` to use the mirror instead of the original source. |
| 35 | +* Run `git config --global url."http://<mirror_server_addr>/https://".insteadOf https://` to use the mirror instead of the original source. |
0 commit comments