Skip to content

Commit ba73c52

Browse files
Improved README with example, dependencies and service configuration
1 parent 999dd70 commit ba73c52

File tree

1 file changed

+49
-8
lines changed

1 file changed

+49
-8
lines changed

README.md

+49-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,58 @@
11
A caching Git HTTP server
22
============================
33

4-
Serve local mirror repositories over HTTP, automatically updating them as needed.
4+
Mirror remote repositories and serve them over HTTP, automatically updating
5+
them as needed.
56

6-
Features:
7+
Currently supported client operations are fetch and clone. Authentication to
8+
the upstream repository is always enforced (for now, only HTTP Basic is
9+
supported), but public repositories can be used as well.
710

8-
- fetch & clone through the "smart" HTTP transfer protocol
9-
- automatic cloning and syncing of the mirror
10-
- enforced authentication to upstream before allowing any request
11-
- public repositories
12-
- Basic HTTP authentication
11+
# Usage
1312

14-
To install, run: `npm install -g jonasmalacofilho/git-cache-http-server`
13+
```
14+
Usage:
15+
git-cache-http-server.js [options]
16+
17+
Options:
18+
-c,--cache-dir <path> Location of the git cache [default: /var/cache/git]
19+
-p,--port <port> Bind to port [default: 8080]
20+
-h,--help Print this message
21+
--version Print the current version
22+
```
23+
24+
The upstream remote is extracted from the URL, taking the first component as
25+
the remote hostname.
26+
27+
Example:
28+
29+
```
30+
$ git-cache-http-server --port 1234 --cache-dir /tmp/cache/git &
31+
$ git clone http://localhost:1234/github.com/jonasmalacofilho/git-cache-http-server
32+
```
33+
34+
# Installing
35+
36+
Requirements: `nodejs` and `git`.
37+
38+
Install: `npm install -g jonasmalacofilho/git-cache-http-server`
39+
40+
To install as a service, check the `doc/git-cache-http-server.service` example
41+
service file.
42+
43+
For Systemd init users, this file should not require major tweaks other than
44+
specifying a different than default port number or cache directory. After
45+
installed in the proper Systemd unit path for your distribution, issue:
46+
47+
```
48+
systemctl daemon-reload
49+
systemctl start git-cache-http-server
50+
```
51+
52+
# Implementation
53+
54+
The current implementation is somewhat oversimplified; any help in improving it
55+
is greatly appreciated!
1556

1657
References:
1758

0 commit comments

Comments
 (0)