(minor)
[gitolite-doc.git] / gitweb-daemon.mkd
blobbb7824108abf95aeca7536a3db24518e767707cc
1 <!-- options: toc -->
3 % allowing access to gitweb and git-daemon
5 include sidebar-toc
7 >   ----
9 >   **Note**: The old gitolite (v1.x, v2.x) used to tie itself into knots
10 >   dealing with gitweb and daemon.  One of the goals of v3 was to get out of
11 >   that game, which your author does not play anyway.  This means statements
12 >   like "...special user called 'gitweb'..." really apply to the [non-core][]
13 >   programs that gitolite ships with, not to "core" gitolite, and any or all
14 >   of this functionality can be disabled by commenting out certain lines in
15 >   the [rc][] file.
17 >   ----
19 >   Also, **note** that gitolite does **not** install or configure
20 >   gitweb/git-daemon -- that is a one-time setup you must do separately.
22 >   ----
24 # gitweb
26 The following repos are deemed to be readable by gitweb:
28   * Any repos readable by the special user `gitweb`.
29   * Any repos containing one or more of the following types of lines:
30     (actually, any config variable starting with `gitweb.`).
32         config gitweb.owner         =   owner name
33         config gitweb.description   =   some description
34         config gitweb.category      =   some category
36     Side note: the following shorter forms are available as [syntactic
37     sugar][sugar] for the above longer forms:
39         owner       =   owner name
40         desc        =   some description
41         category    =   some category
43 The list of gitweb-readable repos is written to a file whose name is given by
44 the [rc][] file variable `GITWEB_PROJECTS_LIST`.  The default value of this
45 variable, if it is not specified or empty, is `$HOME/projects.list`.
47 In addition, each of the config variables described above is written to the
48 repo to which it pertains, so that gitweb can use them.
50 ## changing the UMASK {#umask}
52 Gitweb (or cgit, redmine, etc.) typically runs under a different userid, and
53 the default permissions that gitolite sets make them unreadable.
55 See the section on the `UMASK` variable in the page for the [rc file][rc].
57 ## repo-specific authorisation in gitweb
59 Gitweb has a feature whereby it will call a (perl) function that you supply,
60 passing it the full path to the repo being accessed.  If the remote user is
61 authenticated, the username will be available, so your function can take those
62 two pieces of information and return true or false to allow or deny the
63 repository access.
65 If you want to use gitolite's access rules in making this determination, you
66 will first have to ensure that the HTTP username (i.e., the username known to
67 apache/gitweb) is the same as the gitolite username.  If you're using
68 gitolite's [http][] mode, this is probably already true, but if you're using
69 the more widely used ssh mode, you'll have to make sure they match.
71 You then need to add [this code][gwch] to your gitweb.conf.
73 [gwch]: gitweb.conf.html
75 # git-daemon
77 Any repo readable by the special user `daemon` is deemed to be readable by
78 git-daemon.  For each of these repos, an empty file called
79 `git-daemon-export-ok` is created in the repository (i.e., the `repo.git`
80 directory inside `$HOME/repositories`).
82 # tips
84 Setting descriptions en-masse usually does not make sense, but you can
85 certainly do things like
87     repo @all
88         R       =   gitweb daemon
90 assuming you have other means of setting 'gitweb.description' and
91 'gitweb.owner'.
93 Also see [this][deny-rules] for a twist on that.