Merge branch '5416-arv-git-httpd' refs #5416
[arvados.git] / doc / install / install-arv-git-httpd.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Install Git server
5 ...
6
7 This installation guide assumes you are on a 64 bit Debian or Ubuntu system.
8
9 The arv-git-httpd server provides HTTP access to hosted git repositories, using Arvados authentication tokens instead of passwords. It is intended to be installed on the system where your git repositories are stored, and accessed through a web proxy that provides SSL support.
10
11 By convention, we use the following hostname for the git service:
12
13 <div class="offset1">
14 table(table table-bordered table-condensed).
15 |git.@uuid_prefix@.your.domain|
16 </div>
17
18 This hostname should resolve from anywhere on the internet.
19
20 h2. Install arv-git-httpd
21
22 First add the Arvados apt repository, and then install the arv-git-httpd package.
23
24 <notextile>
25 <pre><code>~$ <span class="userinput">echo "deb http://apt.arvados.org/ wheezy main" | sudo tee /etc/apt/sources.list.d/apt.arvados.org.list</span>
26 ~$ <span class="userinput">sudo /usr/bin/apt-key adv --keyserver pool.sks-keyservers.net --recv 1078ECD7</span>
27 ~$ <span class="userinput">sudo /usr/bin/apt-get update</span>
28 ~$ <span class="userinput">sudo /usr/bin/apt-get install arv-git-httpd</span>
29 </code></pre>
30 </notextile>
31
32 Verify that @arv-git-httpd@ and @git-http-backend@ are functional:
33
34 <notextile>
35 <pre><code>~$ <span class="userinput">arv-git-httpd -h</span>
36 Usage of arv-git-httpd:
37   -address="0.0.0.0:80": Address to listen on, "host:port".
38   -git-command="/usr/bin/git": Path to git executable. Each authenticated request will execute this program with a single argument, "http-backend".
39   -repo-root="/path/to/cwd": Path to git repositories.
40 ~$ <span class="userinput">git http-backend</span>
41 Status: 500 Internal Server Error
42 Expires: Fri, 01 Jan 1980 00:00:00 GMT
43 Pragma: no-cache
44 Cache-Control: no-cache, max-age=0, must-revalidate
45
46 fatal: No REQUEST_METHOD from server
47 </code></pre>
48 </notextile>
49
50 We recommend running @arv-git-httpd@ under "runit":https://packages.debian.org/search?keywords=runit or something similar.
51
52 Your @run@ script should look something like this:
53
54 <notextile>
55 <pre><code>export ARVADOS_API_HOST=<span class="userinput">uuid_prefix</span>.your.domain
56 exec sudo -u git arv-git-httpd -address=:9001 -git-command="$(which git)" -repo-root=<span class="userinput">/var/lib/arvados/git</span> 2>&1
57 </code></pre>
58 </notextile>
59
60 h3. Set up a reverse proxy with SSL support
61
62 The arv-git-httpd service will be accessible from anywhere on the internet, so we recommend using SSL for transport encryption.
63
64 This is best achieved by putting a reverse proxy with SSL support in front of arv-git-httpd, running on port 443 and passing requests to arv-git-httpd on port 9001 (or whatever port you chose in your run script).
65
66 h3. Tell the API server about the arv-git-httpd service
67
68 In your API server's config/application.yml file, add the following entry:
69
70 <notextile>
71 <pre><code>git_http_base: git.<span class="userinput">uuid_prefix</span>.your.domain
72 </code></pre>
73 </notextile>