greenhouse / petal / petal.1141 lines · 2748B · raw
1.TH PETAL 1 petal\-VERSION
2.SH NAME
3petal \- git web interface
4.SH SYNOPSIS
5.B petal
6.RB [ \-v ]
7.SH DESCRIPTION
8.B petal
9is a CGI program that shows the bare git repositories in
10.IR root .
11A directory
12.IR root / name .git
13is a repository named
14.IR name ;
15names may be nested, such as
16.BR group/repo ,
17up to
18.B maxdepth
19levels.
20Only repositories containing
21.B git-daemon-export-ok
22are shown.
23.P
24Pages are selected by
25.BR PATH_INFO .
26The longest prefix that names a repository is the repository, the rest
27is the page.
28A
29.I ref
30is a branch, a tag or a commit id of 4 to 40 hex digits; the longest
31prefix of the rest that resolves to one is taken.
32Without a
33.IR ref ,
34.B HEAD
35is used.
36.TP
37.B /
38Index of all repositories with description, owner and age of the last
39commit.
40.TP
41.IR /repo ", " /repo /log[/ ref ]
42Log,
43.B loglimit
44commits per page; older pages are reached with
45.BI ?ofs= n .
46.TP
47.IR /repo /tree[/ ref [/ path ]]
48Directory listing or file view with line anchors.
49Files larger than
50.B maxblob
51bytes are not shown.
52.TP
53.IR /repo /raw/ ref / path
54The file as is, served as
55.B text/plain
56or, if binary,
57.BR application/octet-stream .
58.TP
59.IR /repo /commit/ id
60Commit metadata, diffstat and diff, cut after
61.B maxdiff
62lines.
63.I id
64must be a commit id of 4 to 40 hex digits.
65.TP
66.IR /repo /refs
67Branches and tags.
68.P
69Every response carries a Content-Security-Policy that allows only the
70stylesheet and icon from the same origin.
71.SH OPTIONS
72.TP
73.B \-v
74prints version information to stderr, then exits.
75.SH ENVIRONMENT
76.TP
77.B PATH_INFO
78The page.
79.TP
80.B SCRIPT_NAME
81URL prefix for links.
82.TP
83.B QUERY_STRING
84.BI ofs= n
85for the log.
86.TP
87.B HOME
88libgit2 refuses repositories owned by another user unless they are
89listed as
90.B safe.directory
91in
92.IR $HOME /.gitconfig.
93.SH FILES
94.TP
95.IR root / repo .git/description
96One line describing the repository.
97.TP
98.IR root / repo .git/owner
99One line naming the owner.
100.TP
101.IR root / repo .git/git-daemon-export-ok
102Present if the repository is public.
103.TP
104.IR PREFIX /share/petal/style.css ", " icon.svg
105Stylesheet and icon, to be served at
106.B css
107and
108.BR icon .
109.SH EXAMPLES
110.B petal
111sets no resource limits itself.
112Run it through a wrapper:
113.P
114.nf
115#!/bin/sh
116ulimit -t 10
117exec /usr/local/bin/petal
118.fi
119.P
120.BR nginx :
121.P
122.nf
123location = /style.css { alias /usr/local/share/petal/style.css; }
124location = /icon.svg { alias /usr/local/share/petal/icon.svg; }
125location / {
126 include fastcgi_params;
127 fastcgi_param SCRIPT_FILENAME /usr/local/bin/petal-cgi;
128 fastcgi_param SCRIPT_NAME "";
129 fastcgi_param PATH_INFO $uri;
130 fastcgi_pass unix:/run/fcgiwrap.sock;
131}
132.fi
133.SH CUSTOMIZATION
134.B petal
135is configured by editing
136.I config.h
137and recompiling.
138.SH SEE ALSO
139.BR herbarium (1),
140.BR hedge (1),
141.BR git-http-backend (1)